Hi all,

I have made a patch for help.c, which would help people having problems
with the number command. It is against screen4.0.2 (debian source).

You can try it: patch help.c, recompile and run screen.
Do:
  C-a " (window list)
  select a window
  C-a N (next, or C-a J) to put that window down
  C-a P (previous, or C-a K) to put that window up.

That way you can easily make your windows slide and order things the way
you want.

If someone know the key-codes for shift cursor up, shift cursor down, I
think we could add it too.

The code is deeply inspired from the "number" code, which seems to be
the RC_NUMBER case in process.c, line 2756.

There are still some problems: I don't understant the UTMPOK part, same
for the WindowChanged.

If someone could help me, I guess it would make screen more
user-friendly.

Thanks for your attention,

Cheers,

-- 
Xavier Nicollet
http://nicollet.jeru.org/
--- help.c      2003-09-08 16:25:33.000000000 +0200
+++ help.c.new  2005-08-24 15:00:17.818478223 +0200
@@ -37,6 +37,7 @@
 extern struct mchar mchar_blank, mchar_so;
 extern unsigned char *blank;
 extern struct win *wtab[];
+extern int maxwin;
 
 static void PadStr __P((char *, int, int, int));
 
@@ -896,6 +897,23 @@
 }
 
 static void
+exchangeWindow(wlistdata, diff) 
+struct wlistdata *wlistdata;
+int diff;
+{
+       int pos = wlistdata->pos;
+       int new = pos+diff;
+       if (new >= 0 && new < maxwin && wtab[new]) {
+               struct win *oldwin = wtab[pos];
+               wtab[pos] = wtab[new];
+               wtab[pos]->w_number = pos;
+               wtab[new] = oldwin;
+               wtab[new]->w_number = new;
+       }
+       WListMove(diff, -1); /* refresh the screen */
+}
+
+static void
 WListProcess(ppbuf, plen)
 char **ppbuf;
 int *plen;
@@ -930,6 +948,16 @@
        case 'k':
          WListMove(-1, -1);
          break;
+       
+       case 'N':
+       case 'J':
+         exchangeWindow(wlistdata, 1);
+         break;
+       case 'P':
+       case 'K':
+         exchangeWindow(wlistdata, -1);
+         break; 
+
        case 0216:      /* down */
        case 14:        /* ^N like emacs */
        case 'j':
_______________________________________________
screen-users mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to