Revision: 5413
http://geany.svn.sourceforge.net/geany/?rev=5413&view=rev
Author: ntrel
Date: 2010-11-17 17:45:45 +0000 (Wed, 17 Nov 2010)
Log Message:
-----------
Fix 'Set Build Commands' docs to be less C-specific.
Modified Paths:
--------------
trunk/doc/geany.html
trunk/doc/geany.txt
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2010-11-17 17:42:16 UTC (rev 5412)
+++ trunk/doc/geany.html 2010-11-17 17:45:45 UTC (rev 5413)
@@ -2878,11 +2878,11 @@
</div>
<div class="section">
<h4><a class="toc-backref" href="#id143" id="set-build-commands" name="set-build-commands">Set Build Commands</a></h4>
-<p>By default the Compile and Build commands invoke the GCC compiler and
-linker with only the basic arguments needed by all programs. Using
-<em>Set Build Commands</em> you can add any include paths and compile
-flags for the compiler, any library names and paths for the linker,
-and any arguments you want to use when running Execute.</p>
+<p>By default Compile, Build and Execute are fairly basic commands. You
+may wish to customise them using <em>Set Build Commands</em>.</p>
+<p>E.g. for C you can add any include paths and compile flags for the
+compiler, any library names and paths for the linker, and any
+arguments you want to use when running Execute.</p>
</div>
</div>
<div class="section">
@@ -6354,7 +6354,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2010-11-17 17:38 UTC.
+Generated on: 2010-11-17 17:44 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2010-11-17 17:42:16 UTC (rev 5412)
+++ trunk/doc/geany.txt 2010-11-17 17:45:45 UTC (rev 5413)
@@ -2642,12 +2642,13 @@
Set Build Commands
``````````````````
-By default the Compile and Build commands invoke the GCC compiler and
-linker with only the basic arguments needed by all programs. Using
-*Set Build Commands* you can add any include paths and compile
-flags for the compiler, any library names and paths for the linker,
-and any arguments you want to use when running Execute.
+By default Compile, Build and Execute are fairly basic commands. You
+may wish to customise them using *Set Build Commands*.
+E.g. for C you can add any include paths and compile flags for the
+compiler, any library names and paths for the linker, and any
+arguments you want to use when running Execute.
+
Build Menu Configuration
^^^^^^^^^^^^^^^^^^^^^^^^
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5412
http://geany.svn.sourceforge.net/geany/?rev=5412&view=rev
Author: ntrel
Date: 2010-11-17 17:42:16 +0000 (Wed, 17 Nov 2010)
Log Message:
-----------
Use 'Filetype build commands' and 'Independent build commands'.
Fix saying project *independent* execute can only be set by hand.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.html
trunk/doc/geany.txt
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-17 15:33:24 UTC (rev 5411)
+++ trunk/ChangeLog 2010-11-17 17:42:16 UTC (rev 5412)
@@ -3,6 +3,9 @@
* src/build.c, doc/geany.txt, doc/geany.html:
Change 'Non-Filetype Commands' to 'Independent Commands' in the Set
Build Commands dialog.
+ * doc/geany.txt, doc/geany.html:
+ Use 'Filetype build commands' and 'Independent build commands'.
+ Fix saying project *independent* execute can only be set by hand.
2010-11-16 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2010-11-17 15:33:24 UTC (rev 5411)
+++ trunk/doc/geany.html 2010-11-17 17:42:16 UTC (rev 5412)
@@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
-<meta name="date" content="2010-11-15" />
+<meta name="date" content="2010-11-17" />
<style type="text/css">
/*
@@ -139,7 +139,7 @@
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
-<td>2010-11-15</td></tr>
+<td>2010-11-17</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.20</td></tr>
</tbody>
@@ -2896,16 +2896,16 @@
<p>The build menu is divided into four groups of items each with different
behaviors:</p>
<ul class="simple">
-<li>Filetype items - are configurable and depend on the filetype of the current
-document; they capture output in the compiler tab and parse it for
+<li>Filetype build commands - are configurable and depend on the filetype of the
+current document; they capture output in the compiler tab and parse it for
errors.</li>
-<li>Filetype-independent items - are configurable and mostly don't depend on the
+<li>Independent build commands - are configurable and mostly don't depend on the
filetype of the current document; they also capture output in the
compiler tab and parse it for errors.</li>
-<li>Execute items - are configurable and intended for executing your
+<li>Execute commands - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors
and is directed to the terminal selected in preferences.</li>
-<li>Fixed items - these perform built-in actions:<ul>
+<li>Fixed commands - these perform built-in actions:<ul>
<li>Go to the next error.</li>
<li>Go to the previous error.</li>
<li>Show the build menu commands dialog.</li>
@@ -3017,9 +3017,10 @@
filetype.xxx in
Geany install</p>
<p class="last">Saves To: as user
-preferences left</p>
+preferences left.</p>
</td>
-<td>Label: _Execute Command: ./%e</td>
+<td>Label: _Execute
+Command: ./%e</td>
</tr>
</tbody>
</table>
@@ -3037,9 +3038,10 @@
<li>(Filetype-Independent, System Filetype) - although conceptually strange, defining
filetype-independent commands in a filetype file, this provides the ability to
define filetype dependent default menu items.</li>
-<li>(Execute, Project File) and (Execute, Preferences) - the project filetype-based
-execute and preferences independent execute can only be set by hand editing the
-appropriate file, see <a class="reference" href="#preferences-file-format">Preferences File Format</a> and <a class="reference" href="#project-file-format">Project File Format</a>.</li>
+<li>(Execute, Project File) and (Execute, Preferences) - the project independent
+execute and preferences independent execute commands can only be set by hand
+editing the appropriate file, see <a class="reference" href="#preferences-file-format">Preferences File Format</a> and <a class="reference" href="#project-file-format">Project File
+Format</a>.</li>
</ul>
</div>
<div class="section">
@@ -3052,10 +3054,9 @@
<img alt="./images/build_menu_commands_dialog.png" src="./images/build_menu_commands_dialog.png" />
<p>The dialog is divided into three sections:</p>
<ul class="simple">
-<li>Filetype menu items which will be selected based on the filetype of the
-currently open document.</li>
-<li>Filetype-independent menu items.</li>
-<li>Execute menu items.</li>
+<li>Filetype build commands (selected based on the current document's filetype).</li>
+<li>Independent build commands (available regardless of filetype).</li>
+<li>Filetype execute commands.</li>
</ul>
<p>The filetype and independent sections also each contain a field for the regular
expression used for parsing command output for error and warning messages.</p>
@@ -6353,7 +6354,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2010-11-17 15:28 UTC.
+Generated on: 2010-11-17 17:38 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2010-11-17 15:33:24 UTC (rev 5411)
+++ trunk/doc/geany.txt 2010-11-17 17:42:16 UTC (rev 5412)
@@ -2663,16 +2663,16 @@
The build menu is divided into four groups of items each with different
behaviors:
-* Filetype items - are configurable and depend on the filetype of the current
- document; they capture output in the compiler tab and parse it for
+* Filetype build commands - are configurable and depend on the filetype of the
+ current document; they capture output in the compiler tab and parse it for
errors.
-* Filetype-independent items - are configurable and mostly don't depend on the
+* Independent build commands - are configurable and mostly don't depend on the
filetype of the current document; they also capture output in the
compiler tab and parse it for errors.
-* Execute items - are configurable and intended for executing your
+* Execute commands - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors
and is directed to the terminal selected in preferences.
-* Fixed items - these perform built-in actions:
+* Fixed commands - these perform built-in actions:
* Go to the next error.
* Go to the previous error.
@@ -2717,12 +2717,12 @@
| | | | | Label: Make _Object |
| | | | | Command: make %e.o |
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
-| Execute | Loads From: project | Loads From: | Loads From: | Label: _Execute Command: ./%e |
-| | file or else | geany.conf file in | filetype.xxx in | |
+| Execute | Loads From: project | Loads From: | Loads From: | Label: _Execute |
+| | file or else | geany.conf file in | filetype.xxx in | Command: ./%e |
| | filetype defined in | ~/.config/geany or else | Geany install | |
| | project file | filetype.xxx file in | | |
| | | ~/.config/geany/filedefs | Saves To: as user | |
-| | Saves To: | | preferences left | |
+| | Saves To: | | preferences left. | |
| | project file | Saves To: | | |
| | | filetype.xxx file in | | |
| | | ~/.config/geany/filedefs | | |
@@ -2746,9 +2746,10 @@
filetype-independent commands in a filetype file, this provides the ability to
define filetype dependent default menu items.
-* (Execute, Project File) and (Execute, Preferences) - the project filetype-based
- execute and preferences independent execute can only be set by hand editing the
- appropriate file, see `Preferences File Format`_ and `Project File Format`_.
+* (Execute, Project File) and (Execute, Preferences) - the project independent
+ execute and preferences independent execute commands can only be set by hand
+ editing the appropriate file, see `Preferences File Format`_ and `Project File
+ Format`_.
Build Menu Commands Dialog
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -2763,10 +2764,9 @@
The dialog is divided into three sections:
-* Filetype menu items which will be selected based on the filetype of the
- currently open document.
-* Filetype-independent menu items.
-* Execute menu items.
+* Filetype build commands (selected based on the current document's filetype).
+* Independent build commands (available regardless of filetype).
+* Filetype execute commands.
The filetype and independent sections also each contain a field for the regular
expression used for parsing command output for error and warning messages.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5411
http://geany.svn.sourceforge.net/geany/?rev=5411&view=rev
Author: ntrel
Date: 2010-11-17 15:33:24 +0000 (Wed, 17 Nov 2010)
Log Message:
-----------
Change 'Non-Filetype Commands' to 'Independent Commands' in the Set
Build Commands dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.html
trunk/doc/geany.txt
trunk/src/build.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-16 15:21:41 UTC (rev 5410)
+++ trunk/ChangeLog 2010-11-17 15:33:24 UTC (rev 5411)
@@ -1,3 +1,10 @@
+2010-11-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/build.c, doc/geany.txt, doc/geany.html:
+ Change 'Non-Filetype Commands' to 'Independent Commands' in the Set
+ Build Commands dialog.
+
+
2010-11-16 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keybindings.c, src/editor.c, src/editor.h:
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2010-11-16 15:21:41 UTC (rev 5410)
+++ trunk/doc/geany.html 2010-11-17 15:33:24 UTC (rev 5411)
@@ -2895,28 +2895,21 @@
<p>These settings are saved automatically when Geany is shut down.</p>
<p>The build menu is divided into four groups of items each with different
behaviors:</p>
-<ul>
-<li><p class="first">File items - are configurable and depend on the filetype of the current
+<ul class="simple">
+<li>Filetype items - are configurable and depend on the filetype of the current
document; they capture output in the compiler tab and parse it for
-errors.</p>
-</li>
-<li><p class="first">Non-file items - are configurable and mostly don't depend on the filetype
-of the current document; they also capture output in the compiler tab and
-parse it for errors.</p>
-</li>
-<li><p class="first">Execute items - are configurable and intended for executing your
+errors.</li>
+<li>Filetype-independent items - are configurable and mostly don't depend on the
+filetype of the current document; they also capture output in the
+compiler tab and parse it for errors.</li>
+<li>Execute items - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors
-and is directed to the terminal selected in preferences.</p>
-</li>
-<li><dl class="first docutils">
-<dt>Fixed items - these perform built-in actions:</dt>
-<dd><ul class="first last simple">
+and is directed to the terminal selected in preferences.</li>
+<li>Fixed items - these perform built-in actions:<ul>
<li>Go to the next error.</li>
<li>Go to the previous error.</li>
<li>Show the build menu commands dialog.</li>
</ul>
-</dd>
-</dl>
</li>
</ul>
<p>The maximum numbers of items in each of the configurable groups can be
@@ -2971,7 +2964,8 @@
</td>
<td>None</td>
</tr>
-<tr><td>Non-Filetype</td>
+<tr><td>Filetype
+Independent</td>
<td><p class="first">Loads From: project
file</p>
<p class="last">Saves To: project
@@ -3040,11 +3034,11 @@
as well. Projects can only configure menu items per filetype. Saving
in the project file means that there is only one file per project not
a whole directory.</li>
-<li>(Non-Filetype, System Filetype) - although conceptually strange, defining
-non-filetype commands in a filetype file, this provides the ability to
+<li>(Filetype-Independent, System Filetype) - although conceptually strange, defining
+filetype-independent commands in a filetype file, this provides the ability to
define filetype dependent default menu items.</li>
-<li>(Execute, Project File) and (Execute, Preferences) - the project filetype based execute
-configuration and preferences non-filetype based execute can only be set by hand editing the
+<li>(Execute, Project File) and (Execute, Preferences) - the project filetype-based
+execute and preferences independent execute can only be set by hand editing the
appropriate file, see <a class="reference" href="#preferences-file-format">Preferences File Format</a> and <a class="reference" href="#project-file-format">Project File Format</a>.</li>
</ul>
</div>
@@ -3060,10 +3054,10 @@
<ul class="simple">
<li>Filetype menu items which will be selected based on the filetype of the
currently open document.</li>
-<li>Non-filetype menu items.</li>
+<li>Filetype-independent menu items.</li>
<li>Execute menu items.</li>
</ul>
-<p>The filetype and non-filetype sections also each contain a field for the regular
+<p>The filetype and independent sections also each contain a field for the regular
expression used for parsing command output for error and warning messages.</p>
<p>The columns in the first three sections allow setting of the label, command,
and working directory to run the command in.</p>
@@ -3105,7 +3099,7 @@
<div class="section">
<h4><a class="toc-backref" href="#id147" id="build-menu-keyboard-shortcuts" name="build-menu-keyboard-shortcuts">Build Menu Keyboard Shortcuts</a></h4>
<p>Keyboard shortcuts can be defined for the first two filetype menu items, the first three
-non-filetype menu items, the first two execute menu items and the fixed menu items.
+independent menu items, the first two execute menu items and the fixed menu items.
In the keybindings configuration dialog (see <a class="reference" href="#keybinding-preferences">Keybinding preferences</a>)
these items are identified by the default labels shown in the <a class="reference" href="#build-menu">Build Menu</a> section above.</p>
<p>It is currently not possible to bind keyboard shortcuts to more than these menu items.</p>
@@ -4970,7 +4964,7 @@
</tr>
<tr><td>number_non_ft_menu_items</td>
<td>The maximum number of menu items in the
-non-filetype section of the Build menu.</td>
+independent section of the Build menu.</td>
<td>3</td>
</tr>
<tr><td>number_exec_menu_items</td>
@@ -4998,7 +4992,7 @@
<ul class="simple">
<li>GG - is the menu item group,<ul>
<li>FT for filetype</li>
-<li>NF for non-filetype</li>
+<li>NF for independent (non-filetype)</li>
<li>EX for execute</li>
</ul>
</li>
@@ -6359,7 +6353,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2010-11-15 15:13 UTC.
+Generated on: 2010-11-17 15:28 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2010-11-16 15:21:41 UTC (rev 5410)
+++ trunk/doc/geany.txt 2010-11-17 15:33:24 UTC (rev 5411)
@@ -2663,20 +2663,21 @@
The build menu is divided into four groups of items each with different
behaviors:
-* File items - are configurable and depend on the filetype of the current
+* Filetype items - are configurable and depend on the filetype of the current
document; they capture output in the compiler tab and parse it for
errors.
-* Non-file items - are configurable and mostly don't depend on the filetype
- of the current document; they also capture output in the compiler tab and
- parse it for errors.
+* Filetype-independent items - are configurable and mostly don't depend on the
+ filetype of the current document; they also capture output in the
+ compiler tab and parse it for errors.
* Execute items - are configurable and intended for executing your
program or other long running programs. The output is not parsed for errors
and is directed to the terminal selected in preferences.
* Fixed items - these perform built-in actions:
- * Go to the next error.
- * Go to the previous error.
- * Show the build menu commands dialog.
+ * Go to the next error.
+ * Go to the previous error.
+ * Show the build menu commands dialog.
+
The maximum numbers of items in each of the configurable groups can be
configured when Geany starts using hidden settings (see `Preferences File Format`_).
Even though the maximum number of items may have been increased, only
@@ -2704,8 +2705,8 @@
| | file | Saves to: as above, | Saves to: as user | |
| | | creating if needed. | preferences left. | |
+--------------+---------------------+--------------------------+-------------------+-------------------------------+
-| Non-Filetype | Loads From: project | Loads From: | Loads From: | 1: |
-| | file | geany.conf file in | filetype.xxx in | Label: _Make |
+| Filetype | Loads From: project | Loads From: | Loads From: | 1: |
+| Independent | file | geany.conf file in | filetype.xxx in | Label: _Make |
| | | ~/.config/geany | Geany install | Command: make |
| | Saves To: project | | | |
| | file | Saves to: as above, | Saves to: as user | 2: |
@@ -2741,12 +2742,12 @@
in the project file means that there is only one file per project not
a whole directory.
-* (Non-Filetype, System Filetype) - although conceptually strange, defining
- non-filetype commands in a filetype file, this provides the ability to
+* (Filetype-Independent, System Filetype) - although conceptually strange, defining
+ filetype-independent commands in a filetype file, this provides the ability to
define filetype dependent default menu items.
-* (Execute, Project File) and (Execute, Preferences) - the project filetype based execute
- configuration and preferences non-filetype based execute can only be set by hand editing the
+* (Execute, Project File) and (Execute, Preferences) - the project filetype-based
+ execute and preferences independent execute can only be set by hand editing the
appropriate file, see `Preferences File Format`_ and `Project File Format`_.
Build Menu Commands Dialog
@@ -2764,10 +2765,10 @@
* Filetype menu items which will be selected based on the filetype of the
currently open document.
-* Non-filetype menu items.
+* Filetype-independent menu items.
* Execute menu items.
-The filetype and non-filetype sections also each contain a field for the regular
+The filetype and independent sections also each contain a field for the regular
expression used for parsing command output for error and warning messages.
The columns in the first three sections allow setting of the label, command,
@@ -2816,7 +2817,7 @@
`````````````````````````````
Keyboard shortcuts can be defined for the first two filetype menu items, the first three
-non-filetype menu items, the first two execute menu items and the fixed menu items.
+independent menu items, the first two execute menu items and the fixed menu items.
In the keybindings configuration dialog (see `Keybinding preferences`_)
these items are identified by the default labels shown in the `Build Menu`_ section above.
@@ -4217,7 +4218,7 @@
number_ft_menu_items The maximum number of menu items in the 2
filetype section of the Build menu.
number_non_ft_menu_items The maximum number of menu items in the 3
- non-filetype section of the Build menu.
+ independent section of the Build menu.
number_exec_menu_items The maximum number of menu items in the 2
execute section of the Build menu.
================================ =========================================== ==================
@@ -4243,7 +4244,7 @@
* GG - is the menu item group,
- FT for filetype
- - NF for non-filetype
+ - NF for independent (non-filetype)
- EX for execute
* NN - is a two decimal digit number of the item within the group,
Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c 2010-11-16 15:21:41 UTC (rev 5410)
+++ trunk/src/build.c 2010-11-17 15:33:24 UTC (rev 5411)
@@ -2005,7 +2005,7 @@
gtk_table_attach(table, sep, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND,
entry_x_padding, sep_padding);
++row;
- label = ui_label_new_bold(_("Non-Filetype Commands"));
+ label = ui_label_new_bold(_("Independent Commands"));
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_table_attach(table, label, 0, DC_N_COL, row, row + 1, GTK_FILL, GTK_FILL | GTK_EXPAND,
entry_x_padding, entry_y_padding);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5410
http://geany.svn.sourceforge.net/geany/?rev=5410&view=rev
Author: ntrel
Date: 2010-11-16 15:21:41 +0000 (Tue, 16 Nov 2010)
Log Message:
-----------
Fix for moved highlighting_is_{comment,string}_style().
Modified Paths:
--------------
trunk/HACKING
Modified: trunk/HACKING
===================================================================
--- trunk/HACKING 2010-11-16 15:07:40 UTC (rev 5409)
+++ trunk/HACKING 2010-11-16 15:21:41 UTC (rev 5410)
@@ -378,14 +378,15 @@
Other features
^^^^^^^^^^^^^^
+If the lexer has comment styles, you should add them in
+highlighting_is_comment_style(). You should also update
+highlighting_is_string_style() for string/character styles. For now,
+this prevents calltips and autocompletion when typing in a comment
+(but it can still be forced by the user).
+
For brace indentation, update lexer_has_braces() in editor.c;
indentation after ':' is done from on_new_line_added().
-If the lexer has comment styles, you should add them in is_comment_style()
-in editor.c. You should also update is_string_style() for string/character
-styles. For now, this prevents calltips and autocompletion when typing
-in a comment (but it can still be forced by the user).
-
If the Scintilla lexer supports user type keyword highlighting (e.g.
SCLEX_CPP), update editor_lexer_get_type_keyword_idx() in editor.c.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5408
http://geany.svn.sourceforge.net/geany/?rev=5408&view=rev
Author: ntrel
Date: 2010-11-16 13:26:04 +0000 (Tue, 16 Nov 2010)
Log Message:
-----------
Make Reflow Lines/Block command use the current indented block, not
the whole paragraph, which could have mixed indentation.
Fix memory leak and off-by-one bug on first line when using Select
Paragraph command.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/editor.c
trunk/src/editor.h
trunk/src/keybindings.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-15 15:16:00 UTC (rev 5407)
+++ trunk/ChangeLog 2010-11-16 13:26:04 UTC (rev 5408)
@@ -1,3 +1,12 @@
+2010-11-16 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c, src/editor.c, src/editor.h:
+ Make Reflow Lines/Block command use the current indented block, not
+ the whole paragraph, which could have mixed indentation.
+ Fix memory leak and off-by-one bug on first line when using Select
+ Paragraph command.
+
+
2010-11-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/editor.c, doc/geany.txt, doc/geany.html:
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2010-11-15 15:16:00 UTC (rev 5407)
+++ trunk/src/editor.c 2010-11-16 13:26:04 UTC (rev 5408)
@@ -3931,50 +3931,48 @@
}
-/* find the start or end of a paragraph by searching all lines in direction (UP or DOWN)
- * starting at the given line and return the found line or return -1 if called on an empty line */
+static gboolean sci_is_blank_line(ScintillaObject *sci, gint line)
+{
+ return sci_get_line_indent_position(sci, line) ==
+ sci_get_line_end_position(sci, line);
+}
+
+
+/* Returns first line of paragraph for GTK_DIR_UP, line after paragraph
+ * ends for GTK_DIR_DOWN or -1 if called on an empty line. */
static gint find_paragraph_stop(GeanyEditor *editor, gint line, gint direction)
{
- gboolean found_end = FALSE;
gint step;
- gchar *line_buf, *x;
ScintillaObject *sci = editor->sci;
/* first check current line and return -1 if it is empty to skip creating of a selection */
- line_buf = x = sci_get_line(sci, line);
- while (isspace(*x))
- x++;
- if (*x == '\0')
- {
- g_free(line_buf);
+ if (sci_is_blank_line(sci, line))
return -1;
- }
if (direction == GTK_DIR_UP)
step = -1;
else
step = 1;
- while (! found_end)
+ while (TRUE)
{
line += step;
+ if (line == -1)
+ {
+ /* start of document */
+ line = 0;
+ break;
+ }
+ if (line == sci_get_line_count(sci))
+ break;
- /* sci_get_line checks for sanity of the given line, sci_get_line always return a string
- * containing at least '\0' so no need to check for NULL */
- line_buf = x = sci_get_line(sci, line);
-
- /* check whether after skipping all whitespace we are at end of line and if so, assume
- * this line as end of paragraph */
- while (isspace(*x))
- x++;
- if (*x == '\0')
+ if (sci_is_blank_line(sci, line))
{
- found_end = TRUE;
- if (line == -1)
- /* called on the first line but there is no previous line so return line 0 */
- line = 0;
+ /* return line paragraph starts on */
+ if (direction == GTK_DIR_UP)
+ line++;
+ break;
}
- g_free(line_buf);
}
return line;
}
@@ -3986,18 +3984,12 @@
g_return_if_fail(editor != NULL);
- line_start = SSM(editor->sci, SCI_LINEFROMPOSITION,
- SSM(editor->sci, SCI_GETCURRENTPOS, 0, 0), 0);
+ line_start = sci_get_current_line(editor->sci);
line_found = find_paragraph_stop(editor, line_start, GTK_DIR_UP);
if (line_found == -1)
return;
- /* find_paragraph_stop returns the emtpy line(previous to the real start of the paragraph),
- * so use the next line for selection start */
- if (line_found > 0)
- line_found++;
-
pos_start = SSM(editor->sci, SCI_POSITIONFROMLINE, line_found, 0);
line_found = find_paragraph_stop(editor, line_start, GTK_DIR_DOWN);
@@ -4007,6 +3999,69 @@
}
+/* Returns first line of block for GTK_DIR_UP, line after block
+ * ends for GTK_DIR_DOWN or -1 if called on an empty line. */
+static gint find_block_stop(GeanyEditor *editor, gint line, gint direction)
+{
+ gint step, ind;
+ ScintillaObject *sci = editor->sci;
+
+ /* first check current line and return -1 if it is empty to skip creating of a selection */
+ if (sci_is_blank_line(sci, line))
+ return -1;
+
+ if (direction == GTK_DIR_UP)
+ step = -1;
+ else
+ step = 1;
+
+ ind = sci_get_line_indentation(sci, line);
+ while (TRUE)
+ {
+ line += step;
+ if (line == -1)
+ {
+ /* start of document */
+ line = 0;
+ break;
+ }
+ if (line == sci_get_line_count(sci))
+ break;
+
+ if (sci_get_line_indentation(sci, line) != ind ||
+ sci_is_blank_line(sci, line))
+ {
+ /* return line block starts on */
+ if (direction == GTK_DIR_UP)
+ line++;
+ break;
+ }
+ }
+ return line;
+}
+
+
+void editor_select_indent_block(GeanyEditor *editor)
+{
+ gint pos_start, pos_end, line_start, line_found;
+
+ g_return_if_fail(editor != NULL);
+
+ line_start = sci_get_current_line(editor->sci);
+
+ line_found = find_block_stop(editor, line_start, GTK_DIR_UP);
+ if (line_found == -1)
+ return;
+
+ pos_start = SSM(editor->sci, SCI_POSITIONFROMLINE, line_found, 0);
+
+ line_found = find_block_stop(editor, line_start, GTK_DIR_DOWN);
+ pos_end = SSM(editor->sci, SCI_POSITIONFROMLINE, line_found, 0);
+
+ sci_set_selection(editor->sci, pos_start, pos_end);
+}
+
+
/* simple indentation to indent the current line with the same indent as the previous one */
static void smart_line_indentation(GeanyEditor *editor, gint first_line, gint last_line)
{
Modified: trunk/src/editor.h
===================================================================
--- trunk/src/editor.h 2010-11-15 15:16:00 UTC (rev 5407)
+++ trunk/src/editor.h 2010-11-16 13:26:04 UTC (rev 5408)
@@ -243,12 +243,16 @@
gchar *editor_get_default_selection(GeanyEditor *editor, gboolean use_current_word, const gchar *wordchars);
+
void editor_select_word(GeanyEditor *editor);
void editor_select_lines(GeanyEditor *editor, gboolean extra_line);
void editor_select_paragraph(GeanyEditor *editor);
+void editor_select_indent_block(GeanyEditor *editor);
+
+
void editor_set_font(GeanyEditor *editor, const gchar *font);
void editor_indicator_set_on_line(GeanyEditor *editor, gint indic, gint line);
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2010-11-15 15:16:00 UTC (rev 5407)
+++ trunk/src/keybindings.c 2010-11-16 13:26:04 UTC (rev 5408)
@@ -2344,7 +2344,8 @@
{
gint line, pos;
- keybindings_send_command(GEANY_KEY_GROUP_SELECT, GEANY_KEYS_SELECT_PARAGRAPH);
+ editor_select_indent_block(editor);
+
/* deselect last line break */
pos = sci_get_selection_end(sci);
line = sci_get_line_from_position(sci, pos);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5407
http://geany.svn.sourceforge.net/geany/?rev=5407&view=rev
Author: ntrel
Date: 2010-11-15 15:16:00 +0000 (Mon, 15 Nov 2010)
Log Message:
-----------
Rename 'Format' section 'Filetype configuration'.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.html
trunk/doc/geany.txt
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-15 13:06:11 UTC (rev 5406)
+++ trunk/ChangeLog 2010-11-15 15:16:00 UTC (rev 5407)
@@ -4,6 +4,8 @@
Don't use XML tag auto-indentation when '</' is to the right of the
cursor; allow auto-indentation when XML tag auto-closing is also
enabled.
+ * doc/geany.txt, doc/geany.html:
+ Rename 'Format' section 'Filetype configuration'.
2010-11-14 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2010-11-15 13:06:11 UTC (rev 5406)
+++ trunk/doc/geany.html 2010-11-15 15:16:00 UTC (rev 5407)
@@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
-<meta name="date" content="2010-11-11" />
+<meta name="date" content="2010-11-15" />
<style type="text/css">
/*
@@ -139,7 +139,7 @@
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
-<td>2010-11-11</td></tr>
+<td>2010-11-15</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.20</td></tr>
</tbody>
@@ -402,7 +402,7 @@
<li><a class="reference" href="#custom-filetypes" id="id174" name="id174">Custom filetypes</a></li>
<li><a class="reference" href="#system-files" id="id175" name="id175">System files</a></li>
<li><a class="reference" href="#user-files" id="id176" name="id176">User files</a></li>
-<li><a class="reference" href="#format" id="id177" name="id177">Format</a><ul>
+<li><a class="reference" href="#filetype-configuration" id="id177" name="id177">Filetype configuration</a><ul>
<li><a class="reference" href="#styling-section" id="id178" name="id178">[styling] Section</a><ul>
<li><a class="reference" href="#using-a-named-style" id="id179" name="id179">Using a named style</a></li>
</ul>
@@ -1322,7 +1322,7 @@
<a class="reference" href="#keybindings">Keybindings</a>).</p>
<p>The command can be specified in the preferences dialog and also for
each filetype (see "context_action_cmd" in the section called
-<a class="reference" href="#format">Format</a>). When the context action is invoked, the filetype
+<a class="reference" href="#filetype-configuration">Filetype configuration</a>). When the context action is invoked, the filetype
specific command is used if available, otherwise the command
specified in the preferences dialog is executed.</p>
<p>The current word or selection can be referred with the wildcard "%s"
@@ -4210,7 +4210,7 @@
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">Syntax highlighting colors aren't updated in open documents after
-saving filetypes.common as this can possibly take a significant
+saving filetypes.common as this may take a significant
amount of time.</p>
</div>
</div>
@@ -4252,7 +4252,7 @@
<tt class="docutils literal"><span class="pre">filetype_extensions.conf</span></tt>).</p>
</li>
<li><dl class="first docutils">
-<dt>Filetype settings in the [settings] section (see <a class="reference" href="#format">Format</a>).</dt>
+<dt>Filetype settings in the [settings] section (see <a class="reference" href="#filetype-configuration">Filetype configuration</a>).</dt>
<dd><ul class="first last simple">
<li>Using existing tag parsing (<tt class="docutils literal"><span class="pre">tag_parser</span></tt> key).</li>
<li>Using existing syntax highlighting (<tt class="docutils literal"><span class="pre">lexer_filetype</span></tt> key).</li>
@@ -4297,12 +4297,12 @@
<tt class="docutils literal"><span class="pre">~/.config/geany/filedefs/filetypes.X</span></tt> and add only these settings you want
to change. All missing settings will be read from the corresponding
global definition file in <tt class="docutils literal"><span class="pre">$prefix/share/geany</span></tt>.</p>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id177" id="filetype-configuration" name="filetype-configuration">Filetype configuration</a></h3>
<p>As well as the sections listed below, each filetype file can contain
a [build-menu] section as described in <a class="reference" href="#build-menu-section">[build-menu] Section</a>.</p>
-</div>
<div class="section">
-<h3><a class="toc-backref" href="#id177" id="format" name="format">Format</a></h3>
-<div class="section">
<h4><a class="toc-backref" href="#id178" id="styling-section" name="styling-section">[styling] Section</a></h4>
<p>In this section the colors for syntax highlighting are defined. The
manual format is:</p>
@@ -4514,7 +4514,10 @@
<p>There is a special filetype definition file called
filetypes.common. This file defines some general non-filetype-specific
settings.</p>
-<p>See the <a class="reference" href="#format">Format</a> section for how to define styles.</p>
+<div class="note">
+<p class="first admonition-title">Note</p>
+<p class="last">See the <a class="reference" href="#filetype-configuration">Filetype configuration</a> section for how to define styles.</p>
+</div>
<div class="section">
<h4><a class="toc-backref" href="#id185" id="named-styles-section" name="named-styles-section">[named_styles] Section</a></h4>
<p>Named styles declared here can be used in the [styling] section of any
@@ -6356,7 +6359,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2010-11-15 13:01 UTC.
+Generated on: 2010-11-15 15:13 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2010-11-15 13:06:11 UTC (rev 5406)
+++ trunk/doc/geany.txt 2010-11-15 15:16:00 UTC (rev 5407)
@@ -904,7 +904,7 @@
The command can be specified in the preferences dialog and also for
each filetype (see "context_action_cmd" in the section called
-`Format`_). When the context action is invoked, the filetype
+`Filetype configuration`_). When the context action is invoked, the filetype
specific command is used if available, otherwise the command
specified in the preferences dialog is executed.
@@ -3488,7 +3488,7 @@
.. note::
Syntax highlighting colors aren't updated in open documents after
- saving filetypes.common as this can possibly take a significant
+ saving filetypes.common as this may take a significant
amount of time.
@@ -3534,7 +3534,7 @@
* Recognizing and setting the filetype (after the user has manually edited
``filetype_extensions.conf``).
-* Filetype settings in the [settings] section (see `Format`_).
+* Filetype settings in the [settings] section (see `Filetype configuration`_).
* Using existing tag parsing (``tag_parser`` key).
* Using existing syntax highlighting (``lexer_filetype`` key).
* Build commands.
@@ -3572,13 +3572,14 @@
to change. All missing settings will be read from the corresponding
global definition file in ``$prefix/share/geany``.
+
+
+Filetype configuration
+^^^^^^^^^^^^^^^^^^^^^^
+
As well as the sections listed below, each filetype file can contain
a [build-menu] section as described in `[build-menu] Section`_.
-Format
-^^^^^^
-
-
[styling] Section
`````````````````
@@ -3809,7 +3810,8 @@
filetypes.common. This file defines some general non-filetype-specific
settings.
-See the `Format`_ section for how to define styles.
+.. note::
+ See the `Filetype configuration`_ section for how to define styles.
[named_styles] Section
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5406
http://geany.svn.sourceforge.net/geany/?rev=5406&view=rev
Author: ntrel
Date: 2010-11-15 13:06:11 +0000 (Mon, 15 Nov 2010)
Log Message:
-----------
Don't use XML tag auto-indentation when '</' is to the right of the
cursor; allow auto-indentation when XML tag auto-closing is also
enabled.
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.html
trunk/doc/geany.txt
trunk/src/editor.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-11-14 20:44:00 UTC (rev 5405)
+++ trunk/ChangeLog 2010-11-15 13:06:11 UTC (rev 5406)
@@ -1,3 +1,11 @@
+2010-11-15 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/editor.c, doc/geany.txt, doc/geany.html:
+ Don't use XML tag auto-indentation when '</' is to the right of the
+ cursor; allow auto-indentation when XML tag auto-closing is also
+ enabled.
+
+
2010-11-14 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* waf:
Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html 2010-11-14 20:44:00 UTC (rev 5405)
+++ trunk/doc/geany.html 2010-11-15 13:06:11 UTC (rev 5406)
@@ -6,7 +6,7 @@
<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" />
<title>Geany</title>
<meta name="authors" content="Enrico Tröger Nick Treleaven Frank Lanitz" />
-<meta name="date" content="2010-11-08" />
+<meta name="date" content="2010-11-11" />
<style type="text/css">
/*
@@ -139,7 +139,7 @@
<br />Nick Treleaven
<br />Frank Lanitz</td></tr>
<tr><th class="docinfo-name">Date:</th>
-<td>2010-11-08</td></tr>
+<td>2010-11-11</td></tr>
<tr><th class="docinfo-name">Version:</th>
<td>0.20</td></tr>
</tbody>
@@ -1246,6 +1246,9 @@
<dd>Similar to <em>Current chars</em> but the closing brace will be aligned to
match the indentation of the line with the opening brace.</dd>
</dl>
+<p>There is also XML-tag auto-indentation. This is enabled when the
+mode is more than just Basic, and is also controlled by a filetype
+setting - see <a class="reference" href="#xml-indent-tags">xml_indent_tags</a>.</p>
</div>
<div class="section">
<h3><a class="toc-backref" href="#id49" id="bookmarks" name="bookmarks">Bookmarks</a></h3>
@@ -4444,17 +4447,13 @@
</tbody>
</table>
</dd>
+</dl>
+<dl class="docutils" id="xml-indent-tags">
<dt>xml_indent_tags</dt>
-<dd><p class="first">If this setting is set to <em>true</em>, a new line after a line ending with an
+<dd>If this setting is set to <em>true</em>, a new line after a line ending with an
unclosed XML/HTML tag will be automatically indented. This only applies
to filetypes for which the HTML or XML lexer is used. Such filetypes have
-this setting in their system configuration files.</p>
-<div class="last note">
-<p class="first admonition-title">Note</p>
-<p class="last">This setting will not work if the <em>XML/HTML tag
-autocompletion</em> pref is set.</p>
-</div>
-</dd>
+this setting in their system configuration files.</dd>
</dl>
</div>
<div class="section">
@@ -6357,7 +6356,7 @@
<div class="footer">
<hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2010-11-11 17:52 UTC.
+Generated on: 2010-11-15 13:01 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt
===================================================================
--- trunk/doc/geany.txt 2010-11-14 20:44:00 UTC (rev 5405)
+++ trunk/doc/geany.txt 2010-11-15 13:06:11 UTC (rev 5406)
@@ -814,7 +814,11 @@
Similar to *Current chars* but the closing brace will be aligned to
match the indentation of the line with the opening brace.
+There is also XML-tag auto-indentation. This is enabled when the
+mode is more than just Basic, and is also controlled by a filetype
+setting - see `xml_indent_tags`_.
+
Bookmarks
^^^^^^^^^
@@ -3731,17 +3735,15 @@
1 Sort tags by appearance (line number)
===== =====================================
+.. _xml_indent_tags:
+
xml_indent_tags
If this setting is set to *true*, a new line after a line ending with an
unclosed XML/HTML tag will be automatically indented. This only applies
to filetypes for which the HTML or XML lexer is used. Such filetypes have
this setting in their system configuration files.
- .. note::
- This setting will not work if the *XML/HTML tag
- autocompletion* pref is set.
-
[build_settings] Section
````````````````````````
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2010-11-14 20:44:00 UTC (rev 5405)
+++ trunk/src/editor.c 2010-11-15 13:06:11 UTC (rev 5406)
@@ -1306,7 +1306,14 @@
{
gboolean need_close = FALSE;
gint end = sci_get_line_end_position(sci, line) - 1;
+ gint pos;
+ /* don't indent if there's a closing tag to the right of the cursor */
+ pos = sci_get_current_position(sci);
+ if (sci_get_char_at(sci, pos) == '<' &&
+ sci_get_char_at(sci, pos + 1) == '/')
+ return 0;
+
if (sci_get_char_at(sci, end) == '>' &&
sci_get_char_at(sci, end - 1) != '/')
{
@@ -1356,7 +1363,7 @@
/* HTML lexer "has braces" because of PHP and JavaScript. If get_brace_indent() did not
* recommend us to insert additional indent, we are probably not in PHP/JavaScript chunk and
* should make the XML-related check */
- if (additional_indent == 0 && !editor_prefs.auto_close_xml_tags &&
+ if (additional_indent == 0 &&
(sci_get_lexer(sci) == SCLEX_HTML ||
sci_get_lexer(sci) == SCLEX_XML) &&
editor->document->file_type->priv->xml_indent_tags)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.