vim --clean
ia<CR><Tab>b<Esc>
zc
, zo
→ nothing happens, apparently can't fold/unfold one lineset foldcolumn=4
o<Tab>c<Esc>
a
b
c
zc
, zo
→ fold closes and opensdd
zc
, zo
→ one-line fold now closes and opens!I would expect that either (1) you can always open and close one-line folds, or (2) you can never open and close one-line folds.
Latest, built from source.
macOS 12
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I cannot reproduce with neither 8.2.4969 on linux or windows (gvim)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
This reproduces for me on Linux, and also reproduces in Neovim. Here is a GIF of it happening in the following Linux env:
root@scratch:~# vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741
Modified by team...@tracker.debian.org
Compiled by team...@tracker.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt -tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
-autoservername +folding +multi_lang +terminfo
-balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
-browse +gettext +num64 +textprop
++builtin_terms -hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand -perl -toolbar
+cindent +job +persistent_undo +user_commands
-clientserver +jumplist +postscript +vartabs
-clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall +python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap -ruby +wildmenu
+cursorbind -lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con +mksession +smartindent -X11
+diff +modify_fname +sound -xfontset
+digraphs +mouse +spell -xim
-dnd -mouseshape +startuptime -xpm
-ebcdic +mouse_dec +statusline -xsmp
+emacs_tags +mouse_gpm -sun_workshop -xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -Wdate-time -g -O2 -fdebug-prefix-map=/build/vim-9EpYYi/vim-8.1.2269=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lcanberra -lacl -lattr -lgpm -ldl -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm
root@scratch:~# uname -a
Linux scratch 5.4.0-97-generic #110-Ubuntu SMP Thu Jan 13 18:22:13 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@scratch:~#
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Very sorry, I forgot a repro step: :set foldmethod=indent
. The original issue has been updated. @chrisbra
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Hm, I think partially what you see can be explained by :h 'foldminlines' Also please note the following section (which I am not sure I understand completely but it may explain what you notice):
Set to zero to be able to close folds of just one screen line.
Note that this only has an effect on what is displayed. After using
"zc" to close a fold, which is displayed open because it's smaller
than 'foldminlines', a following "zc" may close a containing fold.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I guess foldminlines
is a related setting, but I would say this screenshot (following my repro steps) demonstrates a bug, demonstrating foldminlines
not being respected.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Hm, I think partially what you see can be explained by :h 'foldminlines' Also please note the following section (which I am not sure I understand completely but it may explain what you notice):
Set to zero to be able to close folds of just one screen line. Note that this only has an effect on what is displayed. After using "zc" to close a fold, which is displayed open because it's smaller than 'foldminlines', a following "zc" may close a containing fold.
This means that the commands you type, like "zc", still do their action on the small fold even if it doesn't visually look like it happened. For example, if you had a one line fold nested within a, say, 5 line fold, and all the folds were open, then if you put your cursor on the one line fold and press "zc", then the fold would "close" even though nothing would change on your screen. Then hitting "zc" again would close the big outer fold and you'd see the lines fold on your screen.
The bug was that the opposite would actually happen -- that when you close a small (less than foldminlines) fold after a deletion, it would actually fold on your screen, meaning that foldminlines didn't do its job.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I can confirm that this is fixed after #10457.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #10436 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.