Skip to content

Conditional auto-indent not working as expected #2754

@rhelder

Description

@rhelder

Description

Hello,

Conditional auto-indent isn't working as expected for me anymore.

Thanks for your help!

Steps to reproduce

  1. Here is my minimal example:

    \documentclass{minimal}
    
    \newif\ifmytest
    
    \begin{document}
    
    \ifmytest
    True
    \else
    False
    \fi
    
    \end{document}
  2. Here is my minimal vimrc:

    call plug#begin('~/.config/nvim/vim-plug')
         Plug 'lervag/vimtex'
    call plug#end()

(Since I'm using vim-plug, syntax enable and filetype plugin indent on are automatically executed).

Expected behavior

I would expect 'True' and 'False' to be automatically indented as I am typing. Or, if for some reason they are not already automatically indented correctly, I would expect them to be correctly indented if I navigate to the line and type ==.

Actual behavior

As it is, the text does not automatically indent, either while I'm typing or if I use the = command.

I can confirm that g:vimtex_indent_enabled is set to 1, and that g:vimtex_indent_conditionals is set to the default. I use Neovim, so autoindent is set to 'on' by default, but turning off autoindent makes no difference.

Do you use a latexmkrc file?

Yes

VimtexInfo

System info:
  OS: macOS 13.4.1 (22F82)
  Vim version: NVIM v0.9.1
  Has clientserver: true
  Servername: /var/folders/rb/582tp6vs2z56ry48r0qg06d40000gn/T/nvim.rhelder/hM8Y0e/nvim.50359.0

VimTeX project: minimal
  base: minimal.tex
  root: /Users/rhelder/minimal
  tex: /Users/rhelder/minimal/minimal.tex
  main parser: current file verified
  document class: minimal
  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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions