Skip to content

Commit

Permalink
Done: Debug print and help.
Browse files Browse the repository at this point in the history
  • Loading branch information
MKadaner committed Feb 1, 2024
1 parent eaa7e22 commit f6f76ad
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 5 deletions.
3 changes: 3 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
5 changes: 4 additions & 1 deletion far/FarEng.hlf.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
m4_include(`farversion.m4')m4_dnl
m4_include(`farversion.m4')m4_dnl
.Language=English,English
.Options CtrlColorChar=\
.Options CtrlStartPosChar=^<wrap>
Expand Down 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
3 changes: 3 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
3 changes: 3 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
3 changes: 3 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
5 changes: 4 additions & 1 deletion far/FarRus.hlf.m4
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
m4_include(`farversion.m4')m4_dnl
m4_include(`farversion.m4')m4_dnl
.Language=Russian,Russian (Русский)
.Options CtrlColorChar=\
.Options CtrlStartPosChar=^<wrap>
Expand Down Expand Up @@ -3506,6 +3506,9 @@ $ #Редактор: Меню результатов поиска всех вх
#Ctrl+Enter#, #Ctrl+Щелчок левой кнопки мыши#
Перейти к позиции найденного текста.

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

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

Expand Down
3 changes: 3 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
3 changes: 3 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
20 changes: 17 additions & 3 deletions far/vmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -2456,7 +2455,7 @@ void VMenu::DrawTitles() const
append(strDisplayTitle, bFilterLocked? L'<' : L'[', strFilter, bFilterLocked? L'>' : L']');
}

WidthTitle = static_cast<int>(strDisplayTitle.size());
auto WidthTitle = static_cast<int>(strDisplayTitle.size());

if (WidthTitle > MaxTitleLength)
WidthTitle = MaxTitleLength - 1;
Expand All @@ -2469,7 +2468,7 @@ void VMenu::DrawTitles() const

if (!strBottomTitle.empty())
{
WidthTitle = static_cast<int>(strBottomTitle.size());
auto WidthTitle = static_cast<int>(strBottomTitle.size());

if (WidthTitle > MaxTitleLength)
WidthTitle = MaxTitleLength - 1;
Expand All @@ -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<int>(TextAreaWidthLabel.size()), m_Where.bottom);
Text(TextAreaWidthLabel);
}
#endif // _DEBUG
}

int VMenu::AdjustTopPos(const int BoxType)
Expand Down

0 comments on commit f6f76ad

Please sign in to comment.