]> granicus.if.org Git - vim/commitdiff
patch 8.2.2818: no jump added when opening terminal in current window v8.2.2818
authorBram Moolenaar <Bram@vim.org>
Thu, 29 Apr 2021 18:18:45 +0000 (20:18 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 29 Apr 2021 18:18:45 +0000 (20:18 +0200)
Problem:    No jump added to jumplist when opening terminal in current window.
Solution:   Call setpcmark(). (closes #8158)

src/terminal.c
src/testdir/test_terminal.vim
src/version.c

index 6f07055ebc11efbad20fd7ad374556b9f76102d8..ce9f64be19c648a0aad0cab71c29307a59a0afb4 100644 (file)
@@ -473,6 +473,7 @@ term_start(
     ga_init2(&term->tl_scrollback_postponed, sizeof(sb_line_T), 300);
     ga_init2(&term->tl_osc_buf, sizeof(char), 300);
 
+    setpcmark();
     CLEAR_FIELD(split_ea);
     if (opt->jo_curwin)
     {
index 6ea90b2410f81e7ac19dd456f0a3db9481d8aabf..3944294e3c59aba6efd96f0ca3eab9c25031675e 100644 (file)
@@ -2029,5 +2029,12 @@ func Test_terminal_nested_autocmd()
   augroup END
 endfunc
 
+func Test_terminal_adds_jump()
+  clearjumps
+  call term_start("ls", #{curwin: 1})
+  call assert_equal(1, getjumplist()[0]->len())
+  bwipe!
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab
index 0158d89470909e500c4de7caeb3355ba0d6ac8d5..f1d55324d52dbf7ee8a4e45ffbde60029d98874b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2818,
 /**/
     2817,
 /**/