neovim icon indicating copy to clipboard operation
neovim copied to clipboard

Concealed text causes line to wrap before window width

Open tbrugere opened this issue 3 years ago • 7 comments

  • nvim --version
NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation:
Compiled by _nixbld2

Features: +acl +iconv +tui
  • OS: Macos X Catalina v10.15.7
  • Terminal emulator: iterm2
  • $TERM: xterm-256color

Actually this issue is already marked wontfix in vim (https://github.com/vim/vim/issues/260), but I was wondering if it was possible to fix it in nvim…

Steps to reproduce using nvim -u NORC

nvim -u NORC
reduce the window to a small width (like 80)
write "The quick fox jumps over the lazy dog." 2 or 3 times
:setlocal conceallevel=3
:syn match Foo /brown/ conceal

Actual behaviour

The line is cut before the end of the window, as shown in picture Screen Shot 2021-04-20 at 5 09 38 PM

Expected behaviour

I would expect line wrapping to be aware of conceal and wrap at the end of the window

tbrugere avatar Apr 20 '21 15:04 tbrugere

https://github.com/vim/vim/issues/260

chrisbra avatar Apr 20 '21 15:04 chrisbra

It is very useful when the text is supposed to be concealed in all modes concealcursor=nvic. It is not uncommon for me to view and edit files that are littered with UUIDs that are long enough to throw the layout when used with conceal. Although conceal-Aware layout may affect the performance, it is a common feature of most editors, with Emacs having the best implementation.

tejasvi avatar Jun 11 '21 15:06 tejasvi

This behavior basically renders markdown's URL hiding useless. With vim-markdown, if I have a link with long URL, and set conceallevel=2, I got multiple lines wrapped due to it. See screenshot:

image

image

kflu avatar Aug 25 '21 06:08 kflu

Actually this issue is already marked wontfix in vim (vim/vim#260), but I was wondering if it was possible to fix it in nvim…

Not necessarily planned for conceal, but there is work on a more generalized conceal informally called "anticonceal": https://github.com/neovim/neovim/pull/9496

justinmk avatar Aug 27 '21 12:08 justinmk

Chiming in as another who would greatly appreciate this functionality. I would put it to use in my long form writing setup. Markdown links, notes to self on edits, I see a great many uses for the to conceal multiple wrapped lines of text.

mtwebb avatar Jan 05 '22 02:01 mtwebb

I would like to also vote for an implementation of this feature that conceals long lines of text. This is very important for long form writing setup. There is no reason why Neovim should restrict itself as tool for writing code when it is great for writing text of all forms including notes to self, technical writing, blogs, etc.

This is the one feature that gets on the way when working with markup text. Sometimes I will open such texts in Emacs just for readability purposes.

gzagatti avatar Aug 15 '22 03:08 gzagatti

Just another vote for implementing this feature. I recently switched back to Neovim after trying out Emacs for a few months. Overall, I couldn't be happier with Neovim, but I still find myself using Emacs for Markdown and Org files most of the time. Being able to conceal links and still have properly wrapped lines is a huge advantage: you rarely need to bother with a separate document viewer.

tusktenon avatar Sep 10 '22 17:09 tusktenon