From f6f76ad7b81c3969f87239812d05b721ca1d9763 Mon Sep 17 00:00:00 2001 From: "Michael Z. Kadaner" Date: Wed, 31 Jan 2024 22:29:31 -0800 Subject: [PATCH] Done: Debug print and help. --- far/FarCze.hlf.m4 | 3 +++ far/FarEng.hlf.m4 | 5 ++++- far/FarGer.hlf.m4 | 3 +++ far/FarHun.hlf.m4 | 3 +++ far/FarPol.hlf.m4 | 3 +++ far/FarRus.hlf.m4 | 5 ++++- far/FarSky.hlf.m4 | 3 +++ far/FarUkr.hlf.m4 | 3 +++ far/vmenu.cpp | 20 +++++++++++++++++--- 9 files changed, 43 insertions(+), 5 deletions(-) diff --git a/far/FarCze.hlf.m4 b/far/FarCze.hlf.m4 index ff4993bacda..85da636221f 100644 --- a/far/FarCze.hlf.m4 +++ b/far/FarCze.hlf.m4 @@ -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. diff --git a/far/FarEng.hlf.m4 b/far/FarEng.hlf.m4 index b80b2c6c1f5..43d13488a5d 100644 --- a/far/FarEng.hlf.m4 +++ b/far/FarEng.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=English,English .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -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. diff --git a/far/FarGer.hlf.m4 b/far/FarGer.hlf.m4 index 44a91faf90f..cd3c9e30b21 100644 --- a/far/FarGer.hlf.m4 +++ b/far/FarGer.hlf.m4 @@ -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. diff --git a/far/FarHun.hlf.m4 b/far/FarHun.hlf.m4 index 566a561dec3..f6557dcb9d1 100644 --- a/far/FarHun.hlf.m4 +++ b/far/FarHun.hlf.m4 @@ -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. diff --git a/far/FarPol.hlf.m4 b/far/FarPol.hlf.m4 index 7fac149ac53..d876dcdf9df 100644 --- a/far/FarPol.hlf.m4 +++ b/far/FarPol.hlf.m4 @@ -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. diff --git a/far/FarRus.hlf.m4 b/far/FarRus.hlf.m4 index 9c2de67612b..b685e2f7881 100644 --- a/far/FarRus.hlf.m4 +++ b/far/FarRus.hlf.m4 @@ -1,4 +1,4 @@ -m4_include(`farversion.m4')m4_dnl +m4_include(`farversion.m4')m4_dnl .Language=Russian,Russian (Русский) .Options CtrlColorChar=\ .Options CtrlStartPosChar=^ @@ -3506,6 +3506,9 @@ $ #Редактор: Меню результатов поиска всех вх #Ctrl+Enter#, #Ctrl+Щелчок левой кнопки мыши# Перейти к позиции найденного текста. + #Ctrl+Numpad5# + Выровнять все вхождения по вертикали. + #Gray +# Добавить сеансовую закладку с текущей позицией. diff --git a/far/FarSky.hlf.m4 b/far/FarSky.hlf.m4 index cbde26530d0..715826f5a14 100644 --- a/far/FarSky.hlf.m4 +++ b/far/FarSky.hlf.m4 @@ -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. diff --git a/far/FarUkr.hlf.m4 b/far/FarUkr.hlf.m4 index cb7df1f8130..a769ce60cb1 100644 --- a/far/FarUkr.hlf.m4 +++ b/far/FarUkr.hlf.m4 @@ -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. diff --git a/far/vmenu.cpp b/far/vmenu.cpp index 28c658318a3..e475c98c3a8 100644 --- a/far/vmenu.cpp +++ b/far/vmenu.cpp @@ -2440,7 +2440,6 @@ void VMenu::DrawTitles() const if (CheckFlags(VMENU_SHOWNOBOX)) return; const auto MaxTitleLength = m_Where.width() - 3; - int WidthTitle; if (!strTitle.empty() || bFilterEnabled) { @@ -2456,7 +2455,7 @@ void VMenu::DrawTitles() const append(strDisplayTitle, bFilterLocked? L'<' : L'[', strFilter, bFilterLocked? L'>' : L']'); } - WidthTitle = static_cast(strDisplayTitle.size()); + auto WidthTitle = static_cast(strDisplayTitle.size()); if (WidthTitle > MaxTitleLength) WidthTitle = MaxTitleLength - 1; @@ -2469,7 +2468,7 @@ void VMenu::DrawTitles() const if (!strBottomTitle.empty()) { - WidthTitle = static_cast(strBottomTitle.size()); + auto WidthTitle = static_cast(strBottomTitle.size()); if (WidthTitle > MaxTitleLength) WidthTitle = MaxTitleLength - 1; @@ -2479,6 +2478,21 @@ void VMenu::DrawTitles() const Text(concat(L' ', string_view(strBottomTitle).substr(0, WidthTitle), L' ')); } + +#ifdef _DEBUG + if (CheckFlags(VMENU_ENABLEALIGNANNOTATIONS)) + { + set_color(Colors, color_indices::Title); + + const auto AllItemsBoundariesLabel{ std::format(L" [{}, {}] ", m_AllItemsBoundaries.first, m_AllItemsBoundaries.second) }; + GotoXY(m_Where.left + 2, m_Where.bottom); + Text(AllItemsBoundariesLabel); + + const auto TextAreaWidthLabel{ std::format(L" [{}] ", CalculateTextAreaWidth()) }; + GotoXY(m_Where.right - 1 - static_cast(TextAreaWidthLabel.size()), m_Where.bottom); + Text(TextAreaWidthLabel); + } +#endif // _DEBUG } int VMenu::AdjustTopPos(const int BoxType)