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

Buggy interaction of g:vimtex_quickfix_autoclose_after_keystrokes with command-line window. #2637

Closed
Aster89 opened this issue Feb 19, 2023 · 4 comments
Labels

Comments

@Aster89
Copy link
Contributor

Aster89 commented Feb 19, 2023

Description

When g:vimtex_quickfix_autoclose_after_keystrokes > 0, say n, moving the cursor n times in the command-line window causes an error.

Steps to reproduce

  1. Ensure let g:vimtex_quickfix_autoclose_after_keystrokes > 0, say n
  2. Open the quickfix window (even without compiling, technically, but you do need a log to make it open).
  3. Open the command line window (via q:, q/ or whatever)
  4. Move the cursor n times, and you'll see an error
  5. Dismiss the error and move the cursor again n times, and you'll see the error again.

Expected behavior

VimTeX's quickfix closing normally upon n cursor movements.

Actual behavior

Every

Error detected while processing CursorMoved Autocommands for "*"..function <SNR>56_qf_autoclose_check:
line   19:
E11: Invalid in command-line window; :q<CR> closes the window:     cclose

Do you use a latexmkrc file?

Yes, but I'm pretty sure it's irrelevant

VimtexInfo

System info:
  OS: Arch Linux
  Vim version: VIM 9.0 (1-1302)
  Has clientserver: true
  Servername: VIM2

VimTeX project: main
  base: main.tex
  root: /home/enrico/deleteme
  tex: /home/enrico/deleteme/main.tex
  main parser: current file verified
  document class: book
  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
@Aster89 Aster89 added the bug label Feb 19, 2023
@lervag
Copy link
Owner

lervag commented Feb 20, 2023

The issue with the :VimtexInfo was a peculiarity (#2638), but I don't really think it was a "real" issue. That is, doing q::VimtexInfo should never be part of a real workflow. However, I can see how this issue is real and I think it should be possible to adjust the function that causes this issue to not count movements within the command-line window. I'll look into it when I get the time!

Btw, :VimtexInfo still works as expected and the point of adding the info is to give me context such as OS, Vim version, etc. I've added the info from #2638 now as I think it must be safe to assume you are on the same system still. :)

@Aster89
Copy link
Contributor Author

Aster89 commented Feb 20, 2023

That is, doing q::VimtexInfo should never be part of a real workflow.

Why is that? I guess that claim is specific to VimtexInfo or to a category of : commands that have something in common, in which case, what is this thing in common?

Because you certainly can't refer to any q::any-command, because a very legit case of it is when some-command is the substitution command, e.g. one can do q:, then maybe a few ks to go to some line in the history, and then :s/pattern/subst/ to edit it.

@lervag
Copy link
Owner

lervag commented Feb 21, 2023

I guess that claim is specific to VimtexInfo or to a category of : commands that have something in common, in which case, what is this thing in common?

Yes, I mean that :VimtexInfo specifically after q: is unnecessary. I regularly use the command-line window myself, and it is clearly a useful feature. I can see how substitutes with :s can be useful there, although I usually only use the command-line window to navigate history and make fast adjustments with normal-mode editing.

If you want to execute :VimtexInfo, you either use q: to find it in history and execute it, or you just execute it normally without the command-line window.

The "common thing" here is explained in :help E11:

							*E11* *E1188*
The command-line window is not a normal window.  It is not possible to move to
another window or edit another buffer.  All commands that would do this are
disabled in the command-line window.  Of course it _is_ possible to execute
any command that you entered in the command-line window.  Other text edits are
discarded when closing the window.

@lervag
Copy link
Owner

lervag commented Feb 21, 2023

There, I think this is resolved now.

@lervag lervag closed this as completed Feb 21, 2023
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