summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2013-11-22 19:19:37 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2013-11-22 19:19:37 +0100
commit91c7e0b127ef494b151fae81d80885fd3d306dc5 (patch)
treea4da92df2f7c799f61a309f44e85a49d897dd25e
parent66fea232bca25bcf07d2f70c4ee45d2c82f6f5e7 (diff)
downloadplan9front-91c7e0b127ef494b151fae81d80885fd3d306dc5.tar.xz
acme: fix arrow key oddity (thanks mark van atten and erik)
from 9atom/acmearrowfun patch: reported by mark van atten In Plan 9 acme, if you type {} then go back and type text between the brackets {Curiouser and curiouser!} the right arrow is blocked when you want to go over the closing bracket to continue typing to its right. (If you first go to the left, and then back to the right, it works.) Same for the other brackets: [ ], ( ), < >. noted that brackets are not necessary. same behavior with any character. fix is to textcommit before moving.
-rw-r--r--sys/src/cmd/acme/text.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/src/cmd/acme/text.c b/sys/src/cmd/acme/text.c
index 439e5ec78..eda8f10de 100644
--- a/sys/src/cmd/acme/text.c
+++ b/sys/src/cmd/acme/text.c
@@ -649,16 +649,14 @@ texttype(Text *t, Rune r)
rp = &r;
switch(r){
case Kleft:
- if(t->q0 > 0){
- typecommit(t);
+ typecommit(t);
+ if(t->q0 > 0)
textshow(t, t->q0-1, t->q0-1, TRUE);
- }
return;
case Kright:
- if(t->q1 < t->file->nc){
- typecommit(t);
+ typecommit(t);
+ if(t->q1 < t->file->nc)
textshow(t, t->q1+1, t->q1+1, TRUE);
- }
return;
case Kdown:
n = t->maxlines/3;