-
Notifications
You must be signed in to change notification settings - Fork 390
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
Disregard contents of "comment" environment #2882
Comments
After looking at this a little more, this issue isn't just about sections; vimtex fails to ignore the contents of the comment environment in other cases, too. My preference would be for the contents of comments to be completely ignored, i.e. treated as just text for all purposes. I hope it wouldn't be too difficult to solve these issues together; otherwise I apologize for bringing up so many things at once! Here are the issues I've found. I'm sure there are others.
|
Interesting issue. I believe some of these fixes can be quite straightforward, but not all of them. It would be helpful if you could update your list in your original post with all of the issues you've noticed; perhaps you could also make it a check list with |
I believe I've solved the folding and toc issues now; please update and test. So, the motions remain; I believe these may be more tricky. But I'll have a look when I get the time. |
Thanks a lot for the quick fixes! There's still a minor issue with folding (noted below) but the TOC seems to be solved. Below are the issues that I've been able to find. Personally, the fixes that I'd appreciate the most are those for the
Examples:
|
This removes folding of multiline comments. I may add it back later if requested by users. refer: #2882
I'm having a hard time fixing this without changing the way to match comments entirely. I'm pushing a PR for this because I want some help testing if it causes significantly slower fold performance. Could you pull the branch and test? See #2884. |
Reg. #2884; I believe it should fix your folding issue. However, as I wrote, I'm using a different method now. It would be very nice if you could test it on some large documents and report if you find it has a negative performance impact. |
I'm considering to close this due to lack of activity. I'll close it, but feel free to reopen if you want to follow things up. |
Notice, though, that I did create a PR (#2884) that is not merged since I was expecting feedback. If these things are now of no interest to you (or others), then I might close the PR as not so relevant to anyone. |
Issue
Vimtex currently treats
\section{...}
,\subsection{...}
, and\subsubsection{..}
commands inside thecomment
environment as if they were real sections in at least these ways (I may have missed others):vimtex-toc
).[[
,]]
,[]
, and][
in normal mode.aP
andiP
text objects.To reproduce, open the following with vim:
with .vimrc
Proposed Solution
I think that it would be better to disregard commented (sub)section commands, since they are not part of the structure of the document. That would mean:
vimtex-toc
, and don't affect the (sub)section count.[[
,]]
,[]
, and][
skips over them.iP
andaP
skips over them.Personally, I like the ability to comment out entire sections, and this would help me do that without messing up document navigation.
By the way, thanks for all your work on vimtex, it's much appreciated!
Edit: For clarity, and I've also added some more features that are affected by this.
The text was updated successfully, but these errors were encountered: