Bug#868252: vim-nox: pressing <CR> on last line of a foldmethod=manual behaves differently at end of file
Daniel Shahaf
danielsh at apache.org
Thu Jul 13 19:14:03 UTC 2017
Package: vim-nox
Version: 2:8.0.0197-5
Severity: normal
Dear Maintainer,
I use foldmethod=manual. When I want to add a line following the last
line of a fold, I use «A<CR>» if I want the line new to be included in
the fold, and «o» if I want the new line not to be included in the fold.
However, I find that «A<CR>» behaves differently in the following two
cases:
1. The current line is the last line of a fold and of the file
2. The current line is the last line of a fold but not the last line of the file
In case #2, «A<CR>» and «o» behave as I described above.
In case #1, «A<CR>» adds a new line to the file but doesn't make it part
of the fold, i.e., it behaves as «o» does.
I expected «A<CR>» in case #1 to add a new line to the file *and to make
it part of the fold*, as it does in case #2.
Case #1 (the problem case) is:
% vim.nox -Nu NONE -c 'set fdc=2' -c 'normal! zf0' -c 'execute "normal! A\<CR>"'
Case #2 (the role model / reference case) is:
% vim.nox -Nu NONE -c 'set fdc=2' -c 'normal! 2o' -c 'normal! ggzfjzRggj' -c 'execute "normal! A\<CR>"'
To be clear, the incumbent behaviour — adding a line to the file but not
to the fold — should continue to be available under the «o» normal mode
command, for the same reason: consistency with the not-end-of-file case.
I reproduced this in an uptodate sid chroot.
Cheers,
Daniel
-- Package-specific info:
--- real paths of main Vim binaries ---
/usr/bin/vi is /usr/bin/vim.nox
/usr/bin/vim is /usr/bin/vim.nox
-- System Information:
Debian Release: buster/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
Versions of packages vim-nox depends on:
ii libacl1 2.2.52-3+b1
ii libc6 2.24-12
ii libgpm2 1.20.4-6.2+b1
ii liblua5.2-0 5.2.4-1.1+b2
ii libperl5.24 5.24.1-7
ii libpython3.5 3.5.3-3
ii libruby2.3 2.3.3-1
ii libselinux1 2.6-3+b2
ii libtcl8.6 8.6.6+dfsg-1+b1
ii libtinfo5 6.0+20170708-1
ii vim-common 2:8.0.0197-5
ii vim-runtime 2:8.0.0197-5
vim-nox recommends no packages.
Versions of packages vim-nox suggests:
pn cscope <none>
pn vim-doc <none>
-- no debconf information
More information about the pkg-vim-maintainers
mailing list