SF.net SVN: geany:[5609] trunk

colombanw at users.sourceforge.net colombanw at xxxxx
Sun Mar 20 15:02:23 UTC 2011


Revision: 5609
          http://geany.svn.sourceforge.net/geany/?rev=5609&view=rev
Author:   colombanw
Date:     2011-03-20 15:02:22 +0000 (Sun, 20 Mar 2011)

Log Message:
-----------
Add new filetype setting "comment_single"

This provides separated single-line and multiline comment support.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/data/filetypes.Genie.conf
    trunk/data/filetypes.Scala.conf
    trunk/data/filetypes.actionscript
    trunk/data/filetypes.ada
    trunk/data/filetypes.asm
    trunk/data/filetypes.c
    trunk/data/filetypes.caml
    trunk/data/filetypes.cmake
    trunk/data/filetypes.cobol
    trunk/data/filetypes.conf
    trunk/data/filetypes.cpp
    trunk/data/filetypes.cs
    trunk/data/filetypes.css
    trunk/data/filetypes.d
    trunk/data/filetypes.diff
    trunk/data/filetypes.docbook
    trunk/data/filetypes.erlang
    trunk/data/filetypes.f77
    trunk/data/filetypes.ferite
    trunk/data/filetypes.forth
    trunk/data/filetypes.fortran
    trunk/data/filetypes.freebasic
    trunk/data/filetypes.glsl
    trunk/data/filetypes.haskell
    trunk/data/filetypes.haxe
    trunk/data/filetypes.html
    trunk/data/filetypes.java
    trunk/data/filetypes.javascript
    trunk/data/filetypes.latex
    trunk/data/filetypes.lisp
    trunk/data/filetypes.lua
    trunk/data/filetypes.makefile
    trunk/data/filetypes.matlab
    trunk/data/filetypes.nsis
    trunk/data/filetypes.pascal
    trunk/data/filetypes.perl
    trunk/data/filetypes.php
    trunk/data/filetypes.po
    trunk/data/filetypes.python
    trunk/data/filetypes.r
    trunk/data/filetypes.restructuredtext
    trunk/data/filetypes.ruby
    trunk/data/filetypes.sh
    trunk/data/filetypes.sql
    trunk/data/filetypes.tcl
    trunk/data/filetypes.vala
    trunk/data/filetypes.verilog
    trunk/data/filetypes.vhdl
    trunk/data/filetypes.xml
    trunk/data/filetypes.yaml
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/callbacks.c
    trunk/src/editor.c
    trunk/src/filetypes.c
    trunk/src/filetypes.h
    trunk/src/templates.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/ChangeLog	2011-03-20 15:02:22 UTC (rev 5609)
@@ -1,3 +1,12 @@
+2011-03-20  Colomban Wendling  <colomban(at)geany(dot)org>
+
+ * data/filetypes.*, doc/geany.txt, doc/geany.html, src/callbacks.c,
+   src/filetypes.c, src/filetypes.h, src/templates.c:
+   Add new filetype setting "comment_single" to provide separated
+   single-line and multiline comment support. Single-line are used in
+   priority to comment code, and multiline to make template comments.
+
+
 2011-03-19  Colomban Wendling  <colomban(at)geany(dot)org>
 
  * src/callbacks.c:

Modified: trunk/data/filetypes.Genie.conf
===================================================================
--- trunk/data/filetypes.Genie.conf	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.Genie.conf	2011-03-20 15:02:22 UTC (rev 5609)
@@ -42,10 +42,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-#comment_open=//
-#comment_close=
-# this is an alternative way, so multiline comments are used
+# single comments, like # in this file
+comment_single=//
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.Scala.conf
===================================================================
--- trunk/data/filetypes.Scala.conf	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.Scala.conf	2011-03-20 15:02:22 UTC (rev 5609)
@@ -19,10 +19,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-#comment_open=//
-#comment_close=
-# this is an alternative way, so multiline comments are used
+# single comments, like # in this file
+comment_single=//
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.actionscript
===================================================================
--- trunk/data/filetypes.actionscript	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.actionscript	2011-03-20 15:02:22 UTC (rev 5609)
@@ -37,9 +37,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.ada
===================================================================
--- trunk/data/filetypes.ada	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.ada	2011-03-20 15:02:22 UTC (rev 5609)
@@ -26,9 +26,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=--
-comment_close=
+# single comments, like # in this file
+comment_single=--
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.asm
===================================================================
--- trunk/data/filetypes.asm	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.asm	2011-03-20 15:02:22 UTC (rev 5609)
@@ -32,9 +32,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=;
-comment_close=
+# single comments, like # in this file
+comment_single=;
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.c
===================================================================
--- trunk/data/filetypes.c	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.c	2011-03-20 15:02:22 UTC (rev 5609)
@@ -46,12 +46,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.caml
===================================================================
--- trunk/data/filetypes.caml	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.caml	2011-03-20 15:02:22 UTC (rev 5609)
@@ -29,7 +29,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open=(*
 comment_close=*)
 

