Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with taglist #40

Open
ktkimit opened this issue Jun 23, 2016 · 29 comments
Open

Conflict with taglist #40

ktkimit opened this issue Jun 23, 2016 · 29 comments

Comments

@ktkimit
Copy link

ktkimit commented Jun 23, 2016

When I use this with "taglist" plugin, there is a problem.

If I open "Tlist" with several files as buffers, and if I move to other buffer by typing "bp", I got sometimes an error message like:


Error detected while processing fuction 30_Tlist_Refresh[93]..30_Tlist_Window_Refresh_File[140]..30_Tlist_Create_Folds_For_File:
line 10:
E350: Cannot create fold with current 'foldmethod'
E350: Cannot create fold with current 'foldmethod'
E350: Cannot create fold with current 'foldmethod'
line 15:
E350: Cannot create fold with current 'foldmethod'


Also, in the Tlist, all the foldings are removed (setting is "foldmethod=syntax").

I will appreciate your comments.

Thank you!

@Konfekt
Copy link
Owner

Konfekt commented Jun 24, 2016

Does it go away by commenting out

    if exists('##OptionSet')
      autocmd OptionSet foldmethod call s:UpdateBuf(0)
    endif

?

@Konfekt
Copy link
Owner

Konfekt commented Jun 24, 2016

By default, master now disables this autocmd. Give it a try please.

@ktkimit
Copy link
Author

ktkimit commented Jun 24, 2016

I re-installed fastfold, but it still does not work.

@Konfekt
Copy link
Owner

Konfekt commented Jun 24, 2016

Do you have foldmethod=syntax in your vimrc? Could you paste all settings of Fastfold and taglist? Which version of taglist is it?

@ktkimit
Copy link
Author

ktkimit commented Jun 24, 2016

I do not give any settings for Fastfold and taglist. The version of taglist is "February 26, 2013: Version 4.6" which is the latest one.

Yes, I have "foldmethod=syntax" in my vimrc.

@Konfekt
Copy link
Owner

Konfekt commented Jun 25, 2016

Ok, so does it go away if the setting is removed? It's hard to pinpoint the conflicting autocmds and after all set foldmethod=global is a bad suggestion as this issue shows. It must be set for each file type.

@Konfekt
Copy link
Owner

Konfekt commented Jun 25, 2016

See, the correct foldmethod for the taglist filetype is that set by taglist, manual, but somehow at some point fastfold uses the global one which is wrong as the filetype must know how to handle it.

@ktkimit
Copy link
Author

ktkimit commented Jun 25, 2016

Which setting do you mean? I have the problem when I have "foldmethod=syntax" in my vimrc.

@Konfekt
Copy link
Owner

Konfekt commented Jun 26, 2016

Yes, supposedly it goes away without. Because at some point the foldmethod is set to syntax and erroneously conserved by FastFold.

@Konfekt
Copy link
Owner

Konfekt commented Jun 26, 2016

And the setting is too coarse. Because many file types do not support syntax folding.

The thing is that fixing it seems impossible through FastFold other than by adding exceptions for Taglist.

Instead, the clean route is explicitely enabling foldmethod syntax for all file types you use.

@Konfekt
Copy link
Owner

Konfekt commented Jul 3, 2016

If setglobal fdm=syntax must be kept, then there is now

let g:fastfold_skip_filetypes = [ 'taglist' ]

to work around this issue.

@ktkimit
Copy link
Author

ktkimit commented Jul 7, 2016

Thanks Konfekt, with the option you gave, it becomes better, but it still sometimes gives the same error ( not many as before).

@Konfekt
Copy link
Owner

Konfekt commented Jul 7, 2016

With the global foldmethod syntax? Better unset it. There's a warning against it in the docs now.

If there is an error, what's the filetype like?

@ktkimit
Copy link
Author

ktkimit commented Jul 12, 2016

In my _vimrc, I have

.....
let g:fastfold_skip_filetypes = [ 'taglist' ]
....
autocmd bufnewfile,bufread .f,.f90 set foldmethod=syntax
....

When I make FORTRAN code, I use taglist with it. What do you mean by the global foldmethod syntax?

@Konfekt
Copy link
Owner

Konfekt commented Jul 13, 2016

Ah, the global foldmethod is that set outside of autocmds.

You should change the autocmd to

autocmd bufnewfile,bufread *.{f,.f90} setlocal foldmethod=syntax

to make sure everything works as intended.

@ktkimit
Copy link
Author

ktkimit commented Jul 15, 2016

It looks like it works!

Thank you Konfekt, you are really helpful~

@Konfekt
Copy link
Owner

Konfekt commented Jul 15, 2016

No problem! Seems the previous erroneous autocmd pattern erroneously set the foldmethod to syntax in the taglist buffers as well.

When asking for a global syntax foldmethod setting, I thought it was for all buffers. Turns out the autocmd pattern was just so that it also set the foldmethod of the taglist buffers.

@Konfekt Konfekt closed this as completed Jul 15, 2016
@ktkimit
Copy link
Author

ktkimit commented Aug 12, 2016

I thought that it solves, but I got the same error again even if I set "autocmd bufnewfile,bufread *.{f,.f90} setlocal foldmethod=syntax"

@Konfekt
Copy link
Owner

Konfekt commented Aug 12, 2016

That should read

autocmd bufnewfile,bufread *.{f,f90} setlocal foldmethod=syntax

That is, f90 instead of .f90. Are you using let g:fastfold_skip_filetypes = [ 'taglist' ] ?

@ktkimit
Copy link
Author

ktkimit commented Aug 15, 2016

I am using the correct setting:

autocmd bufnewfile,bufread *.{f,f90} setlocal foldmethod=syntax

and also using

let g:fastfold_skip_filetypes = [ 'taglist' ]

@Konfekt
Copy link
Owner

Konfekt commented Aug 16, 2016

Can you post the output of :set filetype? when the error appears?

@ktkimit
Copy link
Author

ktkimit commented Aug 17, 2016

When I type it in the taglist's window it says "filetype=taglist", but when I type it in the fortran's window it says "filetype=fortran".

The error appears when I move between such two windows or when I move the other buffers by using "bn" or "bp". Also, foldings disappear in the taglist's window.

@Konfekt
Copy link
Owner

Konfekt commented Aug 17, 2016

Try putting

autocmd bufnewfile,bufread *.{f,f90} setlocal foldmethod=syntax

@Konfekt Konfekt reopened this Aug 17, 2016
@Konfekt
Copy link
Owner

Konfekt commented Aug 17, 2016

Try putting

autocmd bufnewfile,bufread *.{f,f90} setlocal filetype fortran

into a ftdetect/fortran.vim file and

setlocal foldmethod=syntax

into ftplugin/fortran.vim

Instead of the current autocmd. Does that change anything ?

@ktkimit
Copy link
Author

ktkimit commented Aug 19, 2016

There is no such file in ftdetect folder.

I put setlocal foldmethod=syntax into ftplugin/fortran.vim, but there is no change.

@Konfekt
Copy link
Owner

Konfekt commented Aug 19, 2016

Yeah, you should create it if it does not exist. Or does already recognize these file extensions as fortran files ?

@ktkimit
Copy link
Author

ktkimit commented Oct 14, 2016

Sorry for late reply. I think so. It still does not work.

@Konfekt
Copy link
Owner

Konfekt commented Oct 29, 2017

Well, I think in all honesty, I probably won't resolve this. Would you mind updating taglist by

https://github.com/majutsushi/tagbar ?

@Konfekt
Copy link
Owner

Konfekt commented Jun 3, 2018

The file type skipping was broken and has been fixed. If you could try again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants