Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:options コマンドで生成されるバッファが空になるまで undo 出来る #1150

Closed
mattn opened this issue Feb 14, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@mattn
Copy link
Member

commented Feb 14, 2018

オプションの値をトグルしたり変更したり出来るのはいいけど、空になるまで undo 出来てしまう。

diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index a417295fd..57d94f071 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -126,7 +126,8 @@ 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 +757,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")
@@ -1436,6 +1437,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
@k-takata

This comment has been minimized.

Copy link
Member

commented Feb 14, 2018

link: vim/vim#2645

@ichizok

This comment has been minimized.

Copy link
Member

commented Mar 9, 2018

8.0.1547
vim/vim@9c474b2

@ichizok ichizok closed this Mar 9, 2018

@k-takata k-takata added the xlose/fixed label Mar 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.