lervag / vimtex

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.
MIT License
5.41k stars 388 forks source link

Conceal feature hides but doesn't replace concealed text #2679

Closed AadiWaghray closed 1 year ago

AadiWaghray commented 1 year ago

Description

When using the default conceal features which are enabled by default (and syntax enable and set conceallevel=2 as stated in the documentation), the text in question (_{a}, \omega, ^{a}, etc.) is hidden but not replaced with the appropriate characters. The error is likely a silly mistake on my side, but I have not figured it out and would like to use the conceal feature.

Steps to reproduce

Relevant information init.vim information is given above. Short dot file can be found at https://github.com/AadiWaghray/dotfiles (note that I currently have the feature disabled because it doesn't function). Any LaTeX file with text which should be concealed by default conceal settings should produce error.

Expected behavior

The text in question (_{a}, \omega, ^{a}, etc.) should be replaced with the appropriate super/subscript or greek letter.

Actual behavior

When using the default conceal features (and syntax enable and set conceallevel=2 as stated in the documentation), the text in question (_{a}, \omega, ^{a}, etc.) is hidden but not replaced with the appropriate characters.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: macOS 13.0.1 (22A400)
  Vim version: NVIM v0.8.0-dev-775-g27ce21ac8
  Has clientserver: true
  Servername: /var/folders/pp/r7_p49sx7b94ztpczpwhflmm0000gn/T/nvim.aadiwaghray/FshY7c/nvim.18680.0

VimTeX project: Homework_3
  base: Homework_3.tex
  root: /Users/aadiwaghray/Documents/College_Notes/CS_253/Homework/Homework_3
  tex: /Users/aadiwaghray/Documents/College_Notes/CS_253/Homework/Homework_3/Homework_3.tex
  main parser: current file verified
  document class: report
  packages: algorithm2e amsbsy amsfonts amsgen amsmath amsopn amssymb amstext amsthm array atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook bigintcalc bitset bookmark calc cancel centernot color comment enumitem environ epstopdf-base eso-pic etexcmds etoolbox expl3 geometry gettitlestring graphics graphicx hycolor hyperref ifmtarg ifoddpage iftex ifthen ifvtex import infwarerr inputenc intcalc keyval kvdefinekeys kvoptions kvsetkeys l3keys2e letltxmacro listings listingsutf8 lscape lstlang1 lstmisc ltxcmds mathtools mhsetup multicol nameref newpxmath pdfcol pdfescape pdflscape pdfpages pdftexcmds pgf pgfcomp-version-0-65 pgfcomp-version-1-18 pgfcore pgffor pgfkeys pgfmath pgfrcs pgfsys physics pict2e qtree refcount relsize rerunfilecheck shellesc stringenc tcolorbox textcomp theoremref tikz tikz-cd tikzsymbols titletoc transparent trig trimspaces uniquecounter url varwidth verbatim xcolor xfrac xifthen xkeyval xparse xspace xtemplate
  source files:
    Homework_3.tex
    ../preamble.tex
    ../macros.tex
    ../letterfonts.tex
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: General
  qf method: LaTeX logfile
lervag commented 1 year ago

When using the default conceal features which are enabled by default (and syntax enable and set conceallevel=2 as stated in the documentation), the text in question (_{a}, \omega, ^{a}, etc.) is hidden but not replaced with the appropriate characters. The error is likely a silly mistake on my side, but I have not figured it out and would like to use the conceal feature.

Yes, it seems a silly mistakes (we all make them!):

https://github.com/AadiWaghray/dotfiles/blob/0eee25e2d783d864c565b3e38f4171594941e87f/init.vim#L33

The option you set here disable the conceal feature.

Notice, though, that you shouldn't configure VimTeX by putting config in after/plugin/tex.vim. VimTeX configuration should be specified before VimTeX is loaded, which means you should put it in plugin/tex.vim or in your vimrc or init.vim. This matters for some options, not all, but when it matters it can lead to hard-to-understand problems.

I think the same idea or concept is true for many plugins, and so I would generally advice that you put your plugin configuration in plugin/..., not in after/plugin/....

AadiWaghray commented 1 year ago

Apologies, I poorly explained myself. As I mentioned in the steps to reproduce section, I currently have that setting in place because the mentioned behavior makes it difficult to edit files (superscripts, environment labels, and greek letters are invisible until my cursor is on the relevant line). With that line in place, all of the text which would be concealed is not (it is visible). However, the bad behavior occurs when the line is removed.

Also, thank you for the advice regarding how to organize my files. I will implement it soon.

lervag commented 1 year ago

Apologies, I poorly explained myself. As I mentioned in the steps to reproduce section, I currently have that setting in place because the mentioned behavior makes it difficult to edit files (superscripts, environment labels, and greek letters are invisible until my cursor is on the relevant line). With that line in place, all of the text which would be concealed is not (it is visible). However, the bad behavior occurs when the line is removed.

There's a very good reason for me asking users to provide both 1) minimal examples, and 2) steps to reproduce. The more precise and explicit you are at explaining your issue, the easier it is for me to help you.

Also, thank you for the advice regarding how to organize my files. I will implement it soon.

Good, do that. After you have done that, and if the issue you have still persists: Please create a new issue and provide a minimal example and be more explicit about what you are doing. I'll be glad to help, but I can't help without understanding what is wrong. And I am quite confident that you problem is due to a configuration issue.