-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 error: words do not get replaced correctly (JavaScript) #2580
Comments
I just realised that is a more generic issue where the autocompletion replacement is corrupted unless you start the autocompletion at the very start of the word. I’m in the middle of a word: I enter insert mode and I get autocompletions: I select an autocompletion: Instead of replacing Finally, as before, the corruption remains when you finalise the completion: |
Related #2027: this also explains the odd corruptions I see when I forget and move around in insert mode. Because of this, I’ve basically started using insert mode only for single lines whenever possible and keep coming in and out of normal mode even when initially writing a contiguous piece of code as at least then I get granular undo to quickly fix autocomplete corruption errors should I forget an navigate in insert mode again. I do feel this needs a better solution. |
This may be fixed by #1819 |
I am pretty sure this was mostly fixed by recent improvements to completion handling (although your second comment is not a but just how completions work, for servers that support it completions replace can now be configured but not all do). I think the remaining cases are covered by #2027 so I am closing this issue in favor of that one |
Summary
Just ran into an odd autocompletion error in a JavaScript file.
Reproduction Steps
The steps:
Selecting word to change:
Starting to change it:
Getting autocompletion:
Tabbing through the options, all is well with the first few until I get to:
Notice that the original
fi
is not replaced with the completion. Rather the completion is erroneously added to it.Since this is a field, the beginning of the completion string – which includes the
.this
reference – differs from beginning of the variable name as I started writing it. I’m assuming the string replacement logic in Helix has to be updated to take this case into consideration.Finally, the corruption remains after using enter to finalise the completion:
Helix log
No entries in the log from around this time.
Platform
Linux (Fedora Silverblue 36)
Terminal Emulator
GNOME Console
Helix Version
helix 22.05-dev (8df8ff2)
The text was updated successfully, but these errors were encountered: