Revision: 4042 http://geany.svn.sourceforge.net/geany/?rev=4042&view=rev Author: ntrel Date: 2009-07-29 17:54:48 +0000 (Wed, 29 Jul 2009)
Log Message: ----------- Rename 3 sci functions to sci_set_target_start(), sci_set_target_end(), sci_replace_target() to match the SCI_ message name.
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c trunk/src/editor.c trunk/src/keybindings.c trunk/src/sciwrappers.c trunk/src/sciwrappers.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/ChangeLog 2009-07-29 17:54:48 UTC (rev 4042) @@ -8,6 +8,11 @@ runtime and also for connecting to any GObject signal. Add 'Plugin Utility Functions' on main page. Add foreach_array() macro. + * src/keybindings.c, src/sciwrappers.c, src/sciwrappers.h, + src/document.c, src/editor.c: + Rename 3 sci functions to sci_set_target_start(), + sci_set_target_end(), sci_replace_target() to match the SCI_ + message name.
2009-07-28 Frank Lanitz <frank(at)frank(dot)uvena(dot)de>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/src/document.c 2009-07-29 17:54:48 UTC (rev 4042) @@ -1471,9 +1471,9 @@
if (sci_find_text(doc->editor->sci, SCFIND_MATCHCASE, &ttf) != -1) { - sci_target_start(doc->editor->sci, ttf.chrgText.cpMin); - sci_target_end(doc->editor->sci, ttf.chrgText.cpMax); - sci_target_replace(doc->editor->sci, filename, FALSE); + sci_set_target_start(doc->editor->sci, ttf.chrgText.cpMin); + sci_set_target_end(doc->editor->sci, ttf.chrgText.cpMax); + sci_replace_target(doc->editor->sci, filename, FALSE); }
g_free(filebase); @@ -1984,7 +1984,7 @@ gint replace_len; /* search next/prev will select matching text, which we use to set the replace target */ sci_target_from_selection(doc->editor->sci); - replace_len = sci_target_replace(doc->editor->sci, replace_text, flags & SCFIND_REGEXP); + replace_len = sci_replace_target(doc->editor->sci, replace_text, flags & SCFIND_REGEXP); /* select the replacement - find text will skip past the selected text */ sci_set_selection_start(doc->editor->sci, search_pos); sci_set_selection_end(doc->editor->sci, search_pos + replace_len); @@ -2080,8 +2080,8 @@ { gint movepastEOL = 0;
- sci_target_start(sci, search_pos); - sci_target_end(sci, search_pos + find_len); + sci_set_target_start(sci, search_pos); + sci_set_target_end(sci, search_pos + find_len);
if (find_len <= 0) { @@ -2090,7 +2090,7 @@ if (chNext == '\r' || chNext == '\n') movepastEOL = 1; } - replace_len = sci_target_replace(sci, replace_text, + replace_len = sci_replace_target(sci, replace_text, flags & SCFIND_REGEXP); count++; if (search_pos == end)
Modified: trunk/src/editor.c =================================================================== --- trunk/src/editor.c 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/src/editor.c 2009-07-29 17:54:48 UTC (rev 4042) @@ -4254,9 +4254,9 @@ pos_in_line = sci_get_col_from_position(editor->sci,search_pos); current_tab_true_length = tab_len - (pos_in_line % tab_len); tab_str = g_strnfill(current_tab_true_length, ' '); - sci_target_start(editor->sci, search_pos); - sci_target_end(editor->sci, search_pos + 1); - sci_target_replace(editor->sci, tab_str, FALSE); + sci_set_target_start(editor->sci, search_pos); + sci_set_target_end(editor->sci, search_pos + 1); + sci_replace_target(editor->sci, tab_str, FALSE); /* next search starts after replacement */ ttf.chrg.cpMin = search_pos + current_tab_true_length - 1; /* update end of range now text has changed */ @@ -4300,9 +4300,9 @@ if (search_pos == -1) break;
- sci_target_start(editor->sci, search_pos); - sci_target_end(editor->sci, search_pos + tab_len); - sci_target_replace(editor->sci, "\t", FALSE); + sci_set_target_start(editor->sci, search_pos); + sci_set_target_end(editor->sci, search_pos + tab_len); + sci_replace_target(editor->sci, "\t", FALSE); ttf.chrg.cpMin = search_pos; /* update end of range now text has changed */ ttf.chrg.cpMax -= tab_len - 1; @@ -4326,9 +4326,9 @@ } if (i < (line_end-1)) { - sci_target_start(editor->sci, i + 1); - sci_target_end(editor->sci, line_end); - sci_target_replace(editor->sci, "", FALSE); + sci_set_target_start(editor->sci, i + 1); + sci_set_target_end(editor->sci, line_end); + sci_replace_target(editor->sci, "", FALSE); } }
Modified: trunk/src/keybindings.c =================================================================== --- trunk/src/keybindings.c 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/src/keybindings.c 2009-07-29 17:54:48 UTC (rev 4042) @@ -1942,9 +1942,9 @@ * inserted (see also example below). I don't think we should care of that. */
- sci_target_start(editor->sci, + sci_set_target_start(editor->sci, sci_get_position_from_line(editor->sci, start)); - sci_target_end(editor->sci, + sci_set_target_end(editor->sci, sci_get_position_from_line(editor->sci, end)); sci_lines_join(editor->sci);
Modified: trunk/src/sciwrappers.c =================================================================== --- trunk/src/sciwrappers.c 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/src/sciwrappers.c 2009-07-29 17:54:48 UTC (rev 4042) @@ -868,19 +868,19 @@ }
-void sci_target_start(ScintillaObject *sci, gint start) +void sci_set_target_start(ScintillaObject *sci, gint start) { SSM(sci, SCI_SETTARGETSTART, start, 0); }
-void sci_target_end(ScintillaObject *sci, gint end) +void sci_set_target_end(ScintillaObject *sci, gint end) { SSM(sci, SCI_SETTARGETEND, end, 0); }
-gint sci_target_replace(ScintillaObject *sci, const gchar *text, gboolean regex) +gint sci_replace_target(ScintillaObject *sci, const gchar *text, gboolean regex) { return SSM(sci, (regex) ? SCI_REPLACETARGETRE : SCI_REPLACETARGET, (uptr_t) -1, (sptr_t) text); }
Modified: trunk/src/sciwrappers.h =================================================================== --- trunk/src/sciwrappers.h 2009-07-29 17:40:20 UTC (rev 4041) +++ trunk/src/sciwrappers.h 2009-07-29 17:54:48 UTC (rev 4042) @@ -135,10 +135,12 @@ void sci_selection_duplicate (ScintillaObject * sci); void sci_line_duplicate (ScintillaObject * sci); void sci_insert_text (ScintillaObject * sci, gint pos, const gchar *text); + void sci_target_from_selection (ScintillaObject * sci); -void sci_target_start (ScintillaObject * sci, gint start); -void sci_target_end (ScintillaObject * sci, gint end); -gint sci_target_replace (ScintillaObject * sci, const gchar *text, gboolean regex); +void sci_set_target_start (ScintillaObject * sci, gint start); +void sci_set_target_end (ScintillaObject * sci, gint end); +gint sci_get_target_end (ScintillaObject * sci); +gint sci_replace_target (ScintillaObject * sci, const gchar *text, gboolean regex);
void sci_set_keywords (ScintillaObject * sci, gint k, gchar *text); gint sci_get_lexer (ScintillaObject * sci); @@ -173,7 +175,6 @@
void sci_cancel (ScintillaObject *sci);
-gint sci_get_target_end (ScintillaObject *sci); gint sci_get_position_after (ScintillaObject *sci, gint start);
void sci_lines_split (ScintillaObject *sci, gint pixelWidth);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.