1 NEdit*text.translations: #override \
2 Shift Ctrl<KeyPress>osfPageUp: switch_previous_document()\n\
3 Shift Ctrl<KeyPress>osfPageDown: switch_next_document()\n\
9 source/menu.c | 18 ++++++++++++++
10 source/window.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 4 files changed, 95 insertions(+), 1 deletion(-)
14 diff --quilt old/source/menu.c new/source/menu.c
17 @@ -329,10 +329,14 @@ static void nextDocumentAP(Widget w, XEv
19 static void prevDocumentAP(Widget w, XEvent *event, String *args,
21 static void lastDocumentAP(Widget w, XEvent *event, String *args,
23 +static void switchNextDocumentAP(Widget w, XEvent *event, String *args,
25 +static void switchPrevDocumentAP(Widget w, XEvent *event, String *args,
27 static void closePaneAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
28 static void capitalizeAP(Widget w, XEvent *event, String *args,
30 static void lowercaseAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
31 static void fillAP(Widget w, XEvent *event, String *args, Cardinal *nArgs);
32 @@ -544,10 +548,12 @@ static XtActionsRec Actions[] = {
33 {"detach_document_dialog", detachDocumentDialogAP},
34 {"move_document_dialog", moveDocumentDialogAP},
35 {"next_document", nextDocumentAP},
36 {"previous_document", prevDocumentAP},
37 {"last_document", lastDocumentAP},
38 + {"switch_next_document", switchNextDocumentAP},
39 + {"switch_previous_document", switchPrevDocumentAP},
40 {"uppercase", capitalizeAP},
41 {"lowercase", lowercaseAP},
42 {"fill-paragraph", fillAP},
43 {"fill_paragraph", fillAP},
44 {"control-code-dialog", controlDialogAP},
45 @@ -3761,10 +3767,22 @@ static void lastDocumentAP(Widget w, XEv
48 LastDocument(WidgetToWindow(w));
51 +static void switchNextDocumentAP(Widget w, XEvent *event, String *args,
54 + SwitchWithNextDocument(WidgetToWindow(w));
57 +static void switchPrevDocumentAP(Widget w, XEvent *event, String *args,
60 + SwitchWithPreviousDocument(WidgetToWindow(w));
63 static void capitalizeAP(Widget w, XEvent *event, String *args, Cardinal *nArgs)
65 WindowInfo *window = WidgetToWindow(w);
67 if (CheckReadOnly(window))
68 diff --quilt old/source/window.c new/source/window.c
69 --- old/source/window.c
70 +++ new/source/window.c
71 @@ -4043,10 +4043,82 @@ void LastDocument(WindowInfo *window)
72 RaiseFocusDocumentWindow(win, True);
77 +** switch current tab with next tab
79 +void SwitchWithNextDocument(WindowInfo *window)
86 + if (WindowList->next == NULL)
89 + win = getNextTabWindow(window, 1, 0, 1);
94 + win->tab = window->tab;
97 + RefreshTabState(win);
98 + RefreshTabState(window);
100 + RaiseDocument(window);
102 + nDoc = NDocuments(window);
103 + XtVaGetValues(window->tabBar, XmNtabWidgetList, &tabList, NULL);
104 + for (i = 0; i < nDoc; i++) {
105 + if (window->tab == tabList[i]) {
106 + XmLFolderSetActiveTab(window->tabBar, i, False);
113 +** switch current tab with previous tab
115 +void SwitchWithPreviousDocument(WindowInfo *window)
119 + WidgetList tabList;
122 + if (WindowList->next == NULL)
125 + win = getNextTabWindow(window, -1, 0, 1);
130 + win->tab = window->tab;
133 + RefreshTabState(win);
134 + RefreshTabState(window);
136 + RaiseDocument(window);
138 + nDoc = NDocuments(window);
139 + XtVaGetValues(window->tabBar, XmNtabWidgetList, &tabList, NULL);
140 + for (i = 0; i < nDoc; i++) {
141 + if (window->tab == tabList[i]) {
142 + XmLFolderSetActiveTab(window->tabBar, i, False);
149 ** make sure window is alive is kicking
151 int IsValidWindow(WindowInfo *window)
154 diff --quilt old/source/window.h new/source/window.h
155 --- old/source/window.h
156 +++ new/source/window.h
157 @@ -86,10 +86,12 @@ void RaiseFocusDocumentWindow(WindowInfo
158 WindowInfo *MarkLastDocument(WindowInfo *window);
159 WindowInfo *MarkActiveDocument(WindowInfo *window);
160 void NextDocument(WindowInfo *window);
161 void PreviousDocument(WindowInfo *window);
162 void LastDocument(WindowInfo *window);
163 +void SwitchWithNextDocument(WindowInfo *window);
164 +void SwitchWithPreviousDocument(WindowInfo *window);
165 int NDocuments(WindowInfo *window);
166 WindowInfo *MoveDocument(WindowInfo *toWindow, WindowInfo *window);
167 WindowInfo *DetachDocument(WindowInfo *window);
168 void MoveDocumentDialog(WindowInfo *window);
169 WindowInfo* GetTopDocument(Widget w);
170 diff --quilt old/doc/help.etx new/doc/help.etx
173 @@ -806,11 +806,13 @@ Tabbed Editing
174 interface are found under Preferences -> Default Settings -> Tabbed Editing
175 (cf. "Preferences_", also "NEdit_Command_Line_").
177 Notice that you can re-group tabs at any time by detaching and attaching them,
178 or moving them, to other windows. This can be done using the Windows menu, or
179 - using the context menu, which pops up when right clicking on a tab.
180 + using the context menu, which pops up when right clicking on a tab. You can
181 + also reorder the current tab by switching it with the left or right neighbor
182 + using the actions switch_next_document() or switch_previous_document().
184 You can switch to a tab by simply clicking on it, or you can use the keyboard.
185 The default keybindings to switch tabs (which are Ctrl+PageUp/-Down and Alt+Home,
186 see "Keyboard_Shortcuts_") can be changed using the actions previous_document(),
187 next_document() and last_document().