Mercurial > vim
comparison runtime/optwin.vim @ 13346:4dbf2a6972e6 v8.0.1547
patch 8.0.1547: undo in the options window makes it empty
commit https://github.com/vim/vim/commit/9c474b277336235012f0c058bbaef2961d1ec83e
Author: Bram Moolenaar <Bram@vim.org>
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 27 Feb 2018 17:15:06 +0100 |
parents | acd7eaa13d2b |
children | a34b1323286c |
comparison
equal
deleted
inserted
replaced
13345:52a3e42498e7 | 13346:4dbf2a6972e6 |
---|---|
1 " These commands create the option window. | 1 " These commands create the option window. |
2 " | 2 " |
3 " Maintainer: Bram Moolenaar <Bram@vim.org> | 3 " Maintainer: Bram Moolenaar <Bram@vim.org> |
4 " Last Change: 2018 Feb 11 | 4 " Last Change: 2018 Feb 27 |
5 | 5 |
6 " If there already is an option window, jump to that one. | 6 " If there already is an option window, jump to that one. |
7 let buf = bufnr('option-window') | 7 let buf = bufnr('option-window') |
8 if buf >= 0 | 8 if buf >= 0 |
9 let winids = win_findbuf(buf) | 9 let winids = win_findbuf(buf) |
120 endif | 120 endif |
121 set nomodified | 121 set nomodified |
122 endfun | 122 endfun |
123 | 123 |
124 " Reset 'title' and 'icon' to make it work faster. | 124 " Reset 'title' and 'icon' to make it work faster. |
125 " Reset 'undolevels' to avoid undo'ing until the buffer is empty. | |
125 let s:old_title = &title | 126 let s:old_title = &title |
126 let s:old_icon = &icon | 127 let s:old_icon = &icon |
127 let s:old_sc = &sc | 128 let s:old_sc = &sc |
128 let s:old_ru = &ru | 129 let s:old_ru = &ru |
129 set notitle noicon nosc noru | 130 let s:old_ul = &ul |
131 set notitle noicon nosc noru ul=-1 | |
130 | 132 |
131 " If the current window is a help window, try finding a non-help window. | 133 " If the current window is a help window, try finding a non-help window. |
132 " Relies on syntax highlighting to be switched on. | 134 " Relies on syntax highlighting to be switched on. |
133 let s:thiswin = winnr() | 135 let s:thiswin = winnr() |
134 while exists("b:current_syntax") && b:current_syntax == "help" | 136 while exists("b:current_syntax") && b:current_syntax == "help" |
754 | 756 |
755 | 757 |
756 call <SID>Header("editing text") | 758 call <SID>Header("editing text") |
757 call append("$", "undolevels\tmaximum number of changes that can be undone") | 759 call append("$", "undolevels\tmaximum number of changes that can be undone") |
758 call append("$", "\t(global or local to buffer)") | 760 call append("$", "\t(global or local to buffer)") |
759 call append("$", " \tset ul=" . &ul) | 761 call append("$", " \tset ul=" . s:old_ul) |
760 call append("$", "undofile\tautomatically save and restore undo history") | 762 call append("$", "undofile\tautomatically save and restore undo history") |
761 call <SID>BinOptionG("udf", &udf) | 763 call <SID>BinOptionG("udf", &udf) |
762 call append("$", "undodir\tlist of directories for undo files") | 764 call append("$", "undodir\tlist of directories for undo files") |
763 call <SID>OptionG("udir", &udir) | 765 call <SID>OptionG("udir", &udir) |
764 call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload") | 766 call append("$", "undoreload\tmaximum number lines to save for undo on a buffer reload") |
1436 let &title = s:old_title | 1438 let &title = s:old_title |
1437 let &icon = s:old_icon | 1439 let &icon = s:old_icon |
1438 let &ru = s:old_ru | 1440 let &ru = s:old_ru |
1439 let &sc = s:old_sc | 1441 let &sc = s:old_sc |
1440 let &cpo = s:cpo_save | 1442 let &cpo = s:cpo_save |
1441 unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum | 1443 let &ul = s:old_ul |
1444 unlet s:old_title s:old_icon s:old_ru s:old_sc s:cpo_save s:idx s:lnum s:old_ul | |
1442 | 1445 |
1443 " vim: ts=8 sw=2 sts=2 | 1446 " vim: ts=8 sw=2 sts=2 |