summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2009-12-15 12:59:18 -0500
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2009-12-15 12:59:18 -0500
commit1e4fb57b49754618dc147f397a8a72483fd6c419 (patch)
tree7e7c233537474b3469e185363f738597e20b9de4
parent0dc3a24b7bd949dc2c1709416b580828baea5b5f (diff)
downloadscreen-1e4fb57b49754618dc147f397a8a72483fd6c419.tar.gz
Allow adding visual notification in caption string.
'%P' in caption string will set '%?' to true if the current region 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%?'.
-rw-r--r--src/ChangeLog1
-rw-r--r--src/doc/screen.12
-rw-r--r--src/doc/screen.texinfo2
-rw-r--r--src/mark.c2
-rw-r--r--src/process.c1
-rw-r--r--src/screen.c12
6 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 80d400b..0dfb9a6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -47,6 +47,7 @@ Version 4.1.0 (??/??/20??):
* '%p' in caption/hardstatus string expands to the PID of the backend, and
'%+p' expands to the PID of the frontend (display).
* '%S' in caption/hardstatus string expands to the session name.
+ * '%P' in the caption string evaluates to true if the region is in copy mode.
Window List:
* Nested views when there are window groups (with 'windowlist -g').
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index e37c4cc..a811379 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -3336,6 +3336,8 @@ month number
month name
.IP n
window number
+.IP P
+sets %? to true if the current region is in copy/paste mode
.IP S
session name
.IP s
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index 6228cd4..5e265aa 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -5193,6 +5193,8 @@ month number
month name
@item n
window number
+@item P
+sets %? to true if the current region is in copy/paste mode
@item s
seconds
@item S
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;