* Hugo Heden had this to say on [15 Dec 2009, 11:03:39 +0100]:
[snip]
> > > Not sure this sounds like an obscure use case.. But I would love it if
> > > I could configure some visual feedback for when being in
> > > copy-scroll-back-mode.)
> >
> > Otherwise, if you really feel visual feedback is a good idea, I guess a
> > permanent blinking message in reverse video in the current status area
> > would probably do the trick and cover all the bases, even for thos who
> > do no use a caption/status line (?)
> >
> 
> Yes, that sounds reasonable, though I *think* it'd be enough with something
> that isn't actually blinking.

Something configurable sounds like a good idea to me. That way, users who
don't want to don't need to adapt to a change.

So, I decided to go with adding cruft to the caption string (sigh*). I
have added 'P' flag, which will set '%?' to true if the current window is
in copy/paste mode. So, if you want to simply change the color etc. of
your caption, prepend '%?%P%{XXX}%?' to your caption and you're set ('XXX'
stands for the usual attribute/color modifier). If, on the other hand,
you want to change the caption string in copy mode, change your caption
string to '%?%PCaption for copy mode%:Your usual caption%?'

* I sigh because (1) I really didn't want to add more cruft to the
  already-too-complicated caption string, and (2) this fix doesn't help
  someone who doesn't have a caption string.

> Something Vim like perhaps (as suggested by
> Dustin Kirkland elsewhere in this thread)? (Though I'm not sure what the
> "line number" would be helpful for.. Should the lines be counted from the
> top or the bottom of the scrollback buffer?)

A vim-like caption could indeed be useful. It can be done by, for
example, interpreting the escape sequences differently when in copy/mode.
But I really really don't want that to happen. I think it'd be much
better to leave that kind of thing to scripts (when the support for that
gets a bit more mature).

I haven't committed the changes yet, still testing (patch attached,
should someone want to try it out). Opinions?

Cheers,
Sadrul

diff --git a/src/mark.c b/src/mark.c
index ce94293..83eaed1 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -1035,6 +1035,7 @@ processchar:
                  LAY_CALL_UP(LRefreshAll(flayer, 0));
                }
              ExitOverlayPage();
+             WindowChanged(fore, 'P');
              if (append_mode)
                LMsg(0, "Appended %d characters to buffer",
                    newcopylen);
@@ -1277,6 +1278,7 @@ MarkAbort()
       rem(markdata->x1, markdata->y1, markdata->cx, markdata->cy, redisp, 
(char *)0, yend);
     }
   ExitOverlayPage();
+  WindowChanged(fore, 'P');
 }
 
 
diff --git a/src/process.c b/src/process.c
index 2874e7e..0e835f0 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2231,6 +2231,7 @@ int key;
          break;
        }
       MarkRoutine();
+      WindowChanged(fore, 'P');
       break;
     case RC_HISTORY:
       {
diff --git a/src/screen.c b/src/screen.c
index e8f4cac..10819c9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -118,6 +118,8 @@ int VBellWait, MsgWait, MsgMinWait, SilenceWait;
 extern struct acluser *users;
 extern struct display *displays, *display; 
 
+extern struct LayFuncs MarkLf;
+
 
 extern int visual_bell;
 #ifdef COPY_PASTE
@@ -2804,6 +2806,16 @@ int rec;
          if (minusflg)
            qmflag = 1;
          break;
+       case 'P':
+         p--;
+         if (display && ev && ev != &D_hstatusev)      /* Hack */
+           {
+             /* Is the layer in the current canvas in copy mode? */
+             struct canvas *cv = (struct canvas *)ev->data;
+             if (ev == &cv->c_captev && cv->c_layer->l_layfn == &MarkLf)
+               qmflag = 1;
+           }
+         break;
        case '>':
          truncpos = p - winmsg_buf;
          truncper = num > 100 ? 100 : num;
_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to