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

Including python syntax sets conceillevel (bad interaction with LaTeX buffers) #440

Open
Rmano opened this issue Jul 20, 2015 · 6 comments

Comments

@Rmano
Copy link

Rmano commented Jul 20, 2015

Hi ---
I have installed jedi-vim and I find it really nice to edit python files. But I came across a problem that I am unable to solve --- it makes editing of LaTeX files much more complex. The problem is the following. I have in my .vimrc:

Plug 'davidhalter/jedi-vim'
    autocmd FileType python setlocal completeopt-=preview 

And when I edit a LaTeX file, the $...$ marks that define an inline math disappears unless the line is under the cursor. See:

Case 1, cursor in different line of the math formula (the cursor does not appear on screenshot, but believe me...)

selection_036

Case 2, few instant after, cursor in the same line:

selection_037

This make LaTeX files almost impossible to edit. Is there a way to restrict all of the jedi-vim effects to python buffers?

PD I checked that commenting out the plugin will remove the problem.

@Rmano
Copy link
Author

Rmano commented Jul 20, 2015

The problem (see http://vi.stackexchange.com/questions/3999/jedi-vim-and-vim-latex-buffers-problems ) seems to be that --- I do not know why --- the set conceallevel=2 get triggered for LaTeX buffers. Adding

autocmd FileType tex set concealleval=0 

fixes the issue. Still, I am quite confused --- maybe a strange interaction with my .vimrc? Puzzled.

@Rmano Rmano closed this as completed Jul 20, 2015
@blueyed
Copy link
Collaborator

blueyed commented Jul 20, 2015

I am re-opening the issue. There's likely something that jedi-vim could do better for this case, see http://vi.stackexchange.com/questions/3999/jedi-vim-and-vim-latex-buffers-problems#comment5775_4001 and the other comments.

@blueyed blueyed reopened this Jul 20, 2015
@blueyed blueyed changed the title Strange (bad) interaction with LaTeX buffers Including python syntax sets conceillevel (bad interaction with LaTeX buffers) Jul 20, 2015
@Rmano
Copy link
Author

Rmano commented Jul 20, 2015

I am not sure, but I think that the problem is (could be) that vimtex loads the syntax file for sub-syntax formatting (as in listing environments containing python code). See around line 66 in https://github.com/lervag/vimtex/blob/master/after/syntax/tex.vim

Probably the only solution is that the set conceallevel should be done in another place, not in the syntax definition file --- but do not trust me, I am a newbie in this.

@blueyed
Copy link
Collaborator

blueyed commented Jul 20, 2015

Probably the only solution is that the set conceallevel should be done in another place

Yeah, that's what I'd say, too - probably in the the filetype plugin instead.

It's tied to setting the conceil syntax, and maybe could be done when setting up / tearing down the call signatures.

@davidhalter
Copy link
Owner

It's tied to setting the conceil syntax, and maybe could be done when setting up / tearing down the call signatures.

True. However, I'm not sure if it's necessary.

@blueyed
Copy link
Collaborator

blueyed commented Jan 8, 2017

There is better support for setting up call signatures in #652, e.g. not setting conceallevel at all when using another mode than 1.

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

No branches or pull requests

3 participants