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

fix: improve prefixing for inline preview #5439

Merged
merged 3 commits into from
Dec 29, 2023

Conversation

akoreman
Copy link
Contributor

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.

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c433537) 87.60% compared to head (7e44ae7) 87.60%.

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           
Flag Coverage Δ
unittests 87.60% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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).
Copy link
Contributor

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?

}, 100);
}, 100);
},
"test: should keep shwoing ghost text when typing ahead with whitespace": function(done) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: shwoing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

@akoreman akoreman merged commit 51006bb into ajaxorg:master Dec 29, 2023
3 checks passed
@akoreman akoreman deleted the inline_prefix branch December 29, 2023 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants