passthrough unmatched keys

This commit is contained in:
2026-05-28 23:38:23 +09:00
parent 795353609b
commit 7e69827c13
3 changed files with 6 additions and 9 deletions

1
ko.c
View File

@@ -203,7 +203,6 @@ transko(Im *im, Rune c)
e.s = im->pre;
sclear(&im->pre);
}
sputr(&e.s, c);
return e;
}

View File

@@ -185,10 +185,8 @@ transmap(Im *im, Rune c)
e.s = im->pre;
sclear(&key);
sputr(&key, c);
if(!maplookup(t, &key, &e.dict)){
sputr(&e.s, c);
if(!maplookup(t, &key, &e.dict))
return e;
}
e.eat = 1;
sputr(&e.next, c);
return e;
@@ -273,14 +271,16 @@ keystroke(u32int ks, u32int mod, Str *com)
return 1;
}
if(ks > 0x7f || ks == ' '){
if(im.pre.n == 0)
return 0;
commit(com);
sputr(com, ks);
reset();
return 1;
}
dotrans(ks, com);
n = dotrans(ks, com);
show();
return 1;
return n;
}
static void

4
vi.c
View File

@@ -101,10 +101,8 @@ transvi(Im *im, Rune c)
return transmap(im, c);
memset(&e, 0, sizeof e);
if(im->pre.n == 0){
sputr(&e.s, c);
if(im->pre.n == 0)
return e;
}
if(im->pre.r[im->pre.n - 1] == '\\'){
pre = im->pre;
pre.n--;