SF.net SVN: geany:[5336] trunk/src/editor.c
ntrel at users.sourceforge.net
ntrel at xxxxx
Wed Oct 27 16:28:29 UTC 2010
Revision: 5336
http://geany.svn.sourceforge.net/geany/?rev=5336&view=rev
Author: ntrel
Date: 2010-10-27 16:28:28 +0000 (Wed, 27 Oct 2010)
Log Message:
-----------
Simplify line breaking using SCI_NEWLINE message.
Modified Paths:
--------------
trunk/src/editor.c
Modified: trunk/src/editor.c
===================================================================
--- trunk/src/editor.c 2010-10-27 16:12:05 UTC (rev 5335)
+++ trunk/src/editor.c 2010-10-27 16:28:28 UTC (rev 5336)
@@ -537,7 +537,6 @@
if (c == GDK_space)
{
gint diff, last_pos, last_col;
- const gchar *eol = editor_get_eol_char(editor);
/* remember the distance between the current column and the last column on the line
* (we use column position in case the previous line gets altered, such as removing
@@ -547,15 +546,10 @@
diff = last_col - col;
/* break the line after the space */
- sci_insert_text(sci, pos + 1, eol);
+ sci_set_current_position(sci, pos + 1, FALSE);
+ sci_send_command(sci, SCI_NEWLINE);
line++;
- /* set position as if user had pressed return */
- pos = sci_get_position_from_line(sci, line);
- sci_set_current_position(sci, pos, FALSE);
- /* add indentation, comment multilines, etc */
- on_new_line_added(editor);
-
/* correct cursor position (might not be at line end) */
last_pos = sci_get_line_end_position(sci, line);
last_col = sci_get_col_from_position(sci, last_pos); /* get last column on line */
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