Modified: trunk/data/filetypes.cmake
===================================================================
--- trunk/data/filetypes.cmake	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.cmake	2011-03-20 15:02:22 UTC (rev 5609)
@@ -31,9 +31,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.cobol
===================================================================
--- trunk/data/filetypes.cobol	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.cobol	2011-03-20 15:02:22 UTC (rev 5609)
@@ -25,9 +25,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=*>
-comment_close=
+# single comments, like # in this file
+comment_single=*>
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.conf
===================================================================
--- trunk/data/filetypes.conf	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.conf	2011-03-20 15:02:22 UTC (rev 5609)
@@ -20,9 +20,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.cpp
===================================================================
--- trunk/data/filetypes.cpp	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.cpp	2011-03-20 15:02:22 UTC (rev 5609)
@@ -48,12 +48,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.cs
===================================================================
--- trunk/data/filetypes.cs	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.cs	2011-03-20 15:02:22 UTC (rev 5609)
@@ -48,12 +48,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.css
===================================================================
--- trunk/data/filetypes.css	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.css	2011-03-20 15:02:22 UTC (rev 5609)
@@ -45,7 +45,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.d
===================================================================
--- trunk/data/filetypes.d	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.d	2011-03-20 15:02:22 UTC (rev 5609)
@@ -35,13 +35,12 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
-# this is alternative way, so multiline comments are used
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
+# or alternatively
 #comment_open=/+
 #comment_close=+/
 

Modified: trunk/data/filetypes.diff
===================================================================
--- trunk/data/filetypes.diff	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.diff	2011-03-20 15:02:22 UTC (rev 5609)
@@ -19,8 +19,9 @@
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
 # only the text before the first --- is a comment
-comment_open=
-comment_close=
+#comment_single=
+#comment_open=
+#comment_close=
 
 # context action command (please see Geany's main documentation for details)
 context_action_cmd=

Modified: trunk/data/filetypes.docbook
===================================================================
--- trunk/data/filetypes.docbook	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.docbook	2011-03-20 15:02:22 UTC (rev 5609)
@@ -47,7 +47,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open=<!--
 comment_close=-->
 

Modified: trunk/data/filetypes.erlang
===================================================================
--- trunk/data/filetypes.erlang	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.erlang	2011-03-20 15:02:22 UTC (rev 5609)
@@ -48,9 +48,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=%
-comment_close=
+# single comments, like # in this file
+comment_single=%
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.f77
===================================================================
--- trunk/data/filetypes.f77	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.f77	2011-03-20 15:02:22 UTC (rev 5609)
@@ -33,9 +33,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=c
-comment_close=
+# single comments, like # in this file
+comment_single=c
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.ferite
===================================================================
--- trunk/data/filetypes.ferite	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.ferite	2011-03-20 15:02:22 UTC (rev 5609)
@@ -37,12 +37,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.forth
===================================================================
--- trunk/data/filetypes.forth	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.forth	2011-03-20 15:02:22 UTC (rev 5609)
@@ -26,7 +26,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+comment_single=\\ 
+# multiline comments
 comment_open=(
 comment_close= )
 

