lervag / wiki-ft.vim

Simple Vim filetype plugin for wiki-files
MIT License
14 stars 5 forks source link

Conceal of wiki links results in long chunks of empty space #12

Closed arisolt closed 1 year ago

arisolt commented 1 year ago

In the following example:

This is a [[/path/to/file|link]].

When toggling set conceallevel=2, the result is:

This is a                 link.

What is notable is that the ]] after link is concealed correctly (i.e it disappears and the fullstop shifts position). However, the portion before link is replaced by a long chunk of space. Why is this happening? Could it be because of something in my environment, or is it expected behaviour?

lervag commented 1 year ago

That's very strange. On my end, the conceal works as expected. It would be very helpful if you created a minimal example vimrc file, something like this:

set nocompatible
set runtimepath^=~/.local/plugged/wiki.vim
set runtimepath^=~/.local/plugged/wiki-ft.vim
filetype plugin indent on
syntax enable

set conceallevel=2
let g:wiki_root = "..."
" ... other relevant options

If you save the above listing to test.vim and run vim -u test.vim or nvim --clean -u test.vim (if you use neovim), then you should have a minimal environment. You can open a wiki file and test if the issue persists.

arisolt commented 1 year ago

Hmm yes, with a minimal .vimrc it does conceal correctly. I'll need to dig into my configured environment and see what's causing it. Thanks!

arisolt commented 1 year ago

Ok, it looks like what I was experiencing is actually another issue related to vim's poor implementation of soft wrapping: https://github.com/vim/vim/issues/260#issuecomment-905219351

lervag commented 1 year ago

That does make sense. I am aware of issues with soft wrapping and conceals, but I've never seen this issue lead to the empty space in front; also, I've never had an issue unless the line is actually long enough for there to be soft wrapping.