Re: Tab reordering

Andreas Ronnquist <[email protected]> Mon, 17 Apr 2023 14:33:01 +0200
Newsgroups gmane.editors.scite.general
Message-ID <20230417143301.48f6ce05@debian-i7>
On Sat, 15 Apr 2023 17:11:35 +0200,
Andreas Ronnquist<[email protected]> wrote:

>On Sat, 15 Apr 2023 14:57:02 +0200,
>Andreas Ronnquist<[email protected]> wrote:
>
>>On Thu, 13 Apr 2023 03:41:08 -0700 (PDT),
>>baltasarq<[email protected]> wrote:
>>  
>>>Hi,
>>>
>>>It would be interesting to be able to reorder tabs (I mean, for buffers). 
>>>Say you open file1 and then file2. You will have two tabs, the first one 
>>>from the left being file1, and the next one file2. I'd like to be able to 
>>>click and hold on one tab (say file2) ane be able to drag it to the left so 
>>>the tabs new ordering would be fil2 and then file1.
>>>
>>>-- Baltasar
>>>    
>>
>>I have played around a bit and found that there is already some
>>functionality to move tabs in IDM_MOVETABLEFT and IDM_MOVETABRIGHT, and
>>have the attached tiny diff which allows to move tabs (in my example
>>with Ctrl+Alt+PgDn and Ctrl+Alt+PgUp).
>>
>>This of course doesn't allow to move them by dragging with the mouse,
>>but to me this seems like a good solution to the problem at hand.
>>
>>Tested on GTK3, Debian stable.
>>  
>
>Gah, I was working on an old checkout, I'll check if I can get
>something on a fresh branch.
>

diff against fresh hg attached.

-- Andreas Rönnquist
[email protected]
[email protected]

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/20230417143301.48f6ce05%40debian-i7.
scite_move_tabs.diff (text/x-patch, 1 KB)
diff -r 6ea425943cef gtk/SciTEGTK.cxx
--- a/gtk/SciTEGTK.cxx	Fri Apr 14 09:58:20 2023 +1000
+++ b/gtk/SciTEGTK.cxx	Mon Apr 17 14:29:57 2023 +0200
@@ -102,6 +102,8 @@
 #define GKEY_F6 GDK_KEY_F6
 #define GKEY_F7 GDK_KEY_F7
 #define GKEY_F11 GDK_KEY_F11
+#define GKEY_Page_Up GDK_KEY_Page_Up
+#define GKEY_Page_Down GDK_KEY_Page_Down
 #else
 #define GKEY_Tab GDK_Tab
 #define GKEY_ISO_Left_Tab GDK_ISO_Left_Tab
@@ -116,6 +118,8 @@
 #define GKEY_F6 GDK_F6
 #define GKEY_F7 GDK_F7
 #define GKEY_F11 GDK_F11
+#define GKEY_Page_Up GDK_Page_Up
+#define GKEY_Page_Down GDK_Page_Down
 #endif
 
 const char appName[] = "SciTE";
@@ -3046,6 +3050,8 @@
                                  {m_C, 'k', IDM_NEXTMATCHPPC},
                                  {mSC, 'K', IDM_SELECTTONEXTMATCHPPC},
                                  {m_C, GKEY_KP_Multiply, IDM_EXPAND},
+                                 {mSC, GKEY_Page_Up, IDM_MOVETABLEFT},
+                                 {mSC, GKEY_Page_Down, IDM_MOVETABRIGHT},
                                  {0, 0, 0},
                              };