SF.net SVN: geany: [453] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Sat Jun 17 15:39:59 UTC 2006
Revision: 453
Author: ntrel
Date: 2006-06-17 08:39:47 -0700 (Sat, 17 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=453&view=rev
Log Message:
-----------
Made Duplicate Line command duplicate selection if present
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/geany.docbook
trunk/src/keybindings.c
trunk/src/sciwrappers.c
trunk/src/sciwrappers.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-16 19:58:26 UTC (rev 452)
+++ trunk/ChangeLog 2006-06-17 15:39:47 UTC (rev 453)
@@ -1,3 +1,10 @@
+2006-06-17 Nick Treleaven <nick.treleaven at btinternet.com>
+
+ * src/keybindings.c, src/sciwrappers.c, src/sciwrappers.h,
+ doc/geany.docbook: Made Duplicate Line command duplicate selection
+ if present.
+
+
2006-06-16 Enrico Troeger <enrico.troeger at uvena.de>
* src/build.c: Delete all indicators when starting a new compilation.
Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook 2006-06-16 19:58:26 UTC (rev 452)
+++ trunk/doc/geany.docbook 2006-06-17 15:39:47 UTC (rev 453)
@@ -933,8 +933,8 @@
<entry align="left" spanname="hspan">Editing operations</entry>
</row>
<row>
- <entry>Duplicate line</entry>
- <entry>Duplicates the current line.</entry>
+ <entry>Duplicate line or selection</entry>
+ <entry>Duplicates the current line or selection.</entry>
</row>
<row>
<entry>Comment line</entry>
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2006-06-16 19:58:26 UTC (rev 452)
+++ trunk/src/keybindings.c 2006-06-17 15:39:47 UTC (rev 453)
@@ -133,7 +133,7 @@
keys[GEANY_KEYS_SWITCH_TABLEFT] = fill(cb_func_switch_tableft, 0, 0, "switch_tableft", _("Switch to left document"));
keys[GEANY_KEYS_SWITCH_TABRIGHT] = fill(cb_func_switch_tabright, 0, 0, "switch_tabright", _("Switch to right document"));
keys[GEANY_KEYS_TOOGLE_SIDEBAR] = fill(cb_func_toggle_sidebar, 0, 0, "toggle_sidebar", _("Toggle sidebar"));
- keys[GEANY_KEYS_EDIT_DUPLICATELINE] = fill(cb_func_edit_duplicateline, GDK_g, GDK_CONTROL_MASK, "edit_duplicateline", _("Duplicate line"));
+ keys[GEANY_KEYS_EDIT_DUPLICATELINE] = fill(cb_func_edit_duplicateline, GDK_g, GDK_CONTROL_MASK, "edit_duplicateline", _("Duplicate line or selection"));
keys[GEANY_KEYS_EDIT_COMMENTLINE] = fill(cb_func_edit_commentline, GDK_d, GDK_CONTROL_MASK, "edit_commentline", _("Comment line"));
keys[GEANY_KEYS_EDIT_AUTOCOMPLETE] = fill(cb_func_edit_autocomplete, GDK_space, GDK_CONTROL_MASK, "edit_autocomplete", _("Complete word"));
keys[GEANY_KEYS_EDIT_CALLTIP] = fill(cb_func_edit_calltip, GDK_space, GDK_MOD1_MASK, "edit_calltip", _("Show calltip"));
@@ -512,7 +512,10 @@
static void cb_func_edit_duplicateline(void)
{
gint idx = document_get_cur_idx();
- sci_line_duplicate(doc_list[idx].sci);
+ if (sci_can_copy(doc_list[idx].sci))
+ sci_selection_duplicate(doc_list[idx].sci);
+ else
+ sci_line_duplicate(doc_list[idx].sci);
}
static void cb_func_edit_commentline(void)
Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c 2006-06-16 19:58:26 UTC (rev 452)
+++ trunk/src/sciwrappers.c 2006-06-17 15:39:47 UTC (rev 453)
@@ -704,6 +704,12 @@
}
+void sci_selection_duplicate(ScintillaObject *sci)
+{
+ SSM(sci, SCI_SELECTIONDUPLICATE, 0, 0);
+}
+
+
void sci_insert_text(ScintillaObject *sci, gint pos, const gchar *text)
{
SSM(sci, SCI_INSERTTEXT, pos, (sptr_t) text);
Modified: trunk/src/sciwrappers.h
===================================================================
--- trunk/src/sciwrappers.h 2006-06-16 19:58:26 UTC (rev 452)
+++ trunk/src/sciwrappers.h 2006-06-17 15:39:47 UTC (rev 453)
@@ -129,6 +129,7 @@
void sci_clear_cmdkey (ScintillaObject * sci, gint key);
void sci_assign_cmdkey (ScintillaObject * sci, gint key, gint command);
void sci_get_text_range (ScintillaObject * sci, gint start, gint end, gchar *text);
+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_grap_focus (ScintillaObject * sci);
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