Allow ^ as bol address command - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 697a5f25e51a4077ebc2078d8b5fee038016e6b1
(DIR) parent 51693780fb1457913389db6634163998f9b775b8
(HTM) Author: Christian Kellermann <ckeen@pestilenz.org>
Date: Mon, 12 Mar 2018 16:14:26 +0100
Allow ^ as bol address command
Diffstat:
sam/address.c | 8 ++++++--
sam/cmd.c | 1 +
sam/parse.h | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/sam/address.c b/sam/address.c
@@ -44,7 +44,12 @@ address(Addr *ap, Address a, int sign)
nextmatch(f, ap->are, sign>=0? a.r.p2 : a.r.p1, sign);
a.r = sel.p[0];
break;
-
+ case '^':
+ a1 = lineaddr(0L,a,-1);
+ a.r.p1 = a1.r.p1;
+ a.r.p2 = f->dot.r.p2;
+ return a;
+ break;
case '"':
a = matchfile(ap->are)->dot;
f = a.f;
@@ -55,7 +60,6 @@ address(Addr *ap, Address a, int sign)
case '*':
a.r.p1 = 0, a.r.p2 = f->nrunes;
return a;
-
case ',':
case ';':
if(ap->left)
(DIR) diff --git a/sam/cmd.c b/sam/cmd.c
@@ -555,6 +555,7 @@ simpleaddr(void)
case '+':
case '-':
case '\'':
+ case '^':
addr.type = getch();
break;
default:
(DIR) diff --git a/sam/parse.h b/sam/parse.h
@@ -5,7 +5,7 @@ typedef struct Addr Addr;
typedef struct Cmd Cmd;
struct Addr
{
- char type; /* # (char addr), l (line addr), / ? . $ + - , ; */
+ char type; /* # (char addr), l (line addr), / ? . $ + - , ; ^ */
union{
String *re;
Addr *aleft; /* left side of , and ; */