Introduction
Introduction Statistics Contact Development Disclaimer Help
Allow ^ as bol address command - sam - An updated version of the sam text edito…
git clone git://vernunftzentrum.de/sam.git
Log
Files
Refs
LICENSE
---
commit 697a5f25e51a4077ebc2078d8b5fee038016e6b1
parent 51693780fb1457913389db6634163998f9b775b8
Author: Christian Kellermann <[email protected]>
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(-)
---
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)
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:
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 ; */
You are viewing proxied material from vernunftzentrum.de. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.