aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/netfiles
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-03-21 05:13:45 +0000
committerrsc <devnull@localhost>2005-03-21 05:13:45 +0000
commitb1e32ef3661879a140728c4ee32b382d7c71679f (patch)
tree6b2b3427630c6b54f94c9131b6b7802c131e90aa /src/cmd/netfiles
parent8057b1ce3fa3babe186407aa2ee9fafe2ce6d836 (diff)
downloadplan9port-b1e32ef3661879a140728c4ee32b382d7c71679f.tar.gz
plan9port-b1e32ef3661879a140728c4ee32b382d7c71679f.tar.bz2
plan9port-b1e32ef3661879a140728c4ee32b382d7c71679f.zip
better expansions
Diffstat (limited to 'src/cmd/netfiles')
-rw-r--r--src/cmd/netfiles/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/cmd/netfiles/main.c b/src/cmd/netfiles/main.c
index 454b73e9..9c5f83e7 100644
--- a/src/cmd/netfiles/main.c
+++ b/src/cmd/netfiles/main.c
@@ -157,16 +157,26 @@ wintop(Win *w)
winctl(w, "show");
}
+int
+isdot(Win *w, uint xq0, uint xq1)
+{
+ uint q0, q1;
+
+ winctl(w, "addr=dot");
+ q0 = winreadaddr(w, &q1);
+ return xq0==q0 && xq1==q1;
+}
+
/*
* Expand the click further than acme usually does -- all non-white space is okay.
*/
char*
expandarg(Win *w, Event *e)
{
- if(e->c2 == 'l')
+ if(e->c2 == 'l') /* in tag - no choice but to accept acme's expansion */
return estrdup(e->text);
dprint("expand %d %d %d %d\n", e->oq0, e->oq1, e->q0, e->q1);
- if(e->oq0 == e->oq1 && e->q0 != e->q1)
+ if(e->oq0 == e->oq1 && e->q0 != e->q1 && !isdot(w, e->q0, e->q1))
winaddr(w, "#%ud+#1-/[^ \t\\n]*/,#%ud-#1+/[^ \t\\n]*/", e->q0, e->q1);
else
winaddr(w, "#%ud,#%ud", e->q0, e->q1);