Modified: trunk/data/filetypes.fortran
===================================================================
--- trunk/data/filetypes.fortran	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.fortran	2011-03-20 15:02:22 UTC (rev 5609)
@@ -33,9 +33,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=!
-comment_close=
+# single comments, like # in this file
+comment_single=!
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.freebasic
===================================================================
--- trunk/data/filetypes.freebasic	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.freebasic	2011-03-20 15:02:22 UTC (rev 5609)
@@ -37,12 +37,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open='
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/'
-#comment_close='/
+# single comments, like # in this file
+comment_single='
+# multiline comments
+comment_open=/'
+comment_close='/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.glsl
===================================================================
--- trunk/data/filetypes.glsl	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.glsl	2011-03-20 15:02:22 UTC (rev 5609)
@@ -51,12 +51,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.haskell
===================================================================
--- trunk/data/filetypes.haskell	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.haskell	2011-03-20 15:02:22 UTC (rev 5609)
@@ -31,9 +31,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=--
-comment_close=
+# single comments, like # in this file
+comment_single=--
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.haxe
===================================================================
--- trunk/data/filetypes.haxe	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.haxe	2011-03-20 15:02:22 UTC (rev 5609)
@@ -38,9 +38,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.html
===================================================================
--- trunk/data/filetypes.html	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.html	2011-03-20 15:02:22 UTC (rev 5609)
@@ -16,8 +16,10 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
 # these comments are used for PHP, the comments used in HTML are in filetypes.xml
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open=<!--
 comment_close=-->
 

