summaryrefslogtreecommitdiff
path: root/src/mark.c
diff options
context:
space:
mode:
authorjnweiger <jnweiger>2005-12-16 18:41:15 +0000
committerjnweiger <jnweiger>2005-12-16 18:41:15 +0000
commitf78f9e82605ea683021b074c23524c5c4d3d7aea (patch)
treef6e071cbf6c24d668a0b5ba35f8efe7848a21076 /src/mark.c
parentb3e7420c1fe103e5a3d71c3b74cf0843bee23317 (diff)
downloadscreen-f78f9e82605ea683021b074c23524c5c4d3d7aea.tar.gz
old version screen-3.9.15 Mar 13 2003
Diffstat (limited to 'src/mark.c')
-rw-r--r--src/mark.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mark.c b/src/mark.c
index dbc67d7..2f6d36e 100644
--- a/src/mark.c
+++ b/src/mark.c
@@ -144,11 +144,13 @@ int y;
* NW_BACK: search backward
* NW_ENDOFWORD: find the end of the word
* NW_MUSTMOVE: move at least one char
+ * NW_BIG: match WORDs not words
*/
#define NW_BACK (1<<0)
#define NW_ENDOFWORD (1<<1)
#define NW_MUSTMOVE (1<<2)
+#define NW_BIG (1<<3)
static void
nextword(xp, yp, flags, num)
@@ -168,6 +170,8 @@ int *xp, *yp, flags, num;
{
if (x >= xx || x < 0)
q = 0;
+ else if (flags & NW_BIG)
+ q = ml->image[x] == ' ';
else
q = is_letter(ml->image[x]);
if (oq >= 0 && oq != q)
@@ -282,7 +286,7 @@ char *pt;
c |= cf << 8;
if (c == UCS_HIDDEN)
continue;
- c = ToUtf8(pt, c);
+ c = ToUtf8_comb(pt, c);
l += c;
if (pt)
pt += c;
@@ -293,6 +297,7 @@ char *pt;
if (is_dw_font(cf))
{
c = c << 8 | (unsigned char)*im++;
+ fo++;
j++;
}
# endif
@@ -702,15 +707,17 @@ int *inlenp;
revto(cx, cy);
break;
case 'e':
+ case 'E':
if (rep_cnt == 0)
rep_cnt = 1;
- nextword(&cx, &cy, NW_ENDOFWORD|NW_MUSTMOVE, rep_cnt);
+ nextword(&cx, &cy, NW_ENDOFWORD|NW_MUSTMOVE | (od == 'E' ? NW_BIG : 0), rep_cnt);
revto(cx, cy);
break;
case 'b':
+ case 'B':
if (rep_cnt == 0)
rep_cnt = 1;
- nextword(&cx, &cy, NW_BACK|NW_ENDOFWORD|NW_MUSTMOVE, rep_cnt);
+ nextword(&cx, &cy, NW_BACK|NW_ENDOFWORD|NW_MUSTMOVE | (od == 'B' ? NW_BIG : 0), rep_cnt);
revto(cx, cy);
break;
case 'a':
@@ -1156,6 +1163,10 @@ int isblank;
if (markdata->second == 0)
{
+ if (dw_right(ml, xs, fore->w_encoding) && xs > 0)
+ xs--;
+ if (dw_left(ml, xe, fore->w_encoding) && xe < fore->w_width - 1)
+ xe++;
if (xs == 0 && y > 0 && wy > 0 && WIN(wy - 1)->image[flayer->l_width] == 0)
LCDisplayLineWrap(flayer, ml, y, xs, xe, isblank);
else