To: vim_dev@googlegroups.com Subject: Patch 8.0.1838 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1838 Problem: Cursor in wrong position when switching to Terminal-Normal mode. (Dominique Pelle) Solution: Move to the end of the line if coladvance() fails. Do not take a snapshot a second time. Files: src/terminal.c *** ../vim-8.0.1837/src/terminal.c 2018-05-13 15:15:39.162500689 +0200 --- src/terminal.c 2018-05-13 19:00:46.489723329 +0200 *************** *** 1709,1715 **** curwin->w_cursor.lnum = term->tl_scrollback_scrolled + term->tl_cursor_pos.row + 1; check_cursor(); ! coladvance(term->tl_cursor_pos.col); /* Display the same lines as in the terminal. */ curwin->w_topline = term->tl_scrollback_scrolled + 1; --- 1709,1716 ---- curwin->w_cursor.lnum = term->tl_scrollback_scrolled + term->tl_cursor_pos.row + 1; check_cursor(); ! if (coladvance(term->tl_cursor_pos.col) == FAIL) ! coladvance(MAXCOL); /* Display the same lines as in the terminal. */ curwin->w_topline = term->tl_scrollback_scrolled + 1; *************** *** 2264,2272 **** /* Move a snapshot of the screen contents to the buffer, so that completion * works in other buffers. */ ! if (curbuf->b_term != NULL) ! may_move_terminal_to_buffer( ! curbuf->b_term, curbuf->b_term->tl_normal_mode); return ret; } --- 2265,2272 ---- /* Move a snapshot of the screen contents to the buffer, so that completion * works in other buffers. */ ! if (curbuf->b_term != NULL && !curbuf->b_term->tl_normal_mode) ! may_move_terminal_to_buffer(curbuf->b_term, FALSE); return ret; } *** ../vim-8.0.1837/src/version.c 2018-05-13 18:36:24.137983024 +0200 --- src/version.c 2018-05-13 19:05:32.927988589 +0200 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1838, /**/ -- SIGFUN -- signature too funny (core dumped) /// 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 ///