Permalink
Browse files

Add keybinding for 'Go to Start of Display Line' (#3182425)

  • Loading branch information...
1 parent 8187268 commit 40da14b5b1c9006aa4149481eb6a2d43ed4550fa @ntrel ntrel committed Jun 24, 2012
Showing with 39 additions and 21 deletions.
  1. +19 −12 doc/geany.html
  2. +13 −8 doc/geany.txt
  3. +6 −1 src/keybindings.c
  4. +1 −0 src/keybindings.h
View
@@ -143,7 +143,7 @@ <h2 class="subtitle" id="a-fast-light-gtk-ide">A fast, light, GTK+ IDE</h2>
<tr><th class="docinfo-name">Date:</th>
<td>2012-06-18</td></tr>
<tr><th class="docinfo-name">Version:</th>
-<td>1.22</td></tr>
+<td>1.23</td></tr>
</tbody>
</table>
<p>Copyright © 2005-2012</p>
@@ -2353,6 +2353,8 @@ <h4><a class="toc-backref" href="#id107">Features</a></h4>
<dl class="docutils">
<dt>Line wrapping</dt>
<dd>Show long lines wrapped around to new display lines.</dd>
+</dl>
+<dl class="docutils" id="smart-home-key">
<dt>&quot;Smart&quot; home key</dt>
<dd>Whether to move the cursor to the first non-whitespace character
on the line when you hit the home key on your keyboard. Pressing it
@@ -4196,29 +4198,34 @@ <h4><a class="toc-backref" href="#id169">Go to keybindings</a></h4>
</tr>
<tr><td>Go to Start of Line</td>
<td>Home</td>
-<td>Move the caret to the end of the line indentation
-unless it is already there, in which case it moves
-it to the start of the line.</td>
+<td>Move the caret to the start of the line.
+Behaves differently if <a class="reference internal" href="#smart-home-key">smart_home_key</a> is set.</td>
</tr>
<tr><td>Go to End of Line</td>
<td>End</td>
<td>Move the caret to the end of the line.</td>
</tr>
+<tr><td>Go to Start of Display Line</td>
+<td>Alt-Home</td>
+<td>Move the caret to the start of the display line.
+This is useful when you use line wrapping and
+want to jump to the start of the wrapped, virtual
+line, not the real start of the whole line.
+If the line is not wrapped, it behaves like
+<cite>Go to Start of Line</cite>.</td>
+</tr>
<tr><td>Go to End of Display Line</td>
<td>Alt-End</td>
<td>Move the caret to the end of the display line.
-This is useful when you use line wrapping and
-want to jump to the end of the wrapped, virtual
-line, not the real end of the whole line.
If the line is not wrapped, it behaves like
-<cite>Go to End of Line</cite>, see above.</td>
+<cite>Go to End of Line</cite>.</td>
</tr>
<tr><td>Go to Previous Word Part</td>
<td>Ctrl-/</td>
<td>Goto the previous part of the current word.</td>
</tr>
<tr><td>Go to Next Word Part</td>
-<td>Ctrl-</td>
+<td>Ctrl-\</td>
<td>Goto the next part of the current word.</td>
</tr>
</tbody>
@@ -5655,7 +5662,7 @@ <h4><a class="toc-backref" href="#id215">Template wildcards</a></h4>
</tr>
<tr><td>geanyversion</td>
<td>The actual Geany version, e.g.
-&quot;Geany 1.22&quot;.</td>
+&quot;Geany 1.23&quot;.</td>
<td>file templates, file header,
function description, ChangeLog entry,
bsd, gpl, snippets.</td>
@@ -5987,7 +5994,7 @@ <h1><a class="toc-backref" href="#id229">Contributing to this document</a></h1>
look, run &quot;<tt class="docutils literal">make doc</tt>&quot; in the subdirectory <tt class="docutils literal">doc</tt> of Geany's source
directory. This regenerates the <tt class="docutils literal">geany.html</tt> file. To generate a PDF
file, use the command &quot;<tt class="docutils literal">make pdf</tt>&quot; which should generate a file called
-geany-1.22.pdf.</p>
+geany-1.23.pdf.</p>
<p>After you are happy with your changes, create a patch e.g. by using:</p>
<pre class="literal-block">
% git diff geany.txt &gt; foo.patch
@@ -6788,7 +6795,7 @@ <h1><a class="toc-backref" href="#id245">License for Scintilla and SciTE</a></h1
<div class="footer">
<hr class="footer" />
<a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2012-06-18 13:25 UTC.
+Generated on: 2012-06-25 13:30 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>
View
@@ -1977,6 +1977,8 @@ Features
Line wrapping
Show long lines wrapped around to new display lines.
+.. _smart_home_key:
+
"Smart" home key
Whether to move the cursor to the first non-whitespace character
on the line when you hit the home key on your keyboard. Pressing it
@@ -3486,22 +3488,25 @@ Go to tag definition Ctrl-T Jump to the definition
Go to tag declaration Ctrl-Shift-T Jump to the declaration of the current word or
selection. See `Go to tag declaration`_.
-Go to Start of Line Home Move the caret to the end of the line indentation
- unless it is already there, in which case it moves
- it to the start of the line.
+Go to Start of Line Home Move the caret to the start of the line.
+ Behaves differently if smart_home_key_ is set.
Go to End of Line End Move the caret to the end of the line.
-Go to End of Display Line Alt-End Move the caret to the end of the display line.
+Go to Start of Display Line Alt-Home Move the caret to the start of the display line.
This is useful when you use line wrapping and
- want to jump to the end of the wrapped, virtual
- line, not the real end of the whole line.
+ want to jump to the start of the wrapped, virtual
+ line, not the real start of the whole line.
+ If the line is not wrapped, it behaves like
+ `Go to Start of Line`.
+
+Go to End of Display Line Alt-End Move the caret to the end of the display line.
If the line is not wrapped, it behaves like
- `Go to End of Line`, see above.
+ `Go to End of Line`.
Go to Previous Word Part Ctrl-/ Goto the previous part of the current word.
-Go to Next Word Part Ctrl-\ Goto the next part of the current word.
+Go to Next Word Part Ctrl-\\ Goto the next part of the current word.
=============================== ========================= ==================================================
View keybindings
View
@@ -132,7 +132,7 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id)
* Menu accels are set in apply_kb_accel(). */
/** Fills a GeanyKeyBinding struct item.
* @note Always set @a key and @a mod to 0, otherwise you will likely
- * cause conflicts with the user's custom, other plugin's keybindings or
+ * cause conflicts with the user's custom, other plugin's keybindings or
* future default keybindings.
* @param group Group.
* @param key_id Keybinding index for the group.
@@ -484,6 +484,8 @@ static void init_default_kb(void)
GDK_Home, 0, "edit_gotolinestart", _("Go to Start of Line"), NULL);
add_kb(group, GEANY_KEYS_GOTO_LINEEND, NULL,
GDK_End, 0, "edit_gotolineend", _("Go to End of Line"), NULL);
+ add_kb(group, GEANY_KEYS_GOTO_LINESTARTVISUAL, NULL,
+ GDK_Home, GDK_MOD1_MASK, "edit_gotolinestartvisual", _("Go to Start of Display Line"), NULL);
add_kb(group, GEANY_KEYS_GOTO_LINEENDVISUAL, NULL,
GDK_End, GDK_MOD1_MASK, "edit_gotolineendvisual", _("Go to End of Display Line"), NULL);
add_kb(group, GEANY_KEYS_GOTO_PREVWORDPART, NULL,
@@ -1898,6 +1900,9 @@ static gboolean cb_func_goto_action(guint key_id)
case GEANY_KEYS_GOTO_LINEEND:
sci_send_command(doc->editor->sci, SCI_LINEEND);
break;
+ case GEANY_KEYS_GOTO_LINESTARTVISUAL:
+ sci_send_command(doc->editor->sci, SCI_HOMEDISPLAY);
+ break;
case GEANY_KEYS_GOTO_LINEENDVISUAL:
sci_send_command(doc->editor->sci, SCI_LINEENDDISPLAY);
break;
View
@@ -245,6 +245,7 @@ enum GeanyKeyBindingID
GEANY_KEYS_PROJECT_NEW, /**< Keybinding. */
GEANY_KEYS_PROJECT_CLOSE, /**< Keybinding. */
GEANY_KEYS_FORMAT_JOINLINES, /**< Keybinding. */
+ GEANY_KEYS_GOTO_LINESTARTVISUAL, /**< Keybinding. */
GEANY_KEYS_COUNT /* must not be used by plugins */
};

0 comments on commit 40da14b

Please sign in to comment.