Bram,
Unfortunately, I introduced a regression with this fix. On line 177
in man.vim, we're using "set nonu fdc=0" before we invoke the action in
the "open_cmd" variable. This means we're modifying the settings in
the initial window, before moving to the man page window.
The patch below will fix this regression, and it includes a test that
currently fails.
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index fb3f7f90a..4591c478d 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -174,7 +174,6 @@ func <SID>GetPage(cmdmods, ...)
else
let open_cmd = a:cmdmods . ' split'
endif
- setl nonu fdc=0
endif
endif
@@ -183,7 +182,7 @@ func <SID>GetPage(cmdmods, ...)
" Avoid warning for editing the dummy file twice
setl buftype=nofile noswapfile
- setl ma nonu nornu nofen
+ setl fdc=0 ma nofen nonu nornu
silent exec "norm! 1GdG"
let unsetwidth = 0
if empty($MANWIDTH)
diff --git a/src/testdir/test_man.vim b/src/testdir/test_man.vim
index b1cb982a1..9de8cb474 100644
--- a/src/testdir/test_man.vim
+++ b/src/testdir/test_man.vim
@@ -1,6 +1,6 @@
runtime ftplugin/man.vim
-function Test_g_ft_man_open_mode()
+func Test_g_ft_man_open_mode()
vnew
let l:h = winheight(1)
q
@@ -48,9 +48,9 @@ function Test_g_ft_man_open_mode()
q
unlet g:ft_man_open_mode
-endfunction
+endfunc
-function Test_nomodifiable()
+func Test_nomodifiable()
let wincnt = winnr('$')
Man vim
if wincnt == winnr('$')
@@ -59,9 +59,9 @@ function Test_nomodifiable()
endif
call assert_false(&l:modifiable)
q
-endfunction
+endfunc
-function Test_buffer_count_hidden()
+func Test_buffer_count_hidden()
%bw!
set hidden
@@ -85,4 +85,29 @@ function Test_buffer_count_hidden()
q
set hidden&
-endfunction
+endfunc
+
+" Check that we do not alter the settings in the initial window.
+func Test_local_options()
+ %bw!
+ set foldcolumn=1 number
+
+ let wincnt = winnr('$')
+ Man vim
+ if wincnt == winnr('$')
+ " Vim manual page cannot be found.
+ return
+ endif
+
+ " man page
+ call assert_false(&nu)
+ call assert_equal(0, &fdc)
+
+ " initial window
+ wincmd p
+ call assert_true(&nu)
+ call assert_equal(1, &fdc)
+
+ %bw!
+ set foldcolumn& number&
+endfunc
Sorry for the inconvenience!
Thanks,
Jason Franklin
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/a1eb20a8-84ed-4e04-8f63-9aefe2e1a601%40googlegroups.com.