You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: When you input "col", the code hint plugin will present hints like "color","column-count",etc, with the initial item "color" selected. But, after you press backspace key once, nothing is selected on the hints list.
This patch set the selectInitial = true on implicitChar === null, making the first hint selected on backspace key press.
Clear hints when nothing's left
Problem: When you input "co", then press backspace twice to delete the CSS property, the code hints list remains open with hints like "align-content","align-items",etc.
This patch fixed the problem by returning null for the hints list when this.info.offset === 0.
The reason will be displayed to describe this comment to others. Learn more.
@YuAo I saw your pull request, but I misread it and thought it was a bug report. Good catch!
So I fixed this in this commit while I was fixing #6231 . Note that I moved this code a bit in pull request #6258, so your change will have to be merged. I backed out my change for this fix after I noticed that this was actually a pull request :)
The gist of my fix is to also select initial item if any code has been typed (i.e. needle !== ""):
The reason will be displayed to describe this comment to others. Learn more.
@redmunds Oh, I didn't notice that. Because my Ctrl+Space is occupied by the input method switch.
I don't think that a code hint is helpful when nothing has been typed. It's better to having no code hint than having a not so useful code hint list floating around.
However, I think we can still fix this by checking the lastContext.
If lastContext is not null, we know that the user has previously typed something and have some hints. So we can get ride of the hint list this time.
If lastContext is null, we know that the user didn't get any hints the last time. We can now show him some hints anyway, if he requires (i.e. pressed Ctrl+Space).
@YuAo My pull request #6270 that was merged last night conflicts with your code. Sorry about that. You'll have to merge with the latest master before I can review your latest changes. Let me know if you have any questions about the code change.
Conflicts:
src/extensions/default/CSSCodeHints/main.js
"Select the initial hint on backspace key press" has been done by @redmunds on master, fixed conflicts
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Select the initial hint on backspace key press
Problem: When you input "col", the code hint plugin will present hints like "color","column-count",etc, with the initial item "color" selected. But, after you press backspace key once, nothing is selected on the hints list.
This patch set the
selectInitial = true
onimplicitChar === null
, making the first hint selected on backspace key press.Clear hints when nothing's left
Problem: When you input "co", then press backspace twice to delete the CSS property, the code hints list remains open with hints like "align-content","align-items",etc.
This patch fixed the problem by returning
null
for the hints list whenthis.info.offset === 0
.