[geany/geany] 3cfd8f: Clear search markers on Mark All keybinding when already set

Nick Treleaven git-noreply at geany.org
Fri Oct 26 13:37:31 UTC 2012


Branch:      refs/heads/master
Author:      Nick Treleaven <nick.treleaven at btinternet.com>
Committer:   Nick Treleaven <nick.treleaven at btinternet.com>
Date:        Fri, 26 Oct 2012 13:37:31
Commit:      3cfd8fa8b1ff8d8efaa58dae58aa93a0230d841a
             https://github.com/geany/geany/commit/3cfd8fa8b1ff8d8efaa58dae58aa93a0230d841a

Log Message:
-----------
Clear search markers on Mark All keybinding when already set


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

Modified: doc/geany.html
14 files changed, 10 insertions(+), 4 deletions(-)
===================================================================
@@ -2891,6 +2891,12 @@ <h2 class="subtitle" id="a-fast-light-gtk-ide">A fast, light, GTK+ IDE</h2>
 <td>true</td>
 <td>immediately</td>
 </tr>
+<tr><td>use_geany_icon</td>
+<td>Whether to use the Geany icon on the
+window instead of the theme's icon</td>
+<td>false</td>
+<td>on restart</td>
+</tr>
 </tbody>
 </table>
 <p>By default, statusbar_template is empty. This tells Geany to use its
@@ -4137,7 +4143,8 @@ <h2 class="subtitle" id="a-fast-light-gtk-ide">A fast, light, GTK+ IDE</h2>
 <td>Highlight all matches of the current
 word/selection in the current document
 with a colored box. If there's nothing to
-find, highlighted matches will be cleared.</td>
+find, or the cursor is next to an existing match,
+the highlighted matches will be cleared.</td>
 </tr>
 </tbody>
 </table>
@@ -4908,8 +4915,7 @@ <h2 class="subtitle" id="a-fast-light-gtk-ide">A fast, light, GTK+ IDE</h2>
 <p><em>Example:</em> (look at system filetypes.* files)</p>
 <div class="note last">
 <p class="first admonition-title">Note</p>
-<p class="last">This can be overridden by the <em>whitespace_chars</em>
-filetypes.common setting.</p>
+<p class="last">This overrides the <em>whitespace_chars</em> filetypes.common setting.</p>
 </div>
 </dd>
 <dt>comment_single</dt>
@@ -6803,7 +6809,7 @@ <h2 class="subtitle" id="a-fast-light-gtk-ide">A fast, light, GTK+ IDE</h2>
 <div class="footer">
 <hr class="footer" />
 <a class="reference external" href="geany.txt">View document source</a>.
-Generated on: 2012-08-24 17:21 UTC.
+Generated on: 2012-10-25 16:28 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: doc/geany.txt
3 files changed, 2 insertions(+), 1 deletions(-)
===================================================================
@@ -3464,7 +3464,8 @@ Find Document Usage             Ctrl-Shift-D              Finds all occurrences
 Mark All                        Ctrl-Shift-M              Highlight all matches of the current
                                                           word/selection in the current document
                                                           with a colored box. If there's nothing to
-                                                          find, highlighted matches will be cleared.
+                                                          find, or the cursor is next to an existing match,
+                                                          the highlighted matches will be cleared.
 =============================== ========================= ==================================================
 
 


Modified: src/keybindings.c
12 files changed, 9 insertions(+), 3 deletions(-)
===================================================================
@@ -1413,14 +1413,20 @@ static gboolean cb_func_search_action(guint key_id)
 		case GEANY_KEYS_SEARCH_MARKALL:
 		{
 			gchar *text = get_current_word_or_sel(doc, TRUE);
+			gint pos = sci_get_current_position(sci);
+
+			/* clear existing search indicators instead if next to cursor */
+			if (scintilla_send_message(sci, SCI_INDICATORVALUEAT,
+					GEANY_INDICATOR_SEARCH, pos) ||
+				scintilla_send_message(sci, SCI_INDICATORVALUEAT,
+					GEANY_INDICATOR_SEARCH, MAX(pos - 1, 0)))
+				text = NULL;
 
 			if (sci_has_selection(sci))
 				search_mark_all(doc, text, SCFIND_MATCHCASE);
 			else
-			{
-				/* clears markers if text is null */
 				search_mark_all(doc, text, SCFIND_MATCHCASE | SCFIND_WHOLEWORD);
-			}
+
 			g_free(text);
 			break;
 		}



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).


More information about the Commits mailing list