From 24d7777e5aff039c9423989d1c39d4d984b2536c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 17 Dec 2023 00:36:46 +0100 Subject: [PATCH] Add navigation to the 1st & last tab abilities Fix #14416, fix --- PowerEditor/installer/nativeLang/english.xml | 6 ++++-- PowerEditor/installer/nativeLang/english_customizable.xml | 6 ++++-- PowerEditor/installer/nativeLang/french.xml | 5 ++++- PowerEditor/installer/nativeLang/taiwaneseMandarin.xml | 6 ++++-- PowerEditor/src/Notepad_plus.rc | 7 ++++--- PowerEditor/src/NppCommands.cpp | 8 ++++++++ PowerEditor/src/Parameters.cpp | 2 ++ PowerEditor/src/menuCmdID.h | 2 ++ 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 180d27f7fc4c..a359a821effc 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -304,6 +304,8 @@ Translation note: + + @@ -346,12 +348,12 @@ Translation note: - - + + diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index d904b4044ec0..55b5fed63aff 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -304,6 +304,8 @@ Translation note: + + @@ -346,12 +348,12 @@ Translation note: - - + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 732501c1603e..eb19b6f996ea 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -304,6 +304,8 @@ Translation note: + + @@ -351,7 +353,8 @@ Translation note: - + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index 33fac89b2afb..805eb1b920ed 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -281,6 +281,8 @@ + + @@ -321,12 +323,12 @@ - - + + diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 72a1a17d8d20..c328900c1369 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -708,9 +708,6 @@ BEGIN END POPUP "Move/Clone Current Document" BEGIN - MENUITEM "Move to Start", IDM_VIEW_GOTO_START - MENUITEM "Move to End", IDM_VIEW_GOTO_END - MENUITEM SEPARATOR MENUITEM "Move to Other View", IDM_VIEW_GOTO_ANOTHER_VIEW MENUITEM "Clone to Other View", IDM_VIEW_CLONE_TO_ANOTHER_VIEW MENUITEM "Move to New Instance", IDM_VIEW_GOTO_NEW_INSTANCE @@ -729,9 +726,13 @@ BEGIN MENUITEM "8th Tab", IDM_VIEW_TAB8 MENUITEM "9th Tab", IDM_VIEW_TAB9 MENUITEM SEPARATOR + MENUITEM "First Tab", IDM_VIEW_TAB_START + MENUITEM "Last Tab", IDM_VIEW_TAB_END MENUITEM "Next Tab", IDM_VIEW_TAB_NEXT MENUITEM "Previous Tab", IDM_VIEW_TAB_PREV MENUITEM SEPARATOR + MENUITEM "Move to Start", IDM_VIEW_GOTO_START + MENUITEM "Move to End", IDM_VIEW_GOTO_END MENUITEM "Move Tab Forward", IDM_VIEW_TAB_MOVEFORWARD MENUITEM "Move Tab Backward", IDM_VIEW_TAB_MOVEBACKWARD MENUITEM SEPARATOR diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 0c6098d25e4c..9baa021613a6 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1072,6 +1072,14 @@ void Notepad_plus::command(int id) } break; + case IDM_VIEW_TAB_START: + case IDM_VIEW_TAB_END: + { + size_t index = id == IDM_VIEW_TAB_START ? 0 : _pDocTab->nbItem() - 1; + switchToFile(_pDocTab->getBufferByIndex(index)); + } + break; + case IDM_VIEW_TAB_NEXT: { const int current_index = _pDocTab->getCurrentTabIndex(); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 3b7212ab3f28..fce6343573b0 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -296,6 +296,8 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NUMPAD7, IDM_VIEW_TAB7, true, false, false, nullptr }, { VK_NUMPAD8, IDM_VIEW_TAB8, true, false, false, nullptr }, { VK_NUMPAD9, IDM_VIEW_TAB9, true, false, false, nullptr }, + { VK_NULL, IDM_VIEW_TAB_START, false, false, false, nullptr }, + { VK_NULL, IDM_VIEW_TAB_END, false, false, false, nullptr }, { VK_NEXT, IDM_VIEW_TAB_NEXT, true, false, false, nullptr }, { VK_PRIOR, IDM_VIEW_TAB_PREV, true, false, false, nullptr }, { VK_NEXT, IDM_VIEW_TAB_MOVEFORWARD, true, false, true, nullptr }, diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index c6361252c415..6a41b454492e 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -388,6 +388,8 @@ #define IDM_VIEW_TAB_COLOUR_3 (IDM_VIEW + 113) #define IDM_VIEW_TAB_COLOUR_4 (IDM_VIEW + 114) #define IDM_VIEW_TAB_COLOUR_5 (IDM_VIEW + 115) + #define IDM_VIEW_TAB_START (IDM_VIEW + 116) + #define IDM_VIEW_TAB_END (IDM_VIEW + 117) #define IDM_VIEW_NPC (IDM_VIEW + 130) #define IDM_VIEW_NPC_CCUNIEOL (IDM_VIEW + 131)