To: vim_dev@googlegroups.com Subject: Patch 7.4.1545 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1545 Problem: GTK3: horizontal cursor movement in Visual selection not good. Solution: Make it work better. (Kazunobu Kuriyama) Files: src/gui_gtk_x11.c *** ../vim-7.4.1544/src/gui_gtk_x11.c 2016-03-12 12:40:54.219242159 +0100 --- src/gui_gtk_x11.c 2016-03-12 16:26:38.178686190 +0100 *************** *** 650,656 **** { unsigned int cond = 0; cond |= gui_gtk_is_blink_on(); ! cond |= is_key_pressed; cond |= gui.in_focus == FALSE; return cond; } --- 650,657 ---- { unsigned int cond = 0; cond |= gui_gtk_is_blink_on(); ! if (gui.cursor_col >= gui.col) ! cond |= is_key_pressed; cond |= gui.in_focus == FALSE; return cond; } *************** *** 686,702 **** if (blink_mode) gui_gtk3_redraw(rect.x, rect.y, rect.width, rect.height); else ! gui_redraw(rect.x, rect.y, rect.width, rect.height); } } cairo_rectangle_list_destroy(list); cairo_paint(cr); } gui.by_signal = FALSE; /* Add the cursor to the window if necessary.*/ ! if (gui_gtk3_should_draw_cursor()) gui_gtk3_update_cursor(cr); return FALSE; --- 687,715 ---- if (blink_mode) gui_gtk3_redraw(rect.x, rect.y, rect.width, rect.height); else ! { ! if (get_real_state() & VISUAL) ! gui_gtk3_redraw(rect.x, rect.y, ! rect.width, rect.height); ! else ! gui_redraw(rect.x, rect.y, rect.width, rect.height); ! } } } cairo_rectangle_list_destroy(list); + if (get_real_state() & VISUAL) + { + if (gui.cursor_row == gui.row && gui.cursor_col >= gui.col) + gui_update_cursor(TRUE, TRUE); + } + cairo_paint(cr); } gui.by_signal = FALSE; /* Add the cursor to the window if necessary.*/ ! if (gui_gtk3_should_draw_cursor() && blink_mode) gui_gtk3_update_cursor(cr); return FALSE; *** ../vim-7.4.1544/src/version.c 2016-03-12 15:58:30.024231519 +0100 --- src/version.c 2016-03-12 16:26:28.466787133 +0100 *************** *** 745,746 **** --- 745,748 ---- { /* Add new patch number below this line */ + /**/ + 1545, /**/ -- The History of every major Galactic Civilization tends to pass through three distinct and recognizable phases, those of Survival, Inquiry and Sophistication, otherwise known as the How, Why and Where phases. For instance, the first phase is characterized by the question 'How can we eat?' the second by the question 'Why do we eat?' and the third by the question 'Where shall we have lunch?' -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///