From 91ab1e824dd969b0d5c87e846e673da906366f02 Mon Sep 17 00:00:00 2001 From: akruphi <92621645+akruphi@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:50:06 +0300 Subject: [PATCH] History improvements History improvement after #1618 * Add stub for F3 when have not directory data (not ideally, it need corrections) * Add Ctrl-F10 to quick jump from history to dir/file in active panel * Add all new #1618 features to Help --- far2l/bootstrap/scripts/FarEng.hlf.m4 | 23 +++++++++++++++ far2l/bootstrap/scripts/FarHun.hlf.m4 | 23 +++++++++++++++ far2l/bootstrap/scripts/FarRus.hlf.m4 | 23 +++++++++++++++ far2l/bootstrap/scripts/FarUkr.hlf.m4 | 23 +++++++++++++++ far2l/bootstrap/scripts/farlang.templ.m4 | 18 ++++++------ far2l/src/cmdline.cpp | 6 +++- far2l/src/hist/history.cpp | 50 +++++++++++++++++++++++--------- 7 files changed, 143 insertions(+), 23 deletions(-) diff --git a/far2l/bootstrap/scripts/FarEng.hlf.m4 b/far2l/bootstrap/scripts/FarEng.hlf.m4 index ecc00cf9..257d4dce 100644 --- a/far2l/bootstrap/scripts/FarEng.hlf.m4 +++ b/far2l/bootstrap/scripts/FarEng.hlf.m4 @@ -1792,6 +1792,15 @@ available: Copy the text of the current command to the clipboard #Ctrl-C# without closing the list or #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Show additional information #F3# + + Quick jump in panel to directory of command #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1834,6 +1843,13 @@ shortcuts are available: Open a file in the ~viewer~@Viewer@ #F3# or #Numpad 5# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory and file #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1877,6 +1893,13 @@ available: Copy the text of the current history item to the #Ctrl-C# clipboard without closing the list or #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory (here #Enter# analog) #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) diff --git a/far2l/bootstrap/scripts/FarHun.hlf.m4 b/far2l/bootstrap/scripts/FarHun.hlf.m4 index ba216c90..1325dee5 100644 --- a/far2l/bootstrap/scripts/FarHun.hlf.m4 +++ b/far2l/bootstrap/scripts/FarHun.hlf.m4 @@ -1604,6 +1604,15 @@ $ #Parancs előzmények# A kiválasztott parancsot a vágólapra másolja, #Ctrl-C# a lista legördítve marad vagy #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Show additional information #F3# + + Quick jump in panel to directory of command #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1649,6 +1658,13 @@ $ #Előzmények: megnézett és szerkesztett fájlok előzménye# Fájl megnyitása a ~nézőkében~@Viewer@ #F3# vagy #Numpad 5# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory and file #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1694,6 +1710,13 @@ $ #Előzmények: mappa előzmények# A kiválasztott mappa nevét a vágólapra másolja, #Ctrl-C# a lista legördítve marad vagy #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory (here #Enter# analog) #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) diff --git a/far2l/bootstrap/scripts/FarRus.hlf.m4 b/far2l/bootstrap/scripts/FarRus.hlf.m4 index 858a8529..27dd7c69 100644 --- a/far2l/bootstrap/scripts/FarRus.hlf.m4 +++ b/far2l/bootstrap/scripts/FarRus.hlf.m4 @@ -1814,6 +1814,15 @@ $ #История команд# Копировать содержимое текущей позиции истории #Ctrl-C# в Буфер Обмена не закрывая списка или #Ctrl-Ins# + Переключение вида истории: #Ctrl-T# + * с строками дат (как в far3) + * с строками дат + колонка времени + * просто история (как в far2) + + Показать дополнительную информацию #F3# + + Быстрый переход на панели к каталогу команды #Ctrl-F10# + Переключение в режим быстрой фильтрации #Ctrl-Alt-F# (показывать только пункты, содержащие вводимый текст) @@ -1857,6 +1866,13 @@ $ #История просмотра и редактирования# Открыть файл в ~программе просмотра~@Viewer@ #F3# или #Numpad 5# + Переключение вида истории: #Ctrl-T# + * с строками дат (как в far3) + * с строками дат + колонка времени + * просто история (как в far2) + + Быстрый переход на панели к каталогу и файлу #Ctrl-F10# + Переключение в режим быстрой фильтрации #Ctrl-Alt-F# (показывать только пункты, содержащие вводимый текст) @@ -1898,6 +1914,13 @@ $ #История смены папок# Копировать содержимое текущей позиции истории #Ctrl-C# в Буфер Обмена не закрывая списка или #Ctrl-Ins# + Переключение вида истории: #Ctrl-T# + * с строками дат (как в far3) + * с строками дат + колонка времени + * просто история (как в far2) + + Быстрый переход на панели к каталогу (здесь аналог #Enter#) #Ctrl-F10# + Переключение в режим быстрой фильтрации #Ctrl-Alt-F# (показывать только пункты, содержащие вводимый текст) diff --git a/far2l/bootstrap/scripts/FarUkr.hlf.m4 b/far2l/bootstrap/scripts/FarUkr.hlf.m4 index d4dd34e5..da9337a6 100644 --- a/far2l/bootstrap/scripts/FarUkr.hlf.m4 +++ b/far2l/bootstrap/scripts/FarUkr.hlf.m4 @@ -1815,6 +1815,15 @@ $ #Історія команд# Копіювати вміст поточної позиції історії #Ctrl-C# в Буфер Обміну не закриваючи списку або #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Show additional information #F3# + + Quick jump in panel to directory of command #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1853,6 +1862,13 @@ $ #Історія перегляду та редагування# Копіювати вміст поточної позиції історії #Ctrl-C# в Буфер Обміну не закриваючи списку або #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory and file #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) @@ -1899,6 +1915,13 @@ $ #Історія зміни папок# Копіювати вміст поточної позиції історії #Ctrl-C# в Буфер Обміну не закриваючи списку або #Ctrl-Ins# + Toggle history view: #Ctrl-T# + * with date lines (as in far3) + * with date lines + time column + * plain history (as in far2) + + Quick jump in panel to directory (here #Enter# analog) #Ctrl-F10# + Toggle to quick filtering #Ctrl-Alt-F# (shows only items containing the typing text) diff --git a/far2l/bootstrap/scripts/farlang.templ.m4 b/far2l/bootstrap/scripts/farlang.templ.m4 index f96810ce..dab2c13c 100644 --- a/far2l/bootstrap/scripts/farlang.templ.m4 +++ b/far2l/bootstrap/scripts/farlang.templ.m4 @@ -15077,15 +15077,15 @@ EditControlHistoryFooterNoDel "Up/Down,Enter,Esc" HistoryFooter -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" -"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" +"Up/Down,Enter,Esc,Shift-Del,Del,Ins,Ctrl-C,Ctrl-T,Ctrl-F10" SearchFileTitle l: diff --git a/far2l/src/cmdline.cpp b/far2l/src/cmdline.cpp index 68a0d4cf..80eb71c5 100644 --- a/far2l/src/cmdline.cpp +++ b/far2l/src/cmdline.cpp @@ -733,6 +733,7 @@ void CommandLine::ShowViewEditHistory() 1 - Enter 2 - Shift-Enter 3 - Ctrl-Enter + 9 - Ctrl-F10 - jump in panel to directory & file */ if (SelectType == 1 || SelectType == 2) { @@ -782,8 +783,11 @@ void CommandLine::ShowViewEditHistory() } CtrlObject->ViewHistory->SetAddMode(true, 1, true); - } else if (SelectType == 3) // скинуть из истории в ком.строку? + } + else if (SelectType == 3) // скинуть из истории в ком.строку? SetString(strStr); + else if (SelectType == 9) // goto in panel to directory & file + CtrlObject->Cp()->GoToFile(strStr); } void CommandLine::SaveBackground(int X1, int Y1, int X2, int Y2) diff --git a/far2l/src/hist/history.cpp b/far2l/src/hist/history.cpp index 024b13ed..5857d082 100644 --- a/far2l/src/hist/history.cpp +++ b/far2l/src/hist/history.cpp @@ -399,6 +399,8 @@ int History::Select(VMenu &HistoryMenu, int Height, Dialog *Dlg, FARString &strS 5 - F4 6 - Ctrl-Shift-Enter 7 - Ctrl-Alt-Enter + 8 - F3 / Ctr-F10 (command history): GoTo Dir / Run-up + 9 - Ctrl-F10 (view/edit history): jump in panel to directory & file */ int History::ProcessMenu(FARString &strStr, const wchar_t *Title, VMenu &HistoryMenu, int Height, int &Type, Dialog *Dlg) @@ -597,19 +599,25 @@ int History::ProcessMenu(FARString &strStr, const wchar_t *Title, VMenu &History TruncStrFromCenter(strDir, std::max(ScrX - 32, 32)); strCmd.Insert(0, Msg::HistoryCommandLine); strDir.Insert(0, Msg::HistoryCommandDir); - switch (Message(MSG_LEFTALIGN, 3, Msg::HistoryCommandTitle, strCmd, strDir, - Msg::HistoryCommandClose, Msg::HistoryCommandChDir, Msg::HistoryCommandRunUp)) { - case 1: - strStr = CurrentRecord->strExtra; - Type = CurrentRecord->Type; - return 8; - - case 2: - strStr = CurrentRecord->strExtra; - strStr+= L'\n'; - strStr+= CurrentRecord->strName; - Type = CurrentRecord->Type; - return 8; + if ( CurrentRecord->strExtra.IsEmpty() ) // STUB for old records + Message(MSG_LEFTALIGN, 1, Msg::HistoryCommandTitle, strCmd, + L"--- Directory --- No Information ---", + Msg::HistoryCommandClose); + else { + switch (Message(MSG_LEFTALIGN, 3, Msg::HistoryCommandTitle, strCmd, strDir, + Msg::HistoryCommandClose, Msg::HistoryCommandChDir, Msg::HistoryCommandRunUp)) { + case 1: + strStr = CurrentRecord->strExtra; + Type = CurrentRecord->Type; + return 8; + + case 2: + strStr = CurrentRecord->strExtra; + strStr+= L'\n'; + strStr+= CurrentRecord->strName; + Type = CurrentRecord->Type; + return 8; + } } break; } // else fall through @@ -711,6 +719,22 @@ int History::ProcessMenu(FARString &strStr, const wchar_t *Title, VMenu &History CurrentItem = CurrentRecord; break; } + case KEY_CTRLF10: { + if (TypeHistory == HISTORYTYPE_CMD && CurrentRecord && !CurrentRecord->strExtra.IsEmpty() ) { + strStr = CurrentRecord->strExtra; + Type = CurrentRecord->Type; + return 8; // for command is equivalent to Go To Directory + } + if (TypeHistory == HISTORYTYPE_VIEW && CurrentRecord) { + strStr = CurrentRecord->strName; + return 9; // for files: Go To Directory & postion to file + } + if (TypeHistory == HISTORYTYPE_FOLDER && CurrentRecord) { + strStr = CurrentRecord->strName; + return 1; // for directory is equialent to ENTER + } + break; + } default: HistoryMenu.ProcessInput(); -- 2.11.4.GIT