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

iftoggle indenting #2450

Closed
alkim0 opened this issue Aug 3, 2022 · 4 comments
Closed

iftoggle indenting #2450

alkim0 opened this issue Aug 3, 2022 · 4 comments
Labels

Comments

@alkim0
Copy link

alkim0 commented Aug 3, 2022

Description

The iftoggle comment is not indenting properly. It indents twice instead of once as expected.

Steps to reproduce

\iftoggle{paper}{}{%
    Line
  }%

Here, Line is indented twice (4 spaces) instead of 2 spaces. It also messes up every subsequent line with an extra indent.

Expected behavior

Please update g:vimtex_indent_conditionals to have:

'open': '\v%(\\newif)@<!\\if%(f>|field|name|numequal|thenelse|toggle)@!',

Actual behavior

If updated in vimrc, it works as expected.

Do you use a latexmkrc file?

no

VimtexInfo

System info:
  OS: Arch Linux
  Vim version: VIM 9.0 ()
  Has clientserver: true
  Servername: undefined (vim started without --servername)

VimTeX project: main
  base: main.tex
  root: /dir
  tex: /dir/main.tex
  main parser: texroot specifier
  document class: vldb
  packages: algorithm algorithmicx algpseudocode aliasctr amsbsy amsfonts amsgen amsmath amsopn amssymb amstext amsthm atbegshi atbegshi-ltx atveryend atveryend-ltx auxhook balance bigintcalc bitset calc caption caption3 datetime datetime-defaults enumitem epsfig epstopdf-base etexcmds etoolbox fcnumparser fcprefix float fmtcount geometry gettitlestring graphics graphicx grffile hycolor hyperref ifmtarg iftex ifthen ifvtex infwarerr intcalc keyval kvdefinekeys kvoptions kvsetkeys latexsym letltxmacro ltxcmds mathtools mhsetup multicol multirow nameref parseargs pdfescape pdftexcmds refcount rerunfilecheck silence subcaption thm-amsthm thm-autoref thm-kv thm-listof thm-patch thm-restate thmtools trig ulem uniquecounter url xcolor xifthen xkeyval xspace
  source files:
    main.tex
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
  viewer: Zathura
    xwin id: 0
  qf method: LaTeX logfile

P.S. Thanks for the awesome plugin!

@alkim0 alkim0 added the bug label Aug 3, 2022
lervag added a commit that referenced this issue Aug 4, 2022
@lervag
Copy link
Owner

lervag commented Aug 4, 2022

Thanks! I've implemented your suggestion, please verify that it works.

@lervag
Copy link
Owner

lervag commented Aug 4, 2022

P.S. Thanks for the awesome plugin!

<3

@alkim0
Copy link
Author

alkim0 commented Aug 4, 2022

Work great!

Might I suggest also updating doc/vimtex.txt to the new version?

@alkim0 alkim0 closed this as completed Aug 4, 2022
@lervag
Copy link
Owner

lervag commented Aug 5, 2022

Great; and thanks, I forgot that. Updating docs asap.

lervag added a commit that referenced this issue Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants