feat: add autocompletion of paths to the "go to" dialog#88
feat: add autocompletion of paths to the "go to" dialog#88agriggio wants to merge 1 commit intonetdcy:mainfrom
Conversation
| var currentSuggestionIndex: Int = -1 | ||
| var initSuggestions: Bool = true | ||
|
|
||
| override func keyUp(with event: NSEvent) { |
There was a problem hiding this comment.
I guess it might be because the keydown event for the tab key is processed first for switching focus, so you chose to use the keyup event? But this results in two behaviors at the same time. Therefore, it is better to add interception for the tab key in the code section that defines application shortcuts (eventMonitorKeyDown) and invoke the relevant autocompletion function based on the context.
| var initSuggestions: Bool = true | ||
|
|
||
| override func keyUp(with event: NSEvent) { | ||
| if event.keyCode == 48 /* Tab */ |
There was a problem hiding this comment.
this needs to use semantic values instead of keycodes, like in the application shortcut key section(eventMonitorKeyDown). #16
| } else if event.keyCode == 126 /* Arrow up */ { | ||
| doAutocomplete(reverse: true) | ||
| } else { | ||
| initSuggestions = true |
There was a problem hiding this comment.
Once the left and right keys are used to move the cursor, the initSuggestions variable is reset, causing the behavior of pressing the up and down keys to change, which may not be very reasonable. Perhaps the theoretically best solution would be to decide which level of directory should be switched based on the cursor's position?
|
Hi, |
Proof of concept implementation for #87