fmoralesc / vim-pad

a quick notetaking plugin
MIT License
319 stars 22 forks source link

Conceal does not seem to work for the pad list #54

Closed jostber closed 9 years ago

jostber commented 9 years ago

I have python and conceal support in my vim, and vim-pad worked fine with conceal in the previous version. When I upgraded to the recent git version this does not work anymore. In the pad list all entries are shown with the full directory path making them hard to read. I have checked the syntax file, but did not find a clue there. Is there something else I can check here?

fmoralesc commented 9 years ago

Do conceals work if you set conceallevel manually?

 setlocal conceallevel=2
jostber commented 9 years ago

On 21.11.14,07:47, Felipe Morales wrote:

Do conceals work if you set conceallevel manually?

 setlocal conceallevel=2

Hi, thanks. I have tried that, but there is no difference.

fmoralesc commented 9 years ago

The focus was in the Pad buffer, right? It should work, otherwise the most likely scenario is your vim version somehow lacks conceal support (sometimes gvim and console vim differ).

It's weird otherwise, I haven't changed the syntax file for the pad buffer in a while, so nothing should have changed.

jostber commented 9 years ago

On 21.11.14,09:39, Felipe Morales wrote:

The focus was in the Pad buffer, right? It should work, otherwise the most likely scenario is your vim version somehow lacks conceal support (sometimes gvim and console vim differ).

It's weird otherwise, I haven't changed the syntax file for the pad buffer in a while, so nothing should have changed.

Yes, it's in the pad buffer. I will check some more if some old file is hanging around causing this, as I installed vim-pad manually before I started using pathogen.

jostber commented 9 years ago

On 21.11.14,19:45, Jostein Berntsen wrote:

On 21.11.14,09:39, Felipe Morales wrote:

The focus was in the Pad buffer, right? It should work, otherwise the most likely scenario is your vim version somehow lacks conceal support (sometimes gvim and console vim differ).

It's weird otherwise, I haven't changed the syntax file for the pad buffer in a while, so nothing should have changed.

Yes, it's in the pad buffer. I will check some more if some old file is hanging around causing this, as I installed vim-pad manually before I started using pathogen.

I have tried to adjust the syntax file, but for some reason it only works if I start vim-pad with this command:

vim -c ":ListPads" -c ":syn match Conceal /.*@ / conceal" -c ":wincmd w" -c ":q!"

fmoralesc commented 9 years ago

Does the rest of the highlighting work? It should look like this when conceals are inactive:

captura de pantalla de 2014-11-23 13 48 41

jostber commented 9 years ago

On 23.11.14,08:49, Felipe Morales wrote:

Does the rest of the highlighting work? It should look like this when conceals are inactive:

captura de pantalla de 2014-11-23 13 48 41

No, in my view the time and description is white, and the titles are yellow. Would like to have this highlighting work. :)

fmoralesc commented 9 years ago

Hm, it seems the syntax isn't loading properly. Try this: add

 echom "loading vim-pad syntax"

at the beginning of the syntax/pad.vim file and try opening the notes list again. Then, check :messages for the output. BTW, what colorscheme are you using? It might be interferring with vim-pad's highlighting.

jostber commented 9 years ago

On 23.11.14,10:08, Felipe Morales wrote:

Hm, it seems the syntax isn't loading properly. Try this: add

 echom "loading vim-pad syntax"

at the beginning of the syntax/pad.vim file and try opening the notes list again. Then, check :messages for the output. BTW, what colorscheme are you using? It might be interferring with vim-pad's highlighting.

Here is the message:

loading vim-pad syntax

I use the synic.vim colorscheme for dark backgrounds. I have tried other colorschemes(vividchalk,mirodark) as well with the same result.

equalsraf commented 9 years ago

Cheers. I'm seeing the exact same issue in Vim and Neovim.

Moreover :syn lists the expected syntax matches for the pad buffer. But more interesting it works if I remove this line from pad.vim

exe 'syn match PadLocal /'.g:pad#local_dir.'/ containedin=PadFolder'
equalsraf commented 9 years ago

g:pad#local_dir is empty, so that might be the issue. I think there is a warning in the docs for :syn about matching the empty string. So something like this?

if g:pad#local_dir
    exe 'syn match PadLocal /'.g:pad#local_dir.'/ containedin=PadFolder'
endif
fmoralesc commented 9 years ago

Thanks @equalsraf, I think that should do it. I also made it so g:pad#local_dir isn't empty by default (the default is now "notes").

fmoralesc commented 9 years ago

Can you confirm this fixed it, @jostber?

jostber commented 9 years ago

On 06.12.14,06:31, Felipe Morales wrote:

Can you confirm this fixed it, @jostber?

Tested this now, and it seems to work great. Thanks!

Jostein

fmoralesc commented 9 years ago

@jostber I'm glad. Thanks @equalsraf for figuring it out.

I'm closing the issue.