commit 0cd5cec
ohmu
·
2026-07-17 23:15:41 +0300 MSK
parent dd00cef
fixed backspace bug; added emacs-like keys(but with ctrl) for movement; autocomplete now on ctrl+D/insert
2 files changed,
+8,
-4
+1,
-1
1@@ -47,7 +47,7 @@ rowinit(Row *row, Rectangle r)
2 t->col = nil;
3 r1.min.y = r1.max.y;
4 r1.max.y += Border;
5- draw(screen, r1, bordercol, nil, ZP);
6+ draw(screen, r1, bordercol, nil, ZP);
7 textinsert(t, 0, Lcolhdr, 29, TRUE);
8 textsetselect(t, t->file->b.nc, t->file->b.nc);
9 }
+7,
-3
1@@ -682,11 +682,13 @@ texttype(Text *t, Rune r)
2 rp = &r;
3 switch(r){
4 case Kleft:
5+ case 0x02: /* Ctrl + B */
6 typecommit(t);
7 if(t->q0 > 0)
8 textshow(t, t->q0-1, t->q0-1, TRUE);
9 return;
10 case Kright:
11+ case 0x06: /* Ctrl+F */
12 typecommit(t);
13 if(t->q1 < t->file->b.nc)
14 textshow(t, t->q1+1, t->q1+1, TRUE);
15@@ -722,6 +724,7 @@ texttype(Text *t, Rune r)
16 */
17
18 case Kdown:
19+ case 0x0E: /* Ctrl+N */
20 if(t->what == Tag)
21 goto Tagdown;
22 typecommit(t);
23@@ -751,6 +754,7 @@ texttype(Text *t, Rune r)
24 textshow(t, q0, q0, TRUE);
25 return;
26 case Kup:
27+ case 0x10: /* Ctrl+P */
28 if(t->what == Tag)
29 goto Tagup;
30 typecommit(t);
31@@ -892,8 +896,8 @@ texttype(Text *t, Rune r)
32 return;
33 case 0x08: /* Backspace */
34 typecommit(t);
35- if(t->q0 == 0) return;
36 if(t->q0 == t->q1){
37+ if(t->q0 == 0) return;
38 q0 = t->q0 - 1;
39 q1 = t->q0;
40 } else {
41@@ -930,8 +934,8 @@ texttype(Text *t, Rune r)
42 textshow(t, t->q0, t->q0, 1);
43
44 switch(r){
45- case 0x06: /* ^F: complete */
46 case Kins:
47+ case 0x04:
48 typecommit(t);
49 rp = textcomplete(t);
50 if(rp == nil)
51@@ -955,7 +959,7 @@ texttype(Text *t, Rune r)
52 * apparently it works like ^U and erases whole lines. i should learn c
53 */
54
55- case 0x0C:
56+ case 0x02:
57 typecommit(t);
58 q0 = 0;
59 q1 = t->file->b.nc;