Skip to content

Commit

Permalink
Ctrl+Numpad5 vertically aligns found text in "All matching entries"…
Browse files Browse the repository at this point in the history
… menu.

1. `Ctrl+Numpad5` in Editor menu "All matching entries" vertically aligns
   found text in all items. To preserve vertical alignment while scrolling items
   horizontally, the items can be moved beyond the left or right window edges.
2. New far:config VMenu.SwapHScrollDirection changes the meaning of left and
   right keys in all menus and lists. See far:config for details.
  • Loading branch information
MKadaner committed Feb 3, 2024
1 parent 9adfdda commit fe907fc
Show file tree
Hide file tree
Showing 17 changed files with 594 additions and 147 deletions.
18 changes: 18 additions & 0 deletions far/FarCze.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3488,6 +3488,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6662,6 +6665,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
18 changes: 18 additions & 0 deletions far/FarEng.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3454,6 +3454,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6629,6 +6632,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
18 changes: 18 additions & 0 deletions far/FarGer.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6720,6 +6723,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
18 changes: 18 additions & 0 deletions far/FarHun.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3537,6 +3537,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6740,6 +6743,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
18 changes: 18 additions & 0 deletions far/FarPol.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3452,6 +3452,9 @@ $ #Edytor: menu wszystkich znalezionych wystąpień#
#Ctrl+Enter#, #Ctrl+Kliknięcie lewym przyciskiem myszy#
Przechodzi do pozycji znalezionego tekstu.

#Ctrl+Numpad5#
Vertically align all found entries.

#Szary +#
Dodaje zakładkę sesji w bieżącej pozycji.

Expand Down Expand Up @@ -6639,6 +6642,21 @@ lub osiągnie początkowy punkt wyszukiwania.
Ten parametr można zmienić tylko w ~far:config~@FarConfig@.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
Ten parametr tekstowy definiuje języki wejściowe (układy klawiatury),
Expand Down
18 changes: 18 additions & 0 deletions far/FarRus.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3506,6 +3506,9 @@ $ #Редактор: Меню результатов поиска всех вх
#Ctrl+Enter#, #Ctrl+Щелчок левой кнопки мыши#
Перейти к позиции найденного текста.

#Ctrl+Numpad5#
Выровнять все вхождения по вертикали.

#Gray +#
Добавить сеансовую закладку с текущей позицией.

Expand Down Expand Up @@ -6737,6 +6740,21 @@ $ #far:config Viewer.SearchWrapStop#
Изменить этот параметр можно только через ~far:config~@FarConfig@.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
Этот логический (Boolean) параметр меняет направление ~горизонтального перемещения~@MenuCmd@
элементов меню и списков.

False - ^<wrap>Стрелка влево перемещает элементы вправо. Стрелка вправо перемещает элементы влево.
Другими словами, эти клавиши управляют окном меню.
True - Стрелка влево перемещает элементы влево. Стрелка вправо перемещает элементы вправо.
То есть, эти клавиши управляют элементами меню.

Значение по умолчанию: False (Стрелки управляют окном меню).

Изменить этот параметр можно только через ~far:config~@FarConfig@.


@XLat.Layouts
$ #far:config XLat.Layouts#
Этот строковый параметр определят языки ввода (раскладки клавиатуры),
Expand Down
18 changes: 18 additions & 0 deletions far/FarSky.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3449,6 +3449,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6623,6 +6626,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
18 changes: 18 additions & 0 deletions far/FarUkr.hlf.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3512,6 +3512,9 @@ $ #Editor: All matching entries menu#
#Ctrl+Enter#, #Ctrl+Left mouse click#
Go to the position of the found text.

#Ctrl+Numpad5#
Vertically align all found entries.

#Gray +#
Add session bookmark with the current position.

Expand Down Expand Up @@ -6711,6 +6714,21 @@ or the search starting point.
This parameter can be changed via ~far:config~@FarConfig@ only.


@VMenu.SwapHScrollDirection
$ #far:config VMenu.SwapHScrollDirection#
This Boolean parameter swaps the direction of ~horizontal scrolling~@MenuCmd@
of menu and list box items.

