# HG changeset patch # User Christian Brabandt # Date 1519748106 -3600 # Node ID 4dbf2a6972e6c5620d1a84e30ff76fad7e918d0d # Parent 52a3e42498e731cf6bbbbd873ddb7d86f3341658 patch 8.0.1547: undo in the options window makes it empty commit https://github.com/vim/vim/commit/9c474b277336235012f0c058bbaef2961d1ec83e Author: Bram Moolenaar Date: Tue Feb 27 17:04:25 2018 +0100 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 #2645) diff --git a/runtime/optwin.vim b/runtime/optwin.vim --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -1,7 +1,7 @@ " These commands create the option window. " " Maintainer: Bram Moolenaar -" Last Change: 2018 Feb 11 +" 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! Update(lnum, line, local, this 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. @@ -756,7 +758,7 @@ call OptionG("km", &km) call 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 BinOptionG("udf", &udf) call append("$", "undodir\tlist of directories for undo files") @@ -1438,6 +1440,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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -779,6 +779,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1547, +/**/ 1546, /**/ 1545,