Re: Tab reordering
Andreas Ronnquist <[email protected]> Sat, 15 Apr 2023 14:57:02 +0200
| Newsgroups | gmane.editors.scite.general |
|---|---|
| Message-ID | <20230415145702.104e498e@debian-i7> |
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. -- 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/20230415145702.104e498e%40debian-i7.
scite_move_tabs.diff
(text/x-patch, 1.1 KB)
diff --git a/scite/gtk/SciTEGTK.cxx b/scite/gtk/SciTEGTK.cxx
index bc44bcd..44910df 100644
--- a/scite/gtk/SciTEGTK.cxx
+++ b/scite/gtk/SciTEGTK.cxx
@@ -87,6 +87,8 @@ enum { mbsAboutBox = 0x100000 };
#define GKEY_F2 GDK_KEY_F2
#define GKEY_F3 GDK_KEY_F3
#define GKEY_F4 GDK_KEY_F4
+#define GKEY_Page_Up GDK_KEY_Page_Up
+#define GKEY_Page_Down GDK_KEY_Page_Down
#else
#define GKEY_Escape GDK_Escape
#define GKEY_Tab GDK_Tab
@@ -99,6 +101,8 @@ enum { mbsAboutBox = 0x100000 };
#define GKEY_F2 GDK_F2
#define GKEY_F3 GDK_F3
#define GKEY_F4 GDK_F4
+#define GKEY_Page_Up GDK_Page_Up
+#define GKEY_Page_Down GDK_Page_Down
#endif
static GdkWindow *WindowFromWidget(GtkWidget *w) {
@@ -3366,6 +3370,8 @@ static KeyToCommand kmap[] = {
{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},
};