False - ^<wrap>#Left# arrow scrolls items to the right, #Right# arrow scrolls items to the left.
In other words, these keys control the menu window.
True - #Left# arrow scrolls items to the left, #Right# arrow scrolls items to the right.
I.e., these keys control the menu items.

Default value: False (arrow keys control the menu window).

This parameter can be changed via ~far:config~@FarConfig@ only.


@XLat.Layouts
$ #far:config XLat.Layouts#
This string parameter defines the input locales (keyboard layouts)
Expand Down
10 changes: 10 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
--------------------------------------------------------------------------------
MZK 2024-02-02 20:46:28-08:00 - build 6267

1. `Ctrl+Numpad5` in Editor menu "All matching entries" vertically aligns
found text in all items. To preserve vertical alignment while scrolling items
horizontally, the items can be moved beyond the left or right window edges.

2. New far:config VMenu.SwapHScrollDirection changes the meaning of left and
right keys in all menus and lists. See far:config for details.

--------------------------------------------------------------------------------
drkns 2024-02-02 08:43:11+00:00 - build 6266

Expand Down
1 change: 1 addition & 0 deletions far/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,6 +2111,7 @@ void Options::InitConfigsData()
{FSSF_PRIVATE, NKeyVMenu, L"LBtnClick"sv, VMenu.LBtnClick, VMENUCLICK_CANCEL},
{FSSF_PRIVATE, NKeyVMenu, L"MBtnClick"sv, VMenu.MBtnClick, VMENUCLICK_APPLY},
{FSSF_PRIVATE, NKeyVMenu, L"RBtnClick"sv, VMenu.RBtnClick, VMENUCLICK_CANCEL},
{FSSF_PRIVATE, NKeyVMenu, L"SwapHScrollDirection"sv, VMenu.SwapHScrollDirection, false},
{FSSF_PRIVATE, NKeyXLat, L"Flags"sv, XLat.Flags, XLAT_SWITCHKEYBLAYOUT|XLAT_CONVERTALLCMDLINE},
{FSSF_PRIVATE, NKeyXLat, L"Layouts"sv, XLat.strLayouts, L""sv},
{FSSF_PRIVATE, NKeyXLat, L"Rules1"sv, XLat.Rules[0], L""sv},
Expand Down
1 change: 1 addition & 0 deletions far/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ class Options: noncopyable
IntOption LBtnClick;
IntOption RBtnClick;
IntOption MBtnClick;
BoolOption SwapHScrollDirection;
};

struct CommandLineOptions
Expand Down
1 change: 1 addition & 0 deletions far/dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,7 @@ bool Dialog::ProcessKey(const Manager::Key& Key)
case KEY_MSWHEEL_RIGHT:
case KEY_NUMENTER:
case KEY_ENTER:
case KEY_NUMPAD5:
auto& List = Items[m_FocusPos].ListPtr;
int CurListPos=List->GetSelectPos();
List->ProcessKey(Key);
Expand Down
2 changes: 1 addition & 1 deletion far/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3751,7 +3751,7 @@ void Editor::DoSearchReplace(const SearchReplaceDisposition Disposition)
{
const auto MenuY1 = std::max(0, ScrY - 20);
const auto MenuY2 = std::min(ScrY, MenuY1 + std::min(static_cast<int>(FindAllList->size()), 10) + 2);
FindAllList->SetMenuFlags(VMENU_WRAPMODE | VMENU_SHOWAMPERSAND);
FindAllList->SetMenuFlags(VMENU_WRAPMODE | VMENU_SHOWAMPERSAND | VMENU_ENABLEALIGNANNOTATIONS);
FindAllList->SetPosition({ -1, MenuY1, 0, MenuY2 });
FindAllList->SetTitle(far::vformat(msg(lng::MEditSearchStatistics), FindAllList->size(), AllRefLines));
FindAllList->SetBottomTitle(KeysToLocalizedText(KEY_CTRLENTER, KEY_F5, KEY_ADD, KEY_CTRLUP, KEY_CTRLDOWN));
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6266
6267
Loading

0 comments on commit fe907fc

Please sign in to comment.