Revision: 1081 http://svn.sourceforge.net/geany/?rev=1081&view=rev Author: ntrel Date: 2006-12-11 04:26:10 -0800 (Mon, 11 Dec 2006)
Log Message: ----------- Make indenting and unindenting keep the same cursor position when the cursor is within the indentation characters.
Modified Paths: -------------- trunk/ChangeLog trunk/src/callbacks.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-12-11 12:20:30 UTC (rev 1080) +++ trunk/ChangeLog 2006-12-11 12:26:10 UTC (rev 1081) @@ -1,7 +1,10 @@ 2006-12-11 Nick Treleaven nick.treleaven@btinternet.com
* src/main.c: - Show GTK+, GLib runtime version debug message, after socket_init(). + Show GTK+, GLib runtime version debug message after socket_init(). + * src/callbacks.c: + Make indenting and unindenting keep the same cursor position when + the cursor is within the indentation characters.
2006-12-10 Enrico Tröger enrico.troeger@uvena.de
Modified: trunk/src/callbacks.c =================================================================== --- trunk/src/callbacks.c 2006-12-11 12:20:30 UTC (rev 1080) +++ trunk/src/callbacks.c 2006-12-11 12:26:10 UTC (rev 1081) @@ -1947,15 +1947,16 @@ } else { - gint line, pos, old_pos; + gint line, ind_pos, old_pos;
old_pos = sci_get_current_position(doc_list[idx].sci); line = sci_get_current_line(doc_list[idx].sci, old_pos); - pos = sci_get_line_indent_position(doc_list[idx].sci, line); + ind_pos = sci_get_line_indent_position(doc_list[idx].sci, line);
- sci_set_current_position(doc_list[idx].sci, pos); + sci_set_current_position(doc_list[idx].sci, ind_pos); sci_cmd(doc_list[idx].sci, SCI_TAB); - sci_set_current_position(doc_list[idx].sci, old_pos + 1); + sci_set_current_position(doc_list[idx].sci, + (old_pos > ind_pos) ? old_pos + 1 : old_pos); } }
@@ -1973,15 +1974,18 @@ } else { - gint line, pos, old_pos; + gint line, ind_pos, old_pos;
old_pos = sci_get_current_position(doc_list[idx].sci); line = sci_get_current_line(doc_list[idx].sci, old_pos); - pos = sci_get_line_indent_position(doc_list[idx].sci, line); + ind_pos = sci_get_line_indent_position(doc_list[idx].sci, line);
- sci_set_current_position(doc_list[idx].sci, pos); + if (ind_pos == sci_get_position_from_line(doc_list[idx].sci, line)) + return; + sci_set_current_position(doc_list[idx].sci, ind_pos); sci_cmd(doc_list[idx].sci, SCI_BACKTAB); - sci_set_current_position(doc_list[idx].sci, old_pos - 1); + sci_set_current_position(doc_list[idx].sci, + (old_pos >= ind_pos) ? old_pos - 1 : old_pos); } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.