Skip to content

Operating on text objects does not work when the cursor is outside of them #3219

@olhau

Description

@olhau

Description

It is possible to act on Vim builtin text objects from outside of them: if the cursor is not in the text object, a search for the next one will be performed and the operation will be run from there. With vimtex text objects this is not possible as far as I can see. Is this the intended behaviour?

Steps to reproduce

minimal.tex:

\documentclass{minimal}
\begin{document}
Hello world! $(x)$
\end{document}
  1. cd /PATH/TO/vimtex/test/example-minimal
  2. nvim --clean -u minivimrc
  3. Open the file minimal.tex above
  4. With the cursor on H, type da$ in normal mode

Expected behavior

The block $(x)$ gets deleted and the cursor moves to its place. If I type da( in the same situation, then (x) gets deleted and the cursor moves to the second $.

Actual behavior

Nothing happens.

Do you use a latexmkrc file?

No

VimtexInfo

System info:
  OS: Gentoo Linux
  LaTeX version: pdfTeX 3.141592653-2.6-1.40.26 (TeX Live 2024 Gentoo Linux)
  Vim version: NVIM v0.11.4
  Has clientserver: true
  Servername: /run/user/1000/nvim.7779.0
  $PATH:
    - /opt/bin
    - /usr/bin
    - /usr/lib/llvm/19/bin
    - /usr/lib/llvm/20/bin
    - /usr/local/bin
    - /usr/local/sbin

VimTeX project: main
  base: main.tex
  root: /home/olivier/.local/share/nvim/lazy/vimtex/test/example-minimal
  tex: /home/olivier/.local/share/nvim/lazy/vimtex/test/example-minimal/main.tex
  main parser: current file verified
  document class: minimal
  document class options: 
  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