Hi there.
---------- 8< -------------------- 8< ----------
static void reflow_paragraph(GeanyEditor *editor) { ScintillaObject *sci = editor->sci; gboolean sel;
sci_start_undo_action(sci); sel = sci_has_selection(sci); if (!sel) { gint line, pos;
keybindings_send_command(GEANY_KEY_GROUP_SELECT, GEANY_KEYS_SELECT_PARAGRAPH); /* deselect last line break */ pos = sci_get_selection_end(sci); line = sci_get_line_from_position(sci, pos); pos = sci_get_line_end_position(sci, line - 1); sci_set_selection_end(sci, pos); } split_lines(editor); if (!sel) sci_set_anchor(sci, -1); sci_end_undo_action(sci); }
---------- 8< -------------------- 8< ----------
One case is not handled there. When cursor is in the last paragraph, and this last paragraph spans till the end of document (i.e., document contains no trailing newlines), the paragraph itself contains no trailing newlines, and it is wrong to deselect last line break.
The attached patch seems to solve this problem.
So many little problems and questions... I'm sorry I'm so annoying.
Best regards, Eugene.
On Sun, 13 Sep 2009 01:20:47 +0400 Eugene Arshinov earshinov@gmail.com wrote:
One case is not handled there. When cursor is in the last paragraph, and this last paragraph spans till the end of document (i.e., document contains no trailing newlines), the paragraph itself contains no trailing newlines, and it is wrong to deselect last line break.
The attached patch seems to solve this problem.
Thanks, applied.
So many little problems and questions... I'm sorry I'm so annoying.
Not at all, it's great when minor bugs get fixed too.
Regards, Nick