diff options
author | rsc <devnull@localhost> | 2005-03-18 19:33:32 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-03-18 19:33:32 +0000 |
commit | 3b33df997f7f6a7ed9ffe39908ded3861b1dc0d4 (patch) | |
tree | f171f208ef9a02abba7ac167e47c0cf24614b128 /src | |
parent | f334d7563298445ff07b1317a98150ed393769c0 (diff) | |
download | plan9port-3b33df997f7f6a7ed9ffe39908ded3861b1dc0d4.tar.gz plan9port-3b33df997f7f6a7ed9ffe39908ded3861b1dc0d4.tar.bz2 plan9port-3b33df997f7f6a7ed9ffe39908ded3861b1dc0d4.zip |
better tag handling in dollars
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/acme/wind.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cmd/acme/wind.c b/src/cmd/acme/wind.c index 66edbc80..802a38db 100644 --- a/src/cmd/acme/wind.c +++ b/src/cmd/acme/wind.c @@ -349,13 +349,26 @@ winsettag1(Window *w) runemove(tagname, w->body.file->name, ntagname); abbrevenv(&tagname, &ntagname); + /* + * XXX Why is this here instead of letting the code + * down below do the work? + */ if(runeeq(old, i, tagname, ntagname) == FALSE){ + q0 = w->tag.q0; + q1 = w->tag.q1; textdelete(&w->tag, 0, i, TRUE); textinsert(&w->tag, 0, tagname, ntagname, TRUE); free(old); old = runemalloc(w->tag.file->b.nc+1); bufread(&w->tag.file->b, 0, old, w->tag.file->b.nc); old[w->tag.file->b.nc] = '\0'; + if(q0 >= i){ + /* + * XXX common case - typing at end of name + */ + w->tag.q0 = q0+ntagname-i; + w->tag.q1 = q1+ntagname-i; + } } /* compute the text for the whole tag, replacing current only if it differs */ |