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
NeoVintageous messes with Quickpanel input{} completion #1329
Comments
That's weird can you open the ST console and log commands ( |
Hi, that was fast. Sure! The console throws a lot of ghostscript and external_command.py errors. Here is the full output
The control+alt+7 comes from my german keyboard layout. |
Okay that error handling is something we must improve. The other output looks as expected. We will need more investigation in this. |
This is a NeoVintageous issue, explained here: NeoVintageous/NeoVintageous#357. That said, LatextTools could apply a workaround, by checking if command_mode is true and the cursor is on the last character of the line then +1 to the col. Check if command_mode is true:
|
Sorry can you please elaborate. Shall we insert the test a character later if it is at the end of a line and in command mode (which would be the first char in the next line)? |
No, it won't be the character in the next line, it will be the point before the eol character When in command mode the cursor is an inverted caret: The insert point above is before the letter b. When the cursor is at the end of a line, the insert point is before the letter c: In vim if you wanted to enter INSERT mode after the cursor character press a: The cursor is now before an invisible newline. So... if in command mode and the cursor is on the last character of the line, then the insertion point needs to be + 1, because if the user is in INSERT mode at the eol: And latexttools invokes an overylay, NeoVintageous will reset to command mode: When the user now selects from the overlay, and latextools does an insert, it will insert before the letter c. This is only an issue at the eol, because if the user is INSERT mode anywhere else: And neovintageous resets to command mode it will be at the correct position: This is all expected Vim behaviour, except for NeoVintageous resetting to command mode. If you don't use Vim this probably looks pretty insane. I don't know if that makes sense, it's kinda complicated to explain if you're not a Vim user, because it looks impossible, but it actually makes complete sense in Vim. More info: NeoVintageous/NeoVintageous@239b3bf --- edit --- Technically, the last one should actually reset to command mode before the letter a rather than the letter b. To fix that will require significant changes in NeoVintageous, because lots of commands depend on the current behaviour. |
I tried to make a workaround for this. Is there anything missing? |
I tried your workaround and it seems to be fixing the issue. Thank you! P.S.: When should this be closed, when the new version with this fix comes out or when the pull request is merged? |
I just noticed, that this doesn't completely solve the issue. It fails, when there is one character after the cursor in input mode. I don't think this can be solved from here as the resulting position in the command mode is exactly the same. But I think this is still a bit better than the previous behavior as I think the case where you are at the end of the line is much more common that one character before that. Edit: fix bad grammar |
I am wondering if the command mode setting is unique to neovintageous or also used in other vim emulators? |
I believe the command mode is actually something Sublime Text supplies for just this use case. If that is actually used by the vim emulators, I don't know but I assume it is. |
Can you please try whether this fix also works for the normal command mode or creates a problem there. If so we need to check that it is the neovintageous command mode. |
Probably related to this issue, I noticed that with the default setting I had a look at SolidTux's LaTeXTools workaround and I suppose one could get the current vim mode in a similar fashion, before opening the quickpanel and then return to the initial mode after pating. |
I solved this problem for me with some ugly workaround based on SolidTux's suggestion. This should prevent issues in all reasonable situations. |
I still have this issue on MacOSX. It's very annoying.I had issues with every autocompletion command(input, cite, ref, gls for acronyms, etc..) @dhelonious solution based on @SolidTux comments is a few commits back from latest version of LatexTools. But I put it again on the latest commit (45376f1) and it work. @r-stein I've made a pull request #1457 . Can you please consider merging that into the repository? |
I'm having the same issue. How can I install the workaround? |
A quick workaround may be for you to disable Open your settings Menu > Preferences > Settings and set:
That will prevent nv from resetting to normal mode when the view reactivates after the overlay is closed. If you prefer insert mode by default you can do that instead:
There is an EOF bug which I don't think relates to NeoVintageous or Vintage: For example in the following where the cursor is
Then pressing
I don't think that bug relates to Neovintageous or Vintage but may be confusing the issue because it looks like fixes for the Vim mode issues are trying to also fix the above issue too. |
To fix the insertion point when the cursor is at the eol:
In terms of fixing the right cursor position after the insertions are done is more complicated because There is still also the bug when the cursor is at the eof which impacts LatexTools irregardless of vim-modes. |
@gerardroche Thanks a lot! This workaround seem to be good enough for me for now! |
When typing
\input{
and then choosing something from the quickpanel that pops up I get a correct completion but at one character earlier when also using NeoVintageous, e.g\inpu{CompletedFilenameHere}t
This also happens with all other command that use the quickpanel, like
\cite{
or\ref{
This might be more of a bug in Neovintageous but it only occurs in combination with LatexTools. I believe this is rather recent as I use the autocomplete extensively.
Also, when no other extensions or custom config is used.
System:
Windows 10
Sublime Build 3176
LatexTools 3.15.1
NeoVintageous 1.6.2
The text was updated successfully, but these errors were encountered: