Commit 657c65ed authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Fix highlighting of selection wrt. to empty lines. (#90435, #90582)

2002-12-25  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
	selection wrt. to empty lines.  (#90435, #90582)

	* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
	Keep the cursor on screen.  (#96929)
parent 78323952
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
2002-12-25 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextdisplay.c (gtk_text_layout_draw): Fix highlighting of
selection wrt. to empty lines. (#90435, #90582)
* gtk/gtktextview.c (gtk_text_view_preedit_changed_handler):
Keep the cursor on screen. (#96929)
2002-12-24 Matthias Clasen <maclas@gmx.de> 2002-12-24 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextbuffer.c (paste_from_buffer): * gtk/gtktextbuffer.c (paste_from_buffer):
......
...@@ -803,7 +803,8 @@ gtk_text_layout_draw (GtkTextLayout *layout, ...@@ -803,7 +803,8 @@ gtk_text_layout_draw (GtkTextLayout *layout,
&line_start, &line_start,
line, 0); line, 0);
line_end = line_start; line_end = line_start;
gtk_text_iter_forward_to_line_end (&line_end); if (!gtk_text_iter_ends_line (&line_end))
gtk_text_iter_forward_to_line_end (&line_end);
byte_count = gtk_text_iter_get_line_index (&line_end); byte_count = gtk_text_iter_get_line_index (&line_end);
if (gtk_text_iter_compare (&selection_start, &line_end) <= 0 && if (gtk_text_iter_compare (&selection_start, &line_end) <= 0 &&
...@@ -817,7 +818,7 @@ gtk_text_layout_draw (GtkTextLayout *layout, ...@@ -817,7 +818,7 @@ gtk_text_layout_draw (GtkTextLayout *layout,
if (gtk_text_iter_compare (&selection_end, &line_end) <= 0) if (gtk_text_iter_compare (&selection_end, &line_end) <= 0)
selection_end_index = gtk_text_iter_get_line_index (&selection_end); selection_end_index = gtk_text_iter_get_line_index (&selection_end);
else else
selection_end_index = byte_count; selection_end_index = MAX(byte_count, 1);
} }
} }
......
...@@ -6191,9 +6191,12 @@ gtk_text_view_preedit_changed_handler (GtkIMContext *context, ...@@ -6191,9 +6191,12 @@ gtk_text_view_preedit_changed_handler (GtkIMContext *context,
gtk_im_context_get_preedit_string (context, &str, &attrs, &cursor_pos); gtk_im_context_get_preedit_string (context, &str, &attrs, &cursor_pos);
gtk_text_layout_set_preedit_string (text_view->layout, str, attrs, cursor_pos); gtk_text_layout_set_preedit_string (text_view->layout, str, attrs, cursor_pos);
pango_attr_list_unref (attrs); pango_attr_list_unref (attrs);
g_free (str); g_free (str);
gtk_text_view_scroll_mark_onscreen (text_view,
gtk_text_buffer_get_mark (get_buffer (text_view),
"insert"));
} }
static gboolean static gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment