aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2010-10-27 17:31:18 -0700
committerRuss Cox <rsc@swtch.com>2010-10-27 17:31:18 -0700
commitc84e737c3f64030dc9b66ddb931cac757e9ba986 (patch)
treeabcb771d8d7b70997319e08acaff936325c8ed3e
parentc8471ac58c0520ae9e79c4971b5df402c1390f97 (diff)
downloadplan9port-c84e737c3f64030dc9b66ddb931cac757e9ba986.tar.gz
plan9port-c84e737c3f64030dc9b66ddb931cac757e9ba986.tar.bz2
plan9port-c84e737c3f64030dc9b66ddb931cac757e9ba986.zip
plumb: column numbers in file address
R=rsc http://codereview.appspot.com/2776042
-rw-r--r--plumb/basic9
-rw-r--r--plumb/fileaddr1
2 files changed, 10 insertions, 0 deletions
diff --git a/plumb/basic b/plumb/basic
index c89b6c2d..d40f6a4b 100644
--- a/plumb/basic
+++ b/plumb/basic
@@ -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')?'
diff --git a/plumb/fileaddr b/plumb/fileaddr
index 0f08dc3e..cd2f120f 100644
--- a/plumb/fileaddr
+++ b/plumb/fileaddr
@@ -1,3 +1,4 @@
addrelem='((#?[0-9]+)|(/[A-Za-z0-9_\^]+/?)|[.$])'
addr=:($addrelem([,;+\-]$addrelem)*)
+twocolonaddr = :([0-9]+)[:.]([0-9]+)