This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
CSS code hints improvements #6242
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cbdf5a4
select the initial hint on backspace key press
YuAo f7b10b8
clear hints when nothing's left
YuAo cc93db0
fix the bug that prevents Ctrl+Space from invoking css hints
YuAo 7dc8ba2
Merge branch 'master' into css-code-hints-improvements
YuAo 287729c
reapply 'select the initial hint on backspace key press'
YuAo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
@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 !== ""
):But, this fix is not quite right because it prevents Ctrl+space from invoking css property hints when nothing has been typed.
Let me know if you'd like to continue with this, or if I should just fix it.
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.
@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).I've added a commit.