From e7181e92955bdf8b40e95ebec134a30d8c93fd62 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 10 Jun 2010 15:43:50 +0000 Subject: [PATCH] Group undo action for Insert Multiline Comment. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5015 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 6 ++++++ src/editor.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 42db614d2..91d2522b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-10 Nick Treleaven + + * src/editor.c: + Group undo action for Insert Multiline Comment. + + 2010-06-08 Nick Treleaven * Makefile.am: diff --git a/src/editor.c b/src/editor.c index d51623a3a..052d6c731 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3677,6 +3677,8 @@ void editor_insert_multiline_comment(GeanyEditor *editor) g_return_if_fail(editor != NULL && editor->document->file_type != NULL && editor->document->file_type->comment_open != NULL); + sci_start_undo_action(editor->sci); + doc = editor->document; if (doc->file_type->comment_close != NULL && strlen(doc->file_type->comment_close) > 0) @@ -3703,7 +3705,6 @@ void editor_insert_multiline_comment(GeanyEditor *editor) sci_insert_text(editor->sci, pos, text); g_free(text); - /* select the inserted lines for commenting */ sci_set_selection_start(editor->sci, pos); sci_set_selection_end(editor->sci, pos + text_len); @@ -3722,6 +3723,8 @@ void editor_insert_multiline_comment(GeanyEditor *editor) sci_set_current_position(editor->sci, pos, TRUE); /* reset the selection */ sci_set_anchor(editor->sci, pos); + + sci_end_undo_action(editor->sci); } -- 2.11.4.GIT