diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-10-12 21:50:33 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-10-12 21:52:33 -0400 |
commit | 3736f14896c053bcd72a6fe0469b86f86dc28d1a (patch) | |
tree | 5641d3bf8aefe0b350f7617b020d497d16c104fe | |
parent | f4e2df4527be36a630713fdaad92dd5d3e87756e (diff) | |
download | rneovim-3736f14896c053bcd72a6fe0469b86f86dc28d1a.tar.gz rneovim-3736f14896c053bcd72a6fe0469b86f86dc28d1a.tar.bz2 rneovim-3736f14896c053bcd72a6fe0469b86f86dc28d1a.zip |
vim-patch:8.0.1547: undo in the options window makes it empty
Problem: Undo in the options window makes it empty.
Solution: Set 'undolevels' while filling the buffer. (Yasuhiro Matthew,
closes vim/vim#2645)
https://github.com/vim/vim/commit/9c474b277336235012f0c058bbaef2961d1ec83e
-rw-r--r-- | runtime/optwin.vim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 64c1d9cfb3..c081b3a6b3 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2017 Oct 19 +" Last Change: 2018 Feb 27 " If there already is an option window, jump to that one. let buf = bufnr('option-window') @@ -122,11 +122,13 @@ fun! <SID>Update(lnum, line, local, thiswin) endfun " Reset 'title' and 'icon' to make it work faster. +" Reset 'undolevels' to avoid undo'ing until the buffer is empty. let s:old_title = &title let s:old_icon = &icon let s:old_sc = &sc let s:old_ru = &ru -set notitle noicon nosc noru +let s:old_ul = &ul +set notitle noicon nosc noru ul=-1 " If the current window is a help window, try finding a non-help window. " Relies on syntax highlighting to be switched on. @@ -714,7 +716,7 @@ call <SID>OptionG("km", &km) call <SID>Header("editing text") call append("$", "undolevels\tmaximum number of changes that can be undone") call append("$", "\t(global or local to buffer)") -call append("$", " \tset ul=" . &ul) +call append("$", " \tset ul=" . s:old_ul) call append("$", "undofile\tautomatically save and restore undo history") call <SID>BinOptionG("udf", &udf) call append("$", "undodir\tlist of directories for undo files") @@ -1319,6 +1321,7 @@ let &icon = s:old_icon let &ru = s:old_ru let &sc = s:old_sc let &cpo = s:cpo_save -unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum +let &ul = s:old_ul +unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum s:old_ul " vim: ts=8 sw=2 sts=2 |