tplumb: column numbers in file address - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit c84e737c3f64030dc9b66ddb931cac757e9ba986
DIR parent c8471ac58c0520ae9e79c4971b5df402c1390f97
HTML Author: Russ Cox <rsc@swtch.com>
Date: Wed, 27 Oct 2010 17:31:18 -0700
plumb: column numbers in file address
R=rsc
http://codereview.appspot.com/2776042
Diffstat:
M plumb/basic | 9 +++++++++
M plumb/fileaddr | 1 +
2 files changed, 10 insertions(+), 0 deletions(-)
---
DIR diff --git a/plumb/basic b/plumb/basic
t@@ -59,6 +59,15 @@ arg isfile $0
plumb to openoffice
plumb start openoffice $file
+# existing files tagged by line number:columnumber or linenumber.columnumber, go to editor
+type is text
+data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])'$twocolonaddr'
+arg isfile $1
+data set $file
+attr add addr=$2-#0+#$3
+plumb to edit
+plumb client $editor
+
# existing files, possibly tagged by line number, go to editor
type is text
data matches '([.a-zA-Z¡-0-9_/\-]*[a-zA-Z¡-0-9_/\-])('$addr')?'
DIR diff --git a/plumb/fileaddr b/plumb/fileaddr
t@@ -1,3 +1,4 @@
addrelem='((#?[0-9]+)|(/[A-Za-z0-9_\^]+/?)|[.$])'
addr=:($addrelem([,;+\-]$addrelem)*)
+twocolonaddr = :([0-9]+)[:.]([0-9]+)