buster / rrun

minimalistic command launcher in rust
GNU General Public License v2.0
112 stars 14 forks source link

Completion list #21

Closed nightscape closed 8 years ago

nightscape commented 8 years ago

Don't merge yet, this is work in progress. Just opening the PR to keep track of the history.

nightscape commented 8 years ago

I had a little more time and made some progress: The completion list is automatically filled after every keypress. Now it would be great if choosing items from the list view would work and probably an additional shortcut like Ctrl+3 for the third entry.

buster commented 8 years ago

By the way, i think we can get rid of the old Entry now, and just use SearchEntry (and potentially move more to the XML), since the code to switch between Entry and SearchEntry was only there for Travis..

nightscape commented 8 years ago

Ok, I moved your GTK 3.14 commit to the beginning, squashed all WIP commits into one commit and added a last commit for removing the Entry/SearchEntry distinction. There are probably some quirks left, but I think this is already a huge improvement usability-wise and can be merged from my POV.

nightscape commented 8 years ago

Haha, noticed one error rather quickly: When trying to type

rb "foo"

it crashes after typing the first " because the evaluate-on-every-keypress executes ruby with an invalid syntax:

ruby -e 'puts "'

Possible options:

Other ideas? Unfortunately, my vacation is over tomorrow and I probably won't have much time to work on this for a while...

buster commented 8 years ago

Hi,

Since I have not much time either, commits will go down quite a bit. I think I will see to fix that ruby bug over the coming days and then merge because it's a pretty big bug. I'll merge this afterwards and release a new version.

I think we can open tickets with small ideas and improvements as a sort of task list for now.

ghost commented 8 years ago

Also, to add to this list:

I think TAB should not switch to the command ist but cycle through the completions, like bash does. You can always press up+down, but tab should complete stuff ..

nightscape commented 8 years ago

The two commits about CSS and Glade should allow users to modify the UI rather arbitrarily (if they keep the naming). The corresponding config files are

~/.config/rrun/rrun.glade
~/.config/rrun/style.css

I'm not at all an expert when it comes to styling things, even less so with GTK, but maybe we can find and motivate someone who has already done something like that. Could you merge this and build a new package? Then we could maybe contact some GTK theme authors if they wanna give it a try :blue_heart: :green_heart: :heart:

buster commented 8 years ago

SorryI didn't respond yet. Thanks so far! I've pushed some code to complete the entry field on tab, as it has been in version < 0.1. But so far I find it hard to do stuff like "chromium google.de", after completing chromium... mhh.. I find this more in line with my usual workflow..

buster commented 8 years ago

Sorry i didn't have more time for this. The GTK and Glade stuff is awesome, but i think this pull request needs more time, before creating a new release. In particular i think the following should work:

  1. pressing TAB should let the cursor stay in the edit field (currently pressing TAB focuses the completion list and editing the text isn't possible anymore) 1a. Bonus for advancing the selected List field when the edit field content cycles to the next completion
  2. the completion list should be dynamically sized (and not be empty and full size on start up)
  3. pressing any alphanumeric key should edit the text field: When i press down to go through the list of completions, the edit field content should change to the selected completion and pressing [a-z0-9 ] should append to the edit field again (not do a search in the completion list as currently)

Features 1a and 3 could also be done after merging this PR, i think. But the first 2 points are what make the new version less usable, from my point of view..

nightscape commented 8 years ago

Just pushed two commits addressing 1. and 2. A minor issue is that the container does not shrink when the completion list shrinks, but I think this is not a show-stopper. Note that you need to overwrite your ~/.config/rrun/rrun.glade with the one from the sources in order for the second commit to work.

Do you think it's good to merge now? I would like to add some other features (especially caching), but I don't want to start anything new before having this one finished.

buster commented 8 years ago

Thanks! I have pushed some minor tweaks:

Nevertheless, i would merge this PR in this state.

Also, i think we'll need to refactor main.rs. It's at a point where it is very complex and hard to understand, imo...

Anyway, thanks very much for your input :)