-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
fix: improve prefixing for inline preview #5439
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5439 +/- ##
=======================================
Coverage 87.60% 87.60%
=======================================
Files 584 584
Lines 46437 46463 +26
Branches 7023 7023
=======================================
+ Hits 40679 40705 +26
Misses 5758 5758
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -197,7 +197,14 @@ class Autocomplete { | |||
} | |||
|
|||
$updateGhostText(completion) { | |||
var prefix = util.getCompletionPrefix(this.editor); | |||
// Ghost text can include characters normally not part of the prefix (e.g. whitespace). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why getCompletionPrefix
in utils doesn't consider whitespaces? Should we update that too?
src/autocomplete_test.js
Outdated
}, 100); | ||
}, 100); | ||
}, | ||
"test: should keep shwoing ghost text when typing ahead with whitespace": function(done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: shwoing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
Issue #, if available: NA
Description of changes: Use the string of text between the start of the autocomplete prefix and the current cursor position, regardless of the characters in between, to determine whether inline preview should be rendered. This allows inline preview to stay visible when typing ahead with whitespace.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.