Modified: trunk/data/filetypes.java
===================================================================
--- trunk/data/filetypes.java	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.java	2011-03-20 15:02:22 UTC (rev 5609)
@@ -39,7 +39,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+comment_single=//
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.javascript
===================================================================
--- trunk/data/filetypes.javascript	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.javascript	2011-03-20 15:02:22 UTC (rev 5609)
@@ -36,9 +36,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.latex
===================================================================
--- trunk/data/filetypes.latex	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.latex	2011-03-20 15:02:22 UTC (rev 5609)
@@ -19,9 +19,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=%
-comment_close=
+# single comments, like # in this file
+comment_single=%
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.lisp
===================================================================
--- trunk/data/filetypes.lisp	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.lisp	2011-03-20 15:02:22 UTC (rev 5609)
@@ -29,12 +29,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=;
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=#|
-#comment_close=|#
+# single comments, like # in this file
+comment_single=;
+# multiline comments
+comment_open=#|
+comment_close=|#
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.lua
===================================================================
--- trunk/data/filetypes.lua	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.lua	2011-03-20 15:02:22 UTC (rev 5609)
@@ -44,12 +44,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=--
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=--[[
-#comment_close=]]--
+# single comments, like # in this file
+comment_single=--
+# multiline comments
+comment_open=--[[
+comment_close=]]--
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.makefile
===================================================================
--- trunk/data/filetypes.makefile	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.makefile	2011-03-20 15:02:22 UTC (rev 5609)
@@ -19,9 +19,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.matlab
===================================================================
--- trunk/data/filetypes.matlab	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.matlab	2011-03-20 15:02:22 UTC (rev 5609)
@@ -22,9 +22,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=%
-comment_close=
+# single comments, like # in this file
+comment_single=%
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.nsis
===================================================================
--- trunk/data/filetypes.nsis	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.nsis	2011-03-20 15:02:22 UTC (rev 5609)
@@ -40,9 +40,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=;
-comment_close=
+# single comments, like # in this file
+comment_single=;
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.pascal
===================================================================
--- trunk/data/filetypes.pascal	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.pascal	2011-03-20 15:02:22 UTC (rev 5609)
@@ -33,7 +33,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open={
 comment_close=}
 

Modified: trunk/data/filetypes.perl
===================================================================
--- trunk/data/filetypes.perl	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.perl	2011-03-20 15:02:22 UTC (rev 5609)
@@ -52,9 +52,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open==begin
+#comment_close==cut
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.php
===================================================================
--- trunk/data/filetypes.php	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.php	2011-03-20 15:02:22 UTC (rev 5609)
@@ -12,8 +12,10 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
 # these comments are used for PHP, the comments used in HTML are in filetypes.xml
+# single comments, like # in this file
+comment_single=//
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.po
===================================================================
--- trunk/data/filetypes.po	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.po	2011-03-20 15:02:22 UTC (rev 5609)
@@ -21,9 +21,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.python
===================================================================
--- trunk/data/filetypes.python	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.python	2011-03-20 15:02:22 UTC (rev 5609)
@@ -37,9 +37,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comment char, like # in this file
+comment_single=#
+# multiline comments
+#comment_open="""
+#comment_close="""
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.r
===================================================================
--- trunk/data/filetypes.r	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.r	2011-03-20 15:02:22 UTC (rev 5609)
@@ -32,12 +32,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.restructuredtext
===================================================================
--- trunk/data/filetypes.restructuredtext	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.restructuredtext	2011-03-20 15:02:22 UTC (rev 5609)
@@ -9,12 +9,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=..
+# single comments, like # in this file
+comment_single=..
+# multiline comments
+#comment_open=
 #comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.ruby
===================================================================
--- trunk/data/filetypes.ruby	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.ruby	2011-03-20 15:02:22 UTC (rev 5609)
@@ -49,9 +49,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open==begin
+#comment_close==end
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.sh
===================================================================
--- trunk/data/filetypes.sh	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.sh	2011-03-20 15:02:22 UTC (rev 5609)
@@ -27,9 +27,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start a column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.sql
===================================================================
--- trunk/data/filetypes.sql	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.sql	2011-03-20 15:02:22 UTC (rev 5609)
@@ -29,7 +29,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+comment_single=--
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.tcl
===================================================================
--- trunk/data/filetypes.tcl	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.tcl	2011-03-20 15:02:22 UTC (rev 5609)
@@ -34,9 +34,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.vala
===================================================================
--- trunk/data/filetypes.vala	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.vala	2011-03-20 15:02:22 UTC (rev 5609)
@@ -48,12 +48,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=//
-comment_close=
-# this is an alternative way, so multiline comments are used
-#comment_open=/*
-#comment_close=*/
+# single comments, like # in this file
+comment_single=//
+# multiline comments
+comment_open=/*
+comment_close=*/
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.verilog
===================================================================
--- trunk/data/filetypes.verilog	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.verilog	2011-03-20 15:02:22 UTC (rev 5609)
@@ -29,7 +29,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+comment_single=//
+# multiline comments
 comment_open=/*
 comment_close=*/
 

Modified: trunk/data/filetypes.vhdl
===================================================================
--- trunk/data/filetypes.vhdl	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.vhdl	2011-03-20 15:02:22 UTC (rev 5609)
@@ -34,9 +34,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=--
-comment_close=
+# single comments, like # in this file
+comment_single=--
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/data/filetypes.xml
===================================================================
--- trunk/data/filetypes.xml	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.xml	2011-03-20 15:02:22 UTC (rev 5609)
@@ -88,7 +88,9 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
+# single comments, like # in this file
+#comment_single=
+# multiline comments
 comment_open=<!--
 comment_close=-->
 

Modified: trunk/data/filetypes.yaml
===================================================================
--- trunk/data/filetypes.yaml	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/data/filetypes.yaml	2011-03-20 15:02:22 UTC (rev 5609)
@@ -25,9 +25,11 @@
 # the following characters are these which a "word" can contains, see documentation
 #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
 
-# if only single comment char is supported like # in this file, leave comment_close blank
-comment_open=#
-comment_close=
+# single comments, like # in this file
+comment_single=#
+# multiline comments
+#comment_open=
+#comment_close=
 
 # set to false if a comment character/string should start at column 0 of a line, true uses any
 # indentation of the line, e.g. setting to true causes the following on pressing CTRL+d

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/doc/geany.html	2011-03-20 15:02:22 UTC (rev 5609)
@@ -6,7 +6,7 @@
 <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" />
 <title>Geany</title>
 <meta name="authors" content="Enrico Tröger  Nick Treleaven  Frank Lanitz" />
-<meta name="date" content="2011-01-19" />
+<meta name="date" content="$Date$" />
 <style type="text/css">
 
 /*
@@ -139,7 +139,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2011-01-19</td></tr>
+<td>$Date$</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.21</td></tr>
 </tbody>
@@ -4463,10 +4463,20 @@
 filetypes.common setting.</p>
 </div>
 </dd>
+<dt>comment_single</dt>
+<dd><p class="first">A character or string which is used to comment code. If you want to use
+multiline comments only, don't set this but rather comment_open and
+comment_close.</p>
+<p>Single-line comments are used in priority over multiline comments to
+comment a line, e.g. with the <cite>Comment/Uncomment line</cite> command.</p>
+<p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">comment_single=//</span></tt></p>
+</dd>
 <dt>comment_open</dt>
-<dd><p class="first">A character or string which is used to comment code. If you want to
-use multiline comments, also set comment_close, otherwise leave it
-empty.</p>
+<dd><p class="first">A character or string which is used to comment code. You need to also
+set comment_close to really use multiline comments. If you want to use
+single-line comments, prefer setting comment_single.</p>
+<p>Multiline comments are used in priority over single-line comments to
+comment a block, e.g. template comments.</p>
 <p class="last"><em>Example:</em> <tt class="docutils literal"><span class="pre">comment_open=/*</span></tt></p>
 </dd>
 <dt>comment_close</dt>
@@ -6461,7 +6471,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2011-02-06 16:10 UTC.
+Generated on: 2011-03-20 14:49 UTC.
 Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
 
 </div>

Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/doc/geany.txt	2011-03-20 15:02:22 UTC (rev 5609)
@@ -3749,11 +3749,24 @@
         This can be overridden by the *whitespace_chars*
         filetypes.common setting.
 
+comment_single
+    A character or string which is used to comment code. If you want to use
+    multiline comments only, don't set this but rather comment_open and
+    comment_close.
+
+    Single-line comments are used in priority over multiline comments to
+    comment a line, e.g. with the `Comment/Uncomment line` command.
+
+    *Example:* ``comment_single=//``
+
 comment_open
-    A character or string which is used to comment code. If you want to
-    use multiline comments, also set comment_close, otherwise leave it
-    empty.
+    A character or string which is used to comment code. You need to also
+    set comment_close to really use multiline comments. If you want to use
+    single-line comments, prefer setting comment_single.
 
+    Multiline comments are used in priority over single-line comments to
+    comment a block, e.g. template comments.
+
     *Example:* ``comment_open=/*``
 
 comment_close

Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/src/callbacks.c	2011-03-20 15:02:22 UTC (rev 5609)
@@ -1321,7 +1321,7 @@
 
 	verify_click_pos(doc); /* make sure that the click_pos is valid */
 
-	if (doc->file_type->comment_open)
+	if (doc->file_type->comment_open || doc->file_type->comment_single)
 		editor_insert_multiline_comment(doc->editor);
 	else
 		utils_beep();

Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/src/editor.c	2011-03-20 15:02:22 UTC (rev 5609)
@@ -2936,10 +2936,16 @@
 			ft = filetypes[GEANY_FILETYPES_XML];
 	}
 
-	co = ft->comment_open;
-	cc = ft->comment_close;
-	if (co == NULL)
-		return 0;
+	co = ft->comment_single;
+	if (NZV(co))
+		cc = NULL;
+	else
+	{
+		co = ft->comment_open;
+		cc = ft->comment_close;
+		if (co == NULL)
+			return;
+	}
 
 	co_len = strlen(co);
 	if (co_len == 0)
@@ -3068,10 +3074,16 @@
 			ft = filetypes[GEANY_FILETYPES_XML];
 	}
 
-	co = ft->comment_open;
-	cc = ft->comment_close;
-	if (co == NULL)
-		return;
+	co = ft->comment_single;
+	if (NZV(co))
+		cc = NULL;
+	else
+	{
+		co = ft->comment_open;
+		cc = ft->comment_close;
+		if (co == NULL)
+			return;
+	}
 
 	co_len = strlen(co);
 	if (co_len == 0)
@@ -3096,7 +3108,7 @@
 		while (isspace(sel[x])) x++;
 
 		/* use single line comment */
-		if (cc == NULL || strlen(cc) == 0)
+		if (cc == NULL || cc[0] == '\0')
 		{
 			gboolean do_continue = FALSE;
 			single_line = TRUE;
@@ -3232,10 +3244,16 @@
 			ft = filetypes[GEANY_FILETYPES_XML];
 	}
 
-	co = ft->comment_open;
-	cc = ft->comment_close;
-	if (co == NULL)
-		return;
+	co = ft->comment_single;
+	if (NZV(co))
+		cc = NULL;
+	else
+	{
+		co = ft->comment_open;
+		cc = ft->comment_close;
+		if (co == NULL)
+			return;
+	}
 
 	co_len = strlen(co);
 	if (co_len == 0)
@@ -3540,14 +3558,15 @@
 	gboolean have_multiline_comment = FALSE;
 	GeanyDocument *doc;
 
-	g_return_if_fail(editor != NULL &&
-		editor->document->file_type != NULL && editor->document->file_type->comment_open != NULL);
+	g_return_if_fail(editor != NULL && editor->document->file_type != NULL &&
+		(editor->document->file_type->comment_open != NULL ||
+		 editor->document->file_type->comment_single != NULL));
 
 	sci_start_undo_action(editor->sci);
 
 	doc = editor->document;
 
