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

Autocompletion triggers after line break (\\) #1414

Closed
Krasjet opened this issue Jun 28, 2019 · 3 comments
Closed

Autocompletion triggers after line break (\\) #1414

Krasjet opened this issue Jun 28, 2019 · 3 comments
Labels

Comments

@Krasjet
Copy link

Krasjet commented Jun 28, 2019

Describe the issue

Hi, I'm currently using the coc.nvim (with coc-vimtex extension ) for auto-completions. Since coc.nvim is using the regexes from deoplete.nvim, this issue should affect deoplete users as well.

This is a very minor issue but it is kind of annoying. Every time I type the line break sequence \\ (for example, inside a align* environment), the completion regexes will try to match a single \ and show a list of all the available commands. To reproduce it, first install coc.nvim with coc-vimtex or deoplete, and

\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\begin{align*}
  x &= 1 \
  %       ^ type '\' here
\end{align*}
\end{document}

I am using the Enter key to confirm a completion, so whenever I need to open a new line after the line break (which is something I always do), I have to manually type a space character to cancel the completion, or go back to normal mode and press o to open a new line, which can be quite cumbersome after a while.

Is it possible to modify the completion regexes so that it ignores the line break sequence (\\)?

Thank you.

@Krasjet Krasjet added the bug label Jun 28, 2019
@lervag
Copy link
Owner

lervag commented Jun 28, 2019

I'm using coc.nvim myself, and I can reproduce this. That is, I assume what you want is this:

  1. When the first \ is typed, coc.nvim may apply its magic and activate completion.
  2. When the second \ is typed, the regex should be applied and indicate that no completion is allowed.

@Krasjet
Copy link
Author

Krasjet commented Jun 28, 2019

Exactly, the first \ is the prefix of a command, so no problem. But \\ should be interpreted as a line break and should not trigger auto-completion.

@lervag
Copy link
Owner

lervag commented Jun 28, 2019

Should be fixed now.

@lervag lervag closed this as completed in 050653e Jun 28, 2019
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