porcupine
porcupine copied to clipboard
offering autocompletions more aggressively
After writing some java code with a jave IDE, I don't like how I have to press tab to get completions in porcupine
In the same vein, I don't like having tab
be used to trigger autocompletions. It complicates things for https://github.com/Akuli/porcupine/pull/1314 but more important IMO is it's not really how other editors do it, so it's unexpected/surprising as a user (particularly as a new one).
In VSCode by default you enter a single char and it starts suggesting:
Not sure how performance of that would look in Porcupine, could be on a bit of a delay? But I would love to move away from having an explicit key for autocompletions.
Another downside with how it works now is that some users don't about the autocompleting, at least not until I tell them about it. It really limits their productivity.
If there is an autocomplete found always bring up the menu but make it easy to ignore it (I hate it when I import something and the autocomplete stays which means I can't get a newline.
Also, @benjamin-kirkbride I love how you use VS Code as your reference :).
Yes, making the autocomplete ignorable is important. Having it go away when pressing Esc might be enough, but I think we can do better.
I think this would be pretty good:
- When the menu pops up, there is a little bit of room around the cursor, so that the menu doesn't block your view into what's right next to the cursor.
- The menu goes away when you press enter, and filters as you continue to type normally. The menu also goes away if you press Esc, but ideally you wouldn't need this often.
- To select an autocompletion, press tab and shift+tab or click with the mouse. When an autocompletion is selected, it should immediately go into the text widget, so that you don't need to confirm by pressing enter, for example. So as you press tab, we delete the old autocompletion and insert the new one as we go.
- Colors of the autocomplete popup should be pretty close to the background color of the text widget, so that you feel like it's easy to ignore.
I'd make it go away if I press the arrow keys unless I hover my mouse over the popup.