Change snippet_goto_next_cursor() to

editor_goto_next_snippet_cursor() as it's in editor.h.
Avoid using GPOINTER_TO_INT macro.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4190 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2009-09-14 17:28:07 +00:00
parent 1e53d84b6c
commit 14e4bc7239
4 changed files with 14 additions and 8 deletions

View File

@ -16,6 +16,10 @@
Add dialogs_show_prompt() which also has an 'Apply' button. Add dialogs_show_prompt() which also has an 'Apply' button.
* src/queue.c, src/queue.h: * src/queue.c, src/queue.h:
Add warning that GeanyQueue may be removed. Add warning that GeanyQueue may be removed.
* src/keybindings.c, src/editor.c, src/editor.h:
Change snippet_goto_next_cursor() to
editor_goto_next_snippet_cursor() as it's in editor.h.
Avoid using GPOINTER_TO_INT macro.
2009-09-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2009-09-13 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>

View File

@ -2166,17 +2166,20 @@ static void editor_insert_text_block(GeanyEditor *editor, const gchar *text, gin
/* Move the cursor to the next specified cursor position in an inserted snippet. /* Move the cursor to the next specified cursor position in an inserted snippet.
* Can, and should, be optimized to give better results */ * Can, and should, be optimized to give better results */
void snippet_goto_next_cursor(ScintillaObject *sci, gint current_pos) void editor_goto_next_snippet_cursor(GeanyEditor *editor)
{ {
ScintillaObject *sci = editor->sci;
gint current_pos = sci_get_current_position(sci);
if (snippet_queue) if (snippet_queue)
{ {
gpointer offset; gint offset;
snippet_queue = queue_delete(snippet_queue, &offset, FALSE); snippet_queue = queue_delete(snippet_queue, (gpointer*)&offset, FALSE);
if (current_pos > snippet_cursor_insert_pos) if (current_pos > snippet_cursor_insert_pos)
snippet_cursor_insert_pos = GPOINTER_TO_INT(offset) + current_pos; snippet_cursor_insert_pos = offset + current_pos;
else else
snippet_cursor_insert_pos += GPOINTER_TO_INT(offset); snippet_cursor_insert_pos += offset;
sci_set_current_position(sci, snippet_cursor_insert_pos, FALSE); sci_set_current_position(sci, snippet_cursor_insert_pos, FALSE);
} }

View File

@ -174,7 +174,7 @@ void editor_sci_notify_cb(GtkWidget *widget, gint scn, gpointer scnt, gpointer d
gboolean editor_start_auto_complete(GeanyEditor *editor, gint pos, gboolean force); gboolean editor_start_auto_complete(GeanyEditor *editor, gint pos, gboolean force);
void snippet_goto_next_cursor(ScintillaObject *sci, gint current_pos); void editor_goto_next_snippet_cursor(GeanyEditor *editor);
gboolean editor_complete_snippet(GeanyEditor *editor, gint pos); gboolean editor_complete_snippet(GeanyEditor *editor, gint pos);

View File

@ -1924,8 +1924,7 @@ static void cb_func_editor_action(guint key_id)
duplicate_lines(doc->editor); duplicate_lines(doc->editor);
break; break;
case GEANY_KEYS_EDITOR_SNIPPETNEXTCURSOR: case GEANY_KEYS_EDITOR_SNIPPETNEXTCURSOR:
snippet_goto_next_cursor(doc->editor->sci, editor_goto_next_snippet_cursor(doc->editor);
sci_get_current_position(doc->editor->sci));
break; break;
case GEANY_KEYS_EDITOR_DELETELINE: case GEANY_KEYS_EDITOR_DELETELINE:
delete_lines(doc->editor); delete_lines(doc->editor);