about summary refs log tree commit diff stats
path: root/apps/ex2
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-09 22:54:09 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-09 22:57:37 -0800
commit7d400217994c573153fda0e4a28542c75ace3997 (patch)
tree257e9a3603898c4b447dd007c6e06228c192d5f3 /apps/ex2
parent1969febce5c3043de55b5e28da2f38ca08d17562 (diff)
downloadmu-7d400217994c573153fda0e4a28542c75ace3997.tar.gz
7708 - baremetal/shell: word data structure
Not everything here is tested, but enough that I'm starting to feel confident.

We see our first divergence with apps/tile. In apps/tile we render everything,
then go back and figure out where to position the cursor. This relies on
some low-level smarts and is also quite klunky and complex.

In baremetal/shell I plan to do something simpler: maintain a tree of objects
where each level knows which sub-object under it has the cursor. Now I
can pass in the cursor object to each object, and if it detects that it
has the cursor it can recursively figure out which sub-object has the cursor.
The bottom-most objects (grapheme stacks) draw the cursor as they render
themselves. Single-pass algorithm, draw the cursor as you render, no low-level
smarts needed.

But there's a divergence. What in apps/tile used to look like this, with
a cursor ␣ at the end of the word 'abc':

  abc␣def

..now looks like this:

  abc␣ def

..with an extra space.

This could cause some jarring 'dancing' as you move the cursor through a
list of words.
Diffstat (limited to 'apps/ex2')
0 files changed, 0 insertions, 0 deletions
committer Michael Vetter <jubalh@iodoru.org> 2020-07-07 09:43:28 +0200 Apply coding style' href='/danisanti/profani-tty/commit/src/plugins/disco.c?id=9b55f2dec0ea27a9ce4856e303425e12f866cea2'>9b55f2de ^
a4cadf78 ^
623fbe9e ^


9945246a ^
a2726b6a ^
9945246a ^

a2726b6a ^
a65403c5 ^

a2726b6a ^
a65403c5 ^
9945246a ^
a65403c5 ^
623fbe9e ^

a2726b6a ^
623fbe9e ^
a65403c5 ^
623fbe9e ^


9945246a ^


a65403c5 ^



a2726b6a ^
9945246a ^
















a65403c5 ^
a2726b6a ^
9945246a ^


a65403c5 ^



a2726b6a ^
a65403c5 ^
9945246a ^


a65403c5 ^



a2726b6a ^
9945246a ^
a65403c5 ^


a2726b6a ^

9945246a ^
a2726b6a ^
9945246a ^
a2726b6a ^
9945246a ^











623fbe9e ^




9945246a ^

a65403c5 ^

9945246a ^
623fbe9e ^




9945246a ^




a65403c5 ^


623fbe9e ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152