SF.net SVN: geany: [1857] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Fri Sep 7 12:34:57 UTC 2007


Revision: 1857
          http://geany.svn.sourceforge.net/geany/?rev=1857&view=rev
Author:   ntrel
Date:     2007-09-07 05:34:57 -0700 (Fri, 07 Sep 2007)

Log Message:
-----------
Add 'Move document left' and 'Move document right' keybindings.
Make fixed keybindings overridable.
Add fixed keybindings for switching to leftmost/rightmost document,
Ctrl-Shift-{PageUp,PageDown}.
Docs: Add 'Switching documents' keybindings section.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.html
    trunk/doc/geany.txt
    trunk/src/keybindings.c
    trunk/src/keybindings.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-09-05 19:46:22 UTC (rev 1856)
+++ trunk/ChangeLog	2007-09-07 12:34:57 UTC (rev 1857)
@@ -1,3 +1,13 @@
+2007-09-07  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c, src/keybindings.h, doc/geany.txt, doc/geany.html:
+   Add 'Move document left' and 'Move document right' keybindings.
+   Make fixed keybindings overridable.
+   Add fixed keybindings for switching to leftmost/rightmost document,
+   Ctrl-Shift-{PageUp,PageDown}.
+   Docs: Add 'Switching documents' keybindings section.
+
+
 2007-09-05  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
 
  * src/document.c: Fix missing syntax colouring when saving new files.

