Branch: refs/heads/master
Author: Nick Treleaven <nick.treleaven(a)btinternet.com>
Committer: Nick Treleaven <nick.treleaven(a)btinternet.com>
Date: Mon, 25 Mar 2013 15:57:54 UTC
Commit: 2da51eb8299d14bc9e0c762b332edd849ceb325d
https://github.com/geany/geany/commit/2da51eb8299d14bc9e0c762b332edd849ceb3…
Log Message:
-----------
Note: Find Usage can be used from the symbol list popup menu
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
10 files changed, 7 insertions(+), 3 deletions(-)
===================================================================
@@ -1269,8 +1269,8 @@ Value *find_selection_type* behaviour
Find usage
^^^^^^^^^^
-Find usage searches all open files. It is similar to the Find All In
-Session option in the Find dialog.
+*Find Usage* searches all open files. It is similar to the *Find All In
+Session* option in the Find dialog.
If there is a selection, then it is used as the search text; otherwise
the current word is used. The current word is either taken from the
@@ -1278,11 +1278,15 @@ word nearest the edit cursor, or the word underneath the popup menu
click position when the popup menu is used. The search results are
shown in the Messages tab of the Message Window.
+.. note::
+ You can also use Find Usage for symbol list items from the popup
+ menu.
+
Find in files
^^^^^^^^^^^^^
-Find in files is a more powerful version of Find usage that searches
+*Find in Files* is a more powerful version of *Find Usage* that searches
all files in a certain directory using the Grep tool. The Grep tool
must be correctly set in Preferences to the path of the system's Grep
utility. GNU Grep is recommended (see note below).
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sun, 24 Mar 2013 14:50:22 UTC
Commit: c83a93eb65ea102ebe1f577593a3d9a9c4152aaf
https://github.com/geany/geany/commit/c83a93eb65ea102ebe1f577593a3d9a9c4152…
Log Message:
-----------
Fix search/replace for the replacement not to change search results
Fix the search & replace algorithm to make sure a replacement won't
possibly affect the next one (e.g. in case of lookahead and lookbehind
regular expressions).
To do so, first find all occurrences and only then perform replacements,
instead of doing both together.
This fixes searching/replacing of any pattern that may be affected by
its replacement (e.g. patterns that look for something not a character
in the match range), including:
* Start/end of line:
Before this change, searching with regular expression "^A" and
replacing with an empty string on the input "AA" would have resulted
in an empty output ("^A" matching again after removing the first
one). Now it properly only removes the leading "A".
* Lookahead/lookbehind:
Pattern "(?<=a)b" with empty replacement and input "abb" would have
resulted in the output "a" instead of "ab".
* And more generally, many patterns matching non-characters like
positions or out-of-match characters.
Modified Paths:
--------------
src/search.c
Modified: src/search.c
74 files changed, 34 insertions(+), 40 deletions(-)
===================================================================
@@ -2115,62 +2115,56 @@ void search_find_usage(const gchar *search_text, const gchar *original_search_te
/* ttf is updated to include the last match position (ttf->chrg.cpMin) and
* the new search range end (ttf->chrg.cpMax).
* Note: Normally you would call sci_start/end_undo_action() around this call. */
-/* Warning: Scintilla recommends caching replacements to do all at once to avoid
- * performance issues with SCI_GETCHARACTERPOINTER. */
guint search_replace_range(ScintillaObject *sci, struct Sci_TextToFind *ttf,
gint flags, const gchar *replace_text)
{
gint count = 0;
- const gchar *find_text = ttf->lpstrText;
- gint start = ttf->chrg.cpMin;
- gint end = ttf->chrg.cpMax;
+ gint offset = 0; /* difference between sear pos and replace pos */
+ GList *match, *matches = NULL;
- g_return_val_if_fail(sci != NULL && find_text != NULL && replace_text != NULL, 0);
- if (! *find_text)
+ g_return_val_if_fail(sci != NULL && ttf->lpstrText != NULL && replace_text != NULL, 0);
+ if (! *ttf->lpstrText)
return 0;
- while (TRUE)
+ /* first, search for all matches */
+ while (search_find_text(sci, flags, ttf) != -1)
{
- gint search_pos;
- gint find_len = 0, replace_len = 0;
+ if (ttf->chrgText.cpMax > ttf->chrg.cpMax)
+ break; /* found text is partially out of range */
- search_pos = search_find_text(sci, flags, ttf);
- find_len = ttf->chrgText.cpMax - ttf->chrgText.cpMin;
- if (search_pos == -1)
- break; /* no more matches */
+ matches = g_list_prepend(matches, g_memdup(ttf, sizeof *ttf));
+ ttf->chrg.cpMin = ttf->chrgText.cpMax;
- if (search_pos + find_len > end)
- break; /* found text is partly out of range */
- else
- {
- gint movepastEOL = 0;
+ /* forward after empty matches, see find_document_usage() */
+ if (ttf->chrgText.cpMax == ttf->chrgText.cpMin)
+ ttf->chrg.cpMin ++;
+ }
+ matches = g_list_reverse(matches);
- sci_set_target_start(sci, search_pos);
- sci_set_target_end(sci, search_pos + find_len);
+ /* then replace them all */
+ foreach_list (match, matches)
+ {
+ struct Sci_TextToFind *m = match->data;
+ gint replace_len;
- if (find_len <= 0)
- {
- gchar chNext = sci_get_char_at(sci, sci_get_target_end(sci));
+ sci_set_target_start(sci, offset + m->chrgText.cpMin);
+ sci_set_target_end(sci, offset + m->chrgText.cpMax);
- if (chNext == '\r' || chNext == '\n')
- movepastEOL = 1;
- }
- replace_len = search_replace_target(sci, replace_text,
- flags & SCFIND_REGEXP);
- count++;
- if (search_pos == end)
- break; /* Prevent hang when replacing regex $ */
-
- /* make the next search start after the replaced text */
- start = search_pos + replace_len + movepastEOL;
- if (find_len == 0)
- start = sci_get_position_after(sci, start); /* prevent '[ ]*' regex rematching part of replaced text */
- ttf->chrg.cpMin = start;
- end += replace_len - find_len; /* update end of range now text has changed */
- ttf->chrg.cpMax = end;
+ replace_len = search_replace_target(sci, replace_text, flags & SCFIND_REGEXP);
+ offset += replace_len - (m->chrgText.cpMax - m->chrgText.cpMin);
+ count ++;
+
+ /* on last match, update the last match/new range end */
+ if (! match->next)
+ {
+ ttf->chrg.cpMin = m->chrgText.cpMin;
+ ttf->chrg.cpMax += offset;
}
+ g_free(m);
}
+ g_list_free(matches);
+
return count;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sun, 24 Mar 2013 14:38:30 UTC
Commit: 01916596638a0bfef54386d2e24fc762ff7217c9
https://github.com/geany/geany/commit/01916596638a0bfef54386d2e24fc762ff721…
Log Message:
-----------
Fix swapped tooltips between "run in VTE"/"skip run script"
Modified Paths:
--------------
data/geany.glade
Modified: data/geany.glade
4 files changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -6185,7 +6185,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Don't use the simple run script which is usually used to display the exit status of the executed program</property>
+ <property name="tooltip_text" translatable="yes">Run programs in VTE instead of opening a terminal emulation window. Please note, programs executed in VTE cannot be stopped</property>
<property name="draw_indicator">True</property>
</object>
<packing>
@@ -6203,7 +6203,7 @@
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Run programs in VTE instead of opening a terminal emulation window. Please note, programs executed in VTE cannot be stopped</property>
+ <property name="tooltip_text" translatable="yes">Don't use the simple run script which is usually used to display the exit status of the executed program</property>
<property name="draw_indicator">True</property>
</object>
<packing>
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Lex <elextr(a)gmail.com>
Committer: Lex <elextr(a)gmail.com>
Date: Sat, 23 Mar 2013 00:58:45 UTC
Commit: e18d75b23b33def5cef4ea35ba495e5544cd2c87
https://github.com/geany/geany/commit/e18d75b23b33def5cef4ea35ba495e5544cd2…
Log Message:
-----------
Change signal used to kill executions to SIGTERM
The originally used SIGQUIT has problems:
1) see the deleted comment
2) some xterm alternatives ignore it, so they don't stop
Changed to SIGTERM which is the canonical "terminate" signal.
Removed associated unneeded ignore of SIGQUIT.
Modified Paths:
--------------
src/build.c
src/main.c
Modified: src/build.c
5 files changed, 1 insertions(+), 4 deletions(-)
===================================================================
@@ -1779,9 +1779,6 @@ static void on_toolbutton_make_activate(GtkWidget *menuitem, gpointer user_data)
static void kill_process(GPid *pid)
{
- /* Unix: SIGQUIT is not the best signal to use because it causes a core dump (this should not
- * perforce necessary for just killing a process). But we must use a signal which we can
- * ignore because the main process get it too, it is declared to ignore in main.c. */
gint result;
#ifdef G_OS_WIN32
@@ -1792,7 +1789,7 @@ static void kill_process(GPid *pid)
result = ! result;
#else
g_return_if_fail(*pid > 1);
- result = kill(*pid, SIGQUIT);
+ result = kill(*pid, SIGTERM);
#endif
if (result != 0)
Modified: src/main.c
2 files changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -1057,8 +1057,6 @@ gint main(gint argc, gchar **argv)
/* removed as signal handling was wrong, see signal_cb()
signal(SIGTERM, signal_cb); */
#ifdef G_OS_UNIX
- /* SIGQUIT is used to kill spawned children and we get also this signal, so ignore */
- signal(SIGQUIT, SIG_IGN);
/* ignore SIGPIPE signal for preventing sudden death of program */
signal(SIGPIPE, SIG_IGN);
#endif
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Lex <elextr(a)gmail.com>
Committer: Lex <elextr(a)gmail.com>
Date: Sat, 23 Mar 2013 00:48:09 UTC
Commit: 0d84e129bdb96cb3c7b3c8756264f791efe71425
https://github.com/geany/geany/commit/0d84e129bdb96cb3c7b3c8756264f791efe71…
Log Message:
-----------
Add to description of "Newline strips trailing spaces"
Add description of interaction between this action and indentation
since it is not obvious.
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
5 files changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -2025,7 +2025,10 @@ Use indicators to show compile errors
Newline strips trailing spaces
Remove any whitespace at the end of the line when you hit the
- Enter/Return key. See also `Strip trailing spaces`_.
+ Enter/Return key. See also `Strip trailing spaces`_. Note
+ auto indentation is calculated before stripping, so although this
+ setting will clear a blank line, it will not set the next line
+ indentation back to zero.
Line breaking column
The editor column number to insert a newline at when Line Breaking
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).