-	if (doc->file_type->comment_close != NULL && strlen(doc->file_type->comment_close) > 0)
+	if (NZV(doc->file_type->comment_close))
 		have_multiline_comment = TRUE;
 
 	/* insert three lines one line above of the current position */

Modified: trunk/src/filetypes.c
===================================================================
--- trunk/src/filetypes.c	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/src/filetypes.c	2011-03-20 15:02:22 UTC (rev 5609)
@@ -1051,6 +1051,7 @@
 	g_free(ft->mime_type);
 	g_free(ft->comment_open);
 	g_free(ft->comment_close);
+	g_free(ft->comment_single);
 	g_free(ft->context_action_cmd);
 	g_free(ft->filecmds);
 	g_free(ft->ftdefcmds);
@@ -1095,7 +1096,7 @@
 	/* read comment notes */
 	result = g_key_file_get_string(configh, "settings", "comment_open", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_open", NULL);
-	if (G_LIKELY(result != NULL))
+	if (result != NULL)
 	{
 		g_free(filetypes[ft_id]->comment_open);
 		filetypes[ft_id]->comment_open = result;
@@ -1103,12 +1104,25 @@
 
 	result = g_key_file_get_string(configh, "settings", "comment_close", NULL);
 	if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_close", NULL);
-	if (G_LIKELY(result != NULL))
+	if (result != NULL)
 	{
 		g_free(filetypes[ft_id]->comment_close);
 		filetypes[ft_id]->comment_close = result;
 	}
 
+	result = g_key_file_get_string(configh, "settings", "comment_single", NULL);
+	if (result == NULL) result = g_key_file_get_string(config, "settings", "comment_single", NULL);
+	if (result != NULL)
+	{
+		setptr(filetypes[ft_id]->comment_single, result);
+	}
+	/* import correctly filetypes that use old-style single comments */
+	else if (! NZV(filetypes[ft_id]->comment_close))
+	{
+		setptr(filetypes[ft_id]->comment_single, filetypes[ft_id]->comment_open);
+		setptr(filetypes[ft_id]->comment_open, NULL);
+	}
+
 	tmp = g_key_file_get_boolean(configh, "settings", "comment_use_indent", &error);
 	if (error)
 	{

Modified: trunk/src/filetypes.h
===================================================================
--- trunk/src/filetypes.h	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/src/filetypes.h	2011-03-20 15:02:22 UTC (rev 5609)
@@ -136,6 +136,7 @@
 	GeanyFiletype	 *lexer_filetype;
 	gchar			 *mime_type;
 	GdkPixbuf		 *icon;
+	gchar			 *comment_single; /* single-line comment */
 
 	struct GeanyFiletypePrivate	*priv;	/* must be last, append fields before this item */
 #ifdef GEANY_PRIVATE

Modified: trunk/src/templates.c
===================================================================
--- trunk/src/templates.c	2011-03-19 22:48:43 UTC (rev 5608)
+++ trunk/src/templates.c	2011-03-20 15:02:22 UTC (rev 5609)
@@ -475,6 +475,8 @@
 	gint template_eol_mode;
 	const gchar *template_eol_char;
 	GeanyFiletype *ft = filetypes_index(filetype_idx);
+	const gchar *co;
+	const gchar *cc;
 
 	g_return_if_fail(comment_text != NULL);
 	g_return_if_fail(ft != NULL);
@@ -482,19 +484,25 @@
 	template_eol_mode = utils_get_line_endings(comment_text->str, comment_text->len);
 	template_eol_char = utils_get_eol_char(template_eol_mode);
 
-	if (NZV(ft->comment_open))
+	co = ft->comment_open;
+	cc = NULL;
+	if (NZV(co))
+		cc = ft->comment_close;
+	else
+		co = ft->comment_single;
+	if (NZV(co))
 	{
-		if (NZV(ft->comment_close))
+		if (NZV(cc))
 		{
-			frame_start = g_strconcat(ft->comment_open, template_eol_char, NULL);
-			frame_end = g_strconcat(ft->comment_close, template_eol_char, NULL);
+			frame_start = g_strconcat(co, template_eol_char, NULL);
+			frame_end = g_strconcat(cc, template_eol_char, NULL);
 			line_prefix = "";
 		}
 		else
 		{
 			frame_start = NULL;
 			frame_end = NULL;
-			line_prefix = ft->comment_open;
+			line_prefix = co;
 		}
 	}
 	else


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list