Modified: trunk/doc/geany.html
===================================================================
--- trunk/doc/geany.html	2007-09-05 19:46:22 UTC (rev 1856)
+++ trunk/doc/geany.html	2007-09-07 12:34:57 UTC (rev 1857)
@@ -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="2007-08-29" />
+<meta name="date" content="2007-08-31" />
 <style type="text/css">
 
 /*
@@ -133,7 +133,7 @@
 <br />Nick Treleaven
 <br />Frank Lanitz</td></tr>
 <tr><th class="docinfo-name">Date:</th>
-<td>2007-08-29</td></tr>
+<td>2007-08-31</td></tr>
 <tr><th class="docinfo-name">Version:</th>
 <td>0.12</td></tr>
 </tbody>
@@ -261,44 +261,48 @@
 </li>
 <li><a class="reference" href="#printing-support" id="id78" name="id78">Printing support</a></li>
 <li><a class="reference" href="#plugins" id="id79" name="id79">Plugins</a></li>
-<li><a class="reference" href="#keybindings" id="id80" name="id80">Keybindings</a></li>
+<li><a class="reference" href="#keybindings" id="id80" name="id80">Keybindings</a><ul>
+<li><a class="reference" href="#switching-documents" id="id81" name="id81">Switching documents</a></li>
+<li><a class="reference" href="#configurable-keybindings" id="id82" name="id82">Configurable keybindings</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#configuration-files" id="id81" name="id81">Configuration files</a><ul>
-<li><a class="reference" href="#global-configuration-file" id="id82" name="id82">Global configuration file</a></li>
-<li><a class="reference" href="#filetype-definition-files" id="id83" name="id83">Filetype definition files</a><ul>
-<li><a class="reference" href="#format" id="id84" name="id84">Format</a><ul>
-<li><a class="reference" href="#styling-section" id="id85" name="id85">[styling] Section</a></li>
-<li><a class="reference" href="#keywords-section" id="id86" name="id86">[keywords] Section</a></li>
-<li><a class="reference" href="#settings-section" id="id87" name="id87">[settings] Section</a></li>
-<li><a class="reference" href="#build-settings-section" id="id88" name="id88">[build_settings] Section</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#special-file-filetypes-common" id="id89" name="id89">Special file filetypes.common</a></li>
+<li><a class="reference" href="#configuration-files" id="id83" name="id83">Configuration files</a><ul>
+<li><a class="reference" href="#global-configuration-file" id="id84" name="id84">Global configuration file</a></li>
+<li><a class="reference" href="#filetype-definition-files" id="id85" name="id85">Filetype definition files</a><ul>
+<li><a class="reference" href="#format" id="id86" name="id86">Format</a><ul>
+<li><a class="reference" href="#styling-section" id="id87" name="id87">[styling] Section</a></li>
+<li><a class="reference" href="#keywords-section" id="id88" name="id88">[keywords] Section</a></li>
+<li><a class="reference" href="#settings-section" id="id89" name="id89">[settings] Section</a></li>
+<li><a class="reference" href="#build-settings-section" id="id90" name="id90">[build_settings] Section</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#filetype-extensions" id="id90" name="id90">Filetype extensions</a></li>
-<li><a class="reference" href="#templates" id="id91" name="id91">Templates</a><ul>
-<li><a class="reference" href="#template-metadata" id="id92" name="id92">Template metadata</a></li>
-<li><a class="reference" href="#filetype-templates" id="id93" name="id93">Filetype templates</a></li>
-<li><a class="reference" href="#customizing-templates" id="id94" name="id94">Customizing templates</a><ul>
-<li><a class="reference" href="#template-wildcards" id="id95" name="id95">Template wildcards</a></li>
+<li><a class="reference" href="#special-file-filetypes-common" id="id91" name="id91">Special file filetypes.common</a></li>
 </ul>
 </li>
+<li><a class="reference" href="#filetype-extensions" id="id92" name="id92">Filetype extensions</a></li>
+<li><a class="reference" href="#templates" id="id93" name="id93">Templates</a><ul>
+<li><a class="reference" href="#template-metadata" id="id94" name="id94">Template metadata</a></li>
+<li><a class="reference" href="#filetype-templates" id="id95" name="id95">Filetype templates</a></li>
+<li><a class="reference" href="#customizing-templates" id="id96" name="id96">Customizing templates</a><ul>
+<li><a class="reference" href="#template-wildcards" id="id97" name="id97">Template wildcards</a></li>
 </ul>
 </li>
 </ul>
 </li>
-<li><a class="reference" href="#contributing-to-this-document" id="id96" name="id96">Contributing to this document</a></li>
-<li><a class="reference" href="#scintilla-keyboard-commands" id="id97" name="id97">Scintilla keyboard commands</a><ul>
-<li><a class="reference" href="#keyboard-commands" id="id98" name="id98">Keyboard commands</a></li>
 </ul>
 </li>
-<li><a class="reference" href="#hidden-preferences" id="id99" name="id99">Hidden preferences</a></li>
-<li><a class="reference" href="#compile-time-options" id="id100" name="id100">Compile-time options</a></li>
-<li><a class="reference" href="#gnu-general-public-license" id="id101" name="id101">GNU General Public License</a></li>
-<li><a class="reference" href="#license-for-scintilla-and-scite" id="id102" name="id102">License for Scintilla and SciTE</a></li>
+<li><a class="reference" href="#contributing-to-this-document" id="id98" name="id98">Contributing to this document</a></li>
+<li><a class="reference" href="#scintilla-keyboard-commands" id="id99" name="id99">Scintilla keyboard commands</a><ul>
+<li><a class="reference" href="#keyboard-commands" id="id100" name="id100">Keyboard commands</a></li>
 </ul>
+</li>
+<li><a class="reference" href="#hidden-preferences" id="id101" name="id101">Hidden preferences</a></li>
+<li><a class="reference" href="#compile-time-options" id="id102" name="id102">Compile-time options</a></li>
+<li><a class="reference" href="#gnu-general-public-license" id="id103" name="id103">GNU General Public License</a></li>
+<li><a class="reference" href="#license-for-scintilla-and-scite" id="id104" name="id104">License for Scintilla and SciTE</a></li>
+</ul>
 </div>
 <div class="section">
 <h1><a class="toc-backref" href="#id2" id="introduction" name="introduction">Introduction</a></h1>
@@ -1466,6 +1470,38 @@
 editing widget. For a list of these commands, see <a class="reference" href="#scintilla-keyboard-commands">Scintilla
 keyboard commands</a>. The Scintilla keyboard shortcuts will be overridden
 by any custom keybindings with the same keyboard shortcut.</p>
+<div class="section">
+<h3><a class="toc-backref" href="#id81" id="switching-documents" name="switching-documents">Switching documents</a></h3>
+<p>There are a few non-configurable bindings to switch between documents,
+listed below. These can also be overridden by custom keybindings.</p>
+<table border="1" class="docutils">
+<colgroup>
+<col width="31%" />
+<col width="69%" />
+</colgroup>
+<thead valign="bottom">
+<tr><th class="head">Key</th>
+<th class="head">Action</th>
+</tr>
+</thead>
+<tbody valign="top">
+<tr><td>Alt-[1-9]</td>
+<td>Select left-most tab, from 1 to 9.</td>
+</tr>
+<tr><td>Alt-0</td>
+<td>Select right-most tab.</td>
+</tr>
+<tr><td>Ctrl-Shift-PgUp</td>
+<td>Select left-most tab.</td>
+</tr>
+<tr><td>Ctrl-Shift-PgDn</td>
+<td>Select right-most tab.</td>
+</tr>
+</tbody>
+</table>
+</div>
+<div class="section">
+<h3><a class="toc-backref" href="#id82" id="configurable-keybindings" name="configurable-keybindings">Configurable keybindings</a></h3>
 <p>For all actions listed below you can define your own keybindings. Open
 the Preferences dialog, select the desired action and click on
 change. In the opening dialog you can press any key combination you
@@ -1474,9 +1510,9 @@
 <p>Some of the default key combinations cannot be changed, e.g. menu_new
 or menu_open. These are set by GTK and should be kept, but you can
 still add other key combinations for these actions. For example to
-execute menu_open by default Ctrl-O is set, but you can also define
-Alt-O, so that the file open dialog is shown by pressing either Ctrl-O
-or Alt-O.</p>
+execute menu_open by default <em>Ctrl-O</em> is set, but you can also define
+<em>Alt-O</em>, so that the file open dialog is shown by pressing either
+<em>Ctrl-O</em> or <em>Alt-O</em>.</p>
 <p>The following table lists all customizable keyboard shortcuts.</p>
 <table border="1" class="docutils">
 <colgroup>
@@ -1812,10 +1848,11 @@
 </table>
 </div>
 </div>
+</div>
 <div class="section">
-<h1><a class="toc-backref" href="#id81" id="configuration-files" name="configuration-files">Configuration files</a></h1>
+<h1><a class="toc-backref" href="#id83" id="configuration-files" name="configuration-files">Configuration files</a></h1>
 <div class="section">
-<h2><a class="toc-backref" href="#id82" id="global-configuration-file" name="global-configuration-file">Global configuration file</a></h2>
+<h2><a class="toc-backref" href="#id84" id="global-configuration-file" name="global-configuration-file">Global configuration file</a></h2>
 <p>You can use a global configuration file for Geany which will be used if
 the user starts Geany for the first time and an user's configuration
 file was not yet created or in case an user deleted the configuration
@@ -1835,7 +1872,7 @@
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id83" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
+<h2><a class="toc-backref" href="#id85" id="filetype-definition-files" name="filetype-definition-files">Filetype definition files</a></h2>
 <p>All colour definitions and other filetype specific settings are
 stored in the filetype definition files. Those settings are colours
 for syntax highlighting, general settings like comment characters or
@@ -1863,9 +1900,9 @@
 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 class="section">
-<h3><a class="toc-backref" href="#id84" id="format" name="format">Format</a></h3>
+<h3><a class="toc-backref" href="#id86" id="format" name="format">Format</a></h3>
 <div class="section">
-<h4><a class="toc-backref" href="#id85" id="styling-section" name="styling-section">[styling] Section</a></h4>
+<h4><a class="toc-backref" href="#id87" id="styling-section" name="styling-section">[styling] Section</a></h4>
 <p>In this section the colours for syntax highlighting are defined. The
 format is always: key=forground_colour;background_colour;bold;italic</p>
 <p>Colours have to be specified as RGB hex values prefixed by
@@ -1875,7 +1912,7 @@
 value is something other than "true" or "false", "false" is assumed.</p>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id86" id="keywords-section" name="keywords-section">[keywords] Section</a></h4>
+<h4><a class="toc-backref" href="#id88" id="keywords-section" name="keywords-section">[keywords] Section</a></h4>
 <p>This section contains keys for different keyword lists specific to
 the filetype. Some filetypes do not support keywords, so adding a
 new key will not work. You can only add or remove keywords to/from
@@ -1886,7 +1923,7 @@
 </div>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id87" id="settings-section" name="settings-section">[settings] Section</a></h4>
+<h4><a class="toc-backref" href="#id89" id="settings-section" name="settings-section">[settings] Section</a></h4>
 <dl class="docutils">
 <dt>wordchars</dt>
 <dd><p class="first">These characters define word boundaries when making selections
@@ -1940,7 +1977,7 @@
 </dl>
 </div>
 <div class="section">
-<h4><a class="toc-backref" href="#id88" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
+<h4><a class="toc-backref" href="#id90" id="build-settings-section" name="build-settings-section">[build_settings] Section</a></h4>
 <dl class="docutils">
 <dt>compiler</dt>
 <dd><p class="first">This item specifies the command to compile source code files. But
@@ -1973,7 +2010,7 @@
 </div>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id89" id="special-file-filetypes-common" name="special-file-filetypes-common">Special file filetypes.common</a></h3>
+<h3><a class="toc-backref" href="#id91" id="special-file-filetypes-common" name="special-file-filetypes-common">Special file filetypes.common</a></h3>
 <p>There is a special filetype definition file called
 filetypes.common. This file defines some general non-filetype-specific
 settings.</p>
@@ -2083,7 +2120,7 @@
 </div>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id90" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
+<h2><a class="toc-backref" href="#id92" id="filetype-extensions" name="filetype-extensions">Filetype extensions</a></h2>
 <p>You can override the default extensions that Geany uses for each
 filetype using the <tt class="docutils literal"><span class="pre">filetype_extensions.conf</span></tt> file.</p>
 <p>To override the system-wide configuration file, copy it from
@@ -2107,7 +2144,7 @@
 </pre>
 </div>
 <div class="section">
-<h2><a class="toc-backref" href="#id91" id="templates" name="templates">Templates</a></h2>
+<h2><a class="toc-backref" href="#id93" id="templates" name="templates">Templates</a></h2>
 <p>Geany supports the following templates:</p>
 <ul class="simple">
 <li>ChangeLog entry</li>
@@ -2129,7 +2166,7 @@
 of a function or the function name cannot be determined, you cannot
 insert a function description.</p>
 <div class="section">
-<h3><a class="toc-backref" href="#id92" id="template-metadata" name="template-metadata">Template metadata</a></h3>
+<h3><a class="toc-backref" href="#id94" id="template-metadata" name="template-metadata">Template metadata</a></h3>
 <p>Metadata can be used with all templates, but by default user set
 metadata is only used for the ChangeLog and File header templates.</p>
 <p>In the configuration dialog you can find a tab "Templates" (see
@@ -2139,7 +2176,7 @@
 at startup.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id93" id="filetype-templates" name="filetype-templates">Filetype templates</a></h3>
+<h3><a class="toc-backref" href="#id95" id="filetype-templates" name="filetype-templates">Filetype templates</a></h3>
 <p>Filetype templates are templates used as the basis of a new file. To
 use them, choose the <em>New (with Template)</em> menu item from the <em>File</em>
 menu.</p>
@@ -2160,7 +2197,7 @@
 the New command is used without a filetype. This is empty by default.</p>
 </div>
 <div class="section">
-<h3><a class="toc-backref" href="#id94" id="customizing-templates" name="customizing-templates">Customizing templates</a></h3>
+<h3><a class="toc-backref" href="#id96" id="customizing-templates" name="customizing-templates">Customizing templates</a></h3>
 <p>Each template can be customized to your needs. The templates are
 stored in the <tt class="docutils literal"><span class="pre">~/.geany/templates/</span></tt> directory (see the section called
 <a class="reference" href="#command-line-options">Command line options</a> for further information about the configuration
@@ -2168,7 +2205,7 @@
 Geany ;-) ) and edit the template to your needs. There are some
 wildcards which will be automatically replaced by Geany at startup.</p>
 <div class="section">
-<h4><a class="toc-backref" href="#id95" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
+<h4><a class="toc-backref" href="#id97" id="template-wildcards" name="template-wildcards">Template wildcards</a></h4>
 <p>All wildcards must be enclosed by "{" and "}", e.g. {date}.</p>
 <table border="1" class="docutils">
 <colgroup>
@@ -2277,7 +2314,7 @@
 </div>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id96" id="contributing-to-this-document" name="contributing-to-this-document">Contributing to this document</a></h1>
+<h1><a class="toc-backref" href="#id98" id="contributing-to-this-document" name="contributing-to-this-document">Contributing to this document</a></h1>
 <p>This document (<tt class="docutils literal"><span class="pre">geany.txt</span></tt>) is written in <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>
 (or "reST"). The source file for it is located in Geany's <tt class="docutils literal"><span class="pre">doc</span></tt>
 subdirectory.  If you intend on making changes, you should grab the
@@ -2297,7 +2334,7 @@
 and Fedora systems.</p>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id97" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
+<h1><a class="toc-backref" href="#id99" id="scintilla-keyboard-commands" name="scintilla-keyboard-commands">Scintilla keyboard commands</a></h1>
 <p>Copyright © 1998, 2006 Neil Hodgson <neilh(at)scintilla(dot)org></p>
 <p>This appendix is distributed under the terms of the License for
 Scintilla and SciTE. A copy of this license can be found in the file
@@ -2306,7 +2343,7 @@
 Scintilla and SciTE</a>.</p>
 <p>20 June 2006</p>
 <div class="section">
-<h2><a class="toc-backref" href="#id98" id="keyboard-commands" name="keyboard-commands">Keyboard commands</a></h2>
+<h2><a class="toc-backref" href="#id100" id="keyboard-commands" name="keyboard-commands">Keyboard commands</a></h2>
 <p>Keyboard commands for Scintilla mostly follow common Windows and GTK+
 conventions. All move keys (arrows, page up/down, home and end)
 allows to extend or reduce the stream selection when holding the
@@ -2383,10 +2420,10 @@
 <tr><td>Scroll down.</td>
 <td>Ctrl+Down</td>
 </tr>
-<tr><td>Previous paragraph. Shift extends selection.</td>
+<tr><td>Previous paragraph.</td>
 <td>Ctrl+[</td>
 </tr>
-<tr><td>Next paragraph. Shift extends selection.</td>
+<tr><td>Next paragraph.</td>
 <td>Ctrl+]</td>
 </tr>
 <tr><td>Previous word. Shift extends selection.</td>
@@ -2395,10 +2432,10 @@
 <tr><td>Next word. Shift extends selection.</td>
 <td>Ctrl+Right</td>
 </tr>
-<tr><td>Previous word part. Shift extends selection</td>
+<tr><td>Previous word part.</td>
 <td>Ctrl+/</td>
 </tr>
-<tr><td>Next word part. Shift extends selection.</td>
+<tr><td>Next word part.</td>
 <td>Ctrl+\</td>
 </tr>
 </tbody>
@@ -2406,7 +2443,7 @@
 </div>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id99" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
+<h1><a class="toc-backref" href="#id101" id="hidden-preferences" name="hidden-preferences">Hidden preferences</a></h1>
 <p>There are some uncommon preferences that are not shown in the
 Preferences dialog. These can be set by using a second instance of
 Geany to edit <tt class="docutils literal"><span class="pre">~/.geany/geany.conf</span></tt>. After saving the file, restart
@@ -2452,7 +2489,7 @@
 </table>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id100" id="compile-time-options" name="compile-time-options">Compile-time options</a></h1>
+<h1><a class="toc-backref" href="#id102" id="compile-time-options" name="compile-time-options">Compile-time options</a></h1>
 <p>There are some options which can only be changed at compile time. To
 change these options, edit the file src/geany.h. Look for a block of
 lines starting with <tt class="docutils literal"><span class="pre">#define</span> <span class="pre">GEANY_*</span></tt>. Any definitions which are
@@ -2597,7 +2634,7 @@
 </table>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id101" id="gnu-general-public-license" name="gnu-general-public-license">GNU General Public License</a></h1>
+<h1><a class="toc-backref" href="#id103" id="gnu-general-public-license" name="gnu-general-public-license">GNU General Public License</a></h1>
 <pre class="literal-block">
             GNU GENERAL PUBLIC LICENSE
                Version 2, June 1991
@@ -2942,7 +2979,7 @@
 </pre>
 </div>
 <div class="section">
-<h1><a class="toc-backref" href="#id102" id="license-for-scintilla-and-scite" name="license-for-scintilla-and-scite">License for Scintilla and SciTE</a></h1>
+<h1><a class="toc-backref" href="#id104" id="license-for-scintilla-and-scite" name="license-for-scintilla-and-scite">License for Scintilla and SciTE</a></h1>
 <p>Copyright 1998-2003 by Neil Hodgson <neilh(at)scintilla(dot)org></p>
 <p>All Rights Reserved</p>
 <p>Permission to use, copy, modify, and distribute this software and
@@ -2962,7 +2999,7 @@
 <div class="footer">
 <hr class="footer" />
 <a class="reference" href="geany.txt">View document source</a>.
-Generated on: 2007-08-30 10:25 UTC.
+Generated on: 2007-09-07 12:34 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	2007-09-05 19:46:22 UTC (rev 1856)
+++ trunk/doc/geany.txt	2007-09-07 12:34:57 UTC (rev 1857)
@@ -1347,9 +1347,9 @@
 ``-p``, which prevents plugins being loaded. Plugins are scanned in
 the following directories:
 
-*	``$prefix/lib/geany`` (``$prefix`` is usually ``/usr/local`` or
-	``/usr``)
-*	``~/.geany/plugins``
+*   ``$prefix/lib/geany`` (``$prefix`` is usually ``/usr/local`` or
+    ``/usr``)
+*   ``~/.geany/plugins``
 
 Most plugins add menu items to the *Tools* menu when they are loaded.
 
@@ -1367,6 +1367,26 @@
 keyboard commands`_. The Scintilla keyboard shortcuts will be overridden
 by any custom keybindings with the same keyboard shortcut.
 
+
+Switching documents
+^^^^^^^^^^^^^^^^^^^
+
+There are a few non-configurable bindings to switch between documents,
+listed below. These can also be overridden by custom keybindings.
+
+=============== ==================================
+Key             Action
+=============== ==================================
+Alt-[1-9]       Select left-most tab, from 1 to 9.
+Alt-0           Select right-most tab.
+Ctrl-Shift-PgUp Select left-most tab.
+Ctrl-Shift-PgDn Select right-most tab.
+=============== ==================================
+
+
+Configurable keybindings
+^^^^^^^^^^^^^^^^^^^^^^^^
+
 For all actions listed below you can define your own keybindings. Open
 the Preferences dialog, select the desired action and click on
 change. In the opening dialog you can press any key combination you
@@ -1376,9 +1396,9 @@
 Some of the default key combinations cannot be changed, e.g. menu_new
 or menu_open. These are set by GTK and should be kept, but you can
 still add other key combinations for these actions. For example to
-execute menu_open by default Ctrl-O is set, but you can also define
-Alt-O, so that the file open dialog is shown by pressing either Ctrl-O
-or Alt-O.
+execute menu_open by default *Ctrl-O* is set, but you can also define
+*Alt-O*, so that the file open dialog is shown by pressing either
+*Ctrl-O* or *Alt-O*.
 
 The following table lists all customizable keyboard shortcuts.
 
@@ -2181,12 +2201,12 @@
 Extend selection to end of display line.        Alt+Shift+End
 Scroll up.                                      Ctrl+Up
 Scroll down.                                    Ctrl+Down
-Previous paragraph. Shift extends selection.    Ctrl+[
-Next paragraph. Shift extends selection.        Ctrl+]
+Previous paragraph.                             Ctrl+[
+Next paragraph.                                 Ctrl+]
 Previous word. Shift extends selection.         Ctrl+Left
 Next word. Shift extends selection.             Ctrl+Right
-Previous word part. Shift extends selection     Ctrl+/
-Next word part. Shift extends selection.        Ctrl+\\
+Previous word part.                             Ctrl+/
+Next word part.                                 Ctrl+\\
 =============================================   ======================
 
 

Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c	2007-09-05 19:46:22 UTC (rev 1856)
+++ trunk/src/keybindings.c	2007-09-07 12:34:57 UTC (rev 1857)
@@ -97,6 +97,7 @@
 static void cb_func_switch_tableft(guint key_id);
 static void cb_func_switch_tabright(guint key_id);
 static void cb_func_switch_tablastused(guint key_id);
+static void cb_func_move_tab(guint key_id);
 static void cb_func_nav_back(guint key_id);
 static void cb_func_nav_forward(guint key_id);
 static void cb_func_toggle_sidebar(guint key_id);
@@ -238,6 +239,10 @@
 		GDK_Page_Down, GDK_CONTROL_MASK, "switch_tabright", _("Switch to right document"));
 	keys[GEANY_KEYS_SWITCH_TABLASTUSED] = fill(cb_func_switch_tablastused,
 		GDK_Tab, GDK_CONTROL_MASK, "switch_tablastused", _("Switch to last used document"));
+	keys[GEANY_KEYS_MOVE_TABLEFT] = fill(cb_func_move_tab,
+		GDK_Page_Up, GDK_MOD1_MASK, "move_tableft", _("Move document left"));
+	keys[GEANY_KEYS_MOVE_TABRIGHT] = fill(cb_func_move_tab,
+		GDK_Page_Down, GDK_MOD1_MASK, "move_tabright", _("Move document right"));
 	keys[GEANY_KEYS_NAV_BACK] = fill(cb_func_nav_back,
 		0, 0, "nav_back", _("Navigate back a location"));
 	keys[GEANY_KEYS_NAV_FORWARD] = fill(cb_func_nav_forward,
@@ -615,6 +620,19 @@
 		gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), page);
 		return TRUE;
 	}
+	if (event->keyval == GDK_Page_Up || event->keyval == GDK_Page_Down)
+	{
+		// switch to first or last document
+		if (event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
+		{
+			if (event->keyval == GDK_Page_Up)
+				gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook), 0);
+			if (event->keyval == GDK_Page_Down)
+				gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook),
+					gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)) - 1);
+			return TRUE;
+		}
+	}
 	return FALSE;
 }
 
@@ -663,9 +681,7 @@
 	if (event->state & GDK_MOD2_MASK)
 		event->state -= GDK_MOD2_MASK;
 
-	// special cases
-	if (check_fixed_kb(event))
-		return TRUE;
+	// special case
 	if (check_construct_completion(event))
 		return TRUE;
 
@@ -681,6 +697,9 @@
 			return TRUE;
 		}
 	}
+	// fixed keybindings can be overridden by user bindings
+	if (check_fixed_kb(event))
+		return TRUE;
 	return FALSE;
 }
 
@@ -1014,6 +1033,32 @@
 			document_get_notebook_page(last_doc_idx));
 }
 
+// move document left/right
+static void cb_func_move_tab(guint key_id)
+{
+	gint idx = document_get_cur_idx();
+	GtkWidget *sci = GTK_WIDGET(doc_list[idx].sci);
+	GtkNotebook *nb = GTK_NOTEBOOK(app->notebook);
+	gint cur_page = gtk_notebook_get_current_page(nb);
+
+	if (! DOC_IDX_VALID(idx))
+		return;
+
+	if (key_id == GEANY_KEYS_MOVE_TABLEFT)
+	{
+		gtk_notebook_reorder_child(nb, sci, cur_page - 1);	// notebook wraps around by default
+	}
+	else if (key_id == GEANY_KEYS_MOVE_TABRIGHT)
+	{
+		gint npage = cur_page + 1;
+
+		if (npage == gtk_notebook_get_n_pages(nb))
+			npage = 0;	// wraparound
+		gtk_notebook_reorder_child(nb, sci, npage);
+	}
+	return;
+}
+
 static void cb_func_toggle_sidebar(G_GNUC_UNUSED guint key_id)
 {
 	on_menu_show_sidebar1_toggled(NULL, NULL);

Modified: trunk/src/keybindings.h
===================================================================
--- trunk/src/keybindings.h	2007-09-05 19:46:22 UTC (rev 1856)
+++ trunk/src/keybindings.h	2007-09-07 12:34:57 UTC (rev 1857)
@@ -112,6 +112,8 @@
 	GEANY_KEYS_SWITCH_TABLEFT,
 	GEANY_KEYS_SWITCH_TABRIGHT,
 	GEANY_KEYS_SWITCH_TABLASTUSED,
+	GEANY_KEYS_MOVE_TABLEFT,
+	GEANY_KEYS_MOVE_TABRIGHT,
 	GEANY_KEYS_NAV_FORWARD,
 	GEANY_KEYS_NAV_BACK,
 


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