SF.net SVN: geany-plugins:[1764] trunk/geany-plugins/geanyinsertnum
sheckley at users.sourceforge.net
sheckley at xxxxx
Tue Dec 7 18:22:31 UTC 2010
Revision: 1764
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1764&view=rev
Author: sheckley
Date: 2010-12-07 18:22:31 +0000 (Tue, 07 Dec 2010)
Log Message:
-----------
added thin selection support, small changes
Modified Paths:
--------------
trunk/geany-plugins/geanyinsertnum/ChangeLog
trunk/geany-plugins/geanyinsertnum/README
trunk/geany-plugins/geanyinsertnum/src/insertnum.c
Modified: trunk/geany-plugins/geanyinsertnum/ChangeLog
===================================================================
--- trunk/geany-plugins/geanyinsertnum/ChangeLog 2010-12-02 23:35:11 UTC (rev 1763)
+++ trunk/geany-plugins/geanyinsertnum/ChangeLog 2010-12-07 18:22:31 UTC (rev 1764)
@@ -1,3 +1,9 @@
+2010-12-07 Dimitar Zhekov <dimitar.zhekov at gmail.com>
+
+ * src/insertnum.c:
+ Added thin selection support. Increased the required API version
+ to that of Geany 0.19 (the first that includes thin selection).
+
2010-10-06 Dimitar Zhekov <dimitar.zhekov at gmail.com>
* src/insertnum.c:
Modified: trunk/geany-plugins/geanyinsertnum/README
===================================================================
--- trunk/geany-plugins/geanyinsertnum/README 2010-12-02 23:35:11 UTC (rev 1763)
+++ trunk/geany-plugins/geanyinsertnum/README 2010-12-07 18:22:31 UTC (rev 1764)
@@ -6,6 +6,7 @@
This plugin replaces a (possibly zero-width) rectangular selection with
integer numbers, using start/step/base etc. specified by the user.
For practical reasons, the number of lines is limited to 100000.
+Lines shorter than the current selection are skipped.
Requirements
@@ -50,4 +51,4 @@
Ideas, questions, patches and bug reports
-----------------------------------------
-Dimitar Toshkov Zhekov <jimmy at is-vn.bg>
+Dimitar Zhekov <dimitar.zhekov at gmail.com>
Modified: trunk/geany-plugins/geanyinsertnum/src/insertnum.c
===================================================================
--- trunk/geany-plugins/geanyinsertnum/src/insertnum.c 2010-12-02 23:35:11 UTC (rev 1763)
+++ trunk/geany-plugins/geanyinsertnum/src/insertnum.c 2010-12-07 18:22:31 UTC (rev 1764)
@@ -28,10 +28,10 @@
GeanyData *geany_data;
GeanyFunctions *geany_functions;
-PLUGIN_VERSION_CHECK(150)
+PLUGIN_VERSION_CHECK(189)
PLUGIN_SET_INFO(_("Insert Numbers"), _("Insert/Fill columns with numbers."),
- "0.2", "Dimitar Toshkov Zhekov <dimitar.zhekov at gmail.com>");
+ "0.2.1", "Dimitar Toshkov Zhekov <dimitar.zhekov at gmail.com>")
/* Keybinding(s) */
enum
@@ -86,7 +86,8 @@
{
ScintillaObject *sci = doc->editor->sci;
- if (sci_has_selection(sci) && sci_get_selection_mode(sci) == SC_SEL_RECTANGLE)
+ if (sci_has_selection(sci) && (sci_get_selection_mode(sci) == SC_SEL_RECTANGLE ||
+ sci_get_selection_mode(sci) == SC_SEL_THIN))
{
start_pos = sci_get_selection_start(sci);
start_line = sci_get_line_from_position(sci, start_pos);
@@ -106,17 +107,10 @@
gtk_main_iteration();
}
-/* not included in 0.18 */
-static int sci_point_x_from_position(ScintillaObject *sci, gint position)
-{
- return scintilla_send_message(sci, SCI_POINTXFROMPOSITION, 0, position);
-}
-
-/* not #defined in 0.18 */
+#define sci_point_x_from_position(sci, position) \
+ scintilla_send_message(sci, SCI_POINTXFROMPOSITION, 0, position)
#define sci_get_pos_at_line_sel_start(sci, line) \
- scintilla_send_message((sci), SCI_GETLINESELSTARTPOSITION, (line), 0)
-#define sci_goto_pos(sci, position) \
- scintilla_send_message((sci), SCI_GOTOPOS, (position), 0)
+ scintilla_send_message(sci, SCI_GETLINESELSTARTPOSITION, line, 0)
static void insert_numbers(gboolean *cancel)
{
@@ -237,7 +231,7 @@
update_display();
if (*cancel)
{
- sci_goto_pos(sci, insert_pos + length);
+ scintilla_send_message(sci, SCI_GOTOPOS, insert_pos + length, 0);
break;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list