Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some suggestions about menus #929

Closed
NightMachinery opened this issue Jan 21, 2024 · 12 comments
Closed

Some suggestions about menus #929

NightMachinery opened this issue Jan 21, 2024 · 12 comments

Comments

@NightMachinery
Copy link
Contributor

  1. Adding two commands menu_history_previous and menu_history_next (alt+p, alt+n can be good bindings) to change the text using history. I use these two commands in emacs menus a lot.
  2. Adding options to change the way the menu is sorted by default. The command palette is using alphabetical sorting AFAIR, while most recently used sorting makes more sense.
@NightMachinery
Copy link
Contributor Author

NightMachinery commented Jan 22, 2024

  1. In general, being able to bind commands for the menus is good.
  2. If you can bind commands, we can have menu_move_down 5 <A-<down>> to make alt+down to scroll the menu a lot.
  3. Perhaps having a menu_screen_down menu_screen_up which take the number of shown elements and try to scroll by a "screen" is even better.

Update: I noticed that pagedown and pageup already kind of do menu_screen_up etc. But I don't think the bindings can be changed. (?)

@ahrm
Copy link
Owner

ahrm commented Jan 26, 2024

Added a show_most_recent_commands_first config option in 75d99fb.

@NightMachinery
Copy link
Contributor Author

@ahrm Thanks!

The new recent menu that shows the titles in addition to filenames needs some work:
image

I guess the easiest way to make it better is to add a config option for the width percentage of the title column. It's currently getting all the space.

@ahrm
Copy link
Owner

ahrm commented Jan 27, 2024

It looks fine for me on windows, I guess this might be an OS-specific bug.

@NightMachinery
Copy link
Contributor Author

NightMachinery commented Jan 27, 2024

@ahrm Can you share what it looks like? I also have multiline_menus 1.

@ahrm
Copy link
Owner

ahrm commented Jan 27, 2024

I think it looked fine for me because my items did fit on the screen. I can reproduce the issue by resizing the window so that it is very small.

ahrm added a commit that referenced this issue Jan 27, 2024
@ahrm
Copy link
Owner

ahrm commented Jan 27, 2024

Fixed in 3238a51.

@ahrm
Copy link
Owner

ahrm commented Jan 28, 2024

Added ability to bind commands in menus in 208e0a8. For example:

[m]control_menu(move_to_begin) <C-a>
[m]control_menu(move_to_end) <C-e>
[m]control_menu(delete_to_end) <C-k>
[m]control_menu(cursor_forward) <C-f>
[m]control_menu(select_forward) <C-S-F>
[m]control_menu(cursor_backward) <C-b>
[m]control_menu(delete_prev_char) <C-h>
[m]control_menu(delete_prev_word) <C-w>
[m]control_menu(select_backward) <C-S-B>
[m]control_menu(delete_next_char) <C-d>
[m]control_menu(move_word_forward) <A-f>
[m]control_menu(select_word_forward) <A-S-F>
[m]control_menu(move_word_backward) <A-b>
[m]control_menu(select_word_backward) <A-S-B>
[m]control_menu(prev_suggestion) <up>
[m]control_menu(next_suggestion) <down>

control_menu has some other options not listed above: page_up, page_down, menu_begin, menu_end.
The [m] prefix means that this command is only active while we are in menus. prev_suggestion and next_suggestion are used to suggest search history. The only command that I thought prev_suggestion and next_suggestion made sense for was search. Feel free to suggest other options if you have any ideas.

@ahrm ahrm closed this as completed Jan 28, 2024
@NightMachinery
Copy link
Contributor Author

Thanks. prev_suggestion etc. will be useful in the command palette as well.


I noticed that RTL text seems to render incorrectly:
image
I don't know how much work getting it to work would be though. I am attaching the file.
ML_HW04.pdf

@ahrm
Copy link
Owner

ahrm commented Jan 28, 2024

Slightly improved mixed RTL handling in c817243. I don't plan to fully support RTL though.

@NightMachinery
Copy link
Contributor Author

@ahrm Pressing <up> when the first item of the menu is selected, scrolls the PDF instead of cycling to the last menu option.

@NightMachinery
Copy link
Contributor Author

Fixed in 3238a51.

It seems the issue also happens with goto_tab, which is not fixed by this commit.


Another issue; <space> is not shown properly in the command palette:

goto_tab <space>oo
image

BTW, is there a reason we can't bind <return> (ENTER)? Can it be added to get_key_name_from_key_code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants