diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-02-09 22:54:09 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-02-09 22:57:37 -0800 |
commit | 7d400217994c573153fda0e4a28542c75ace3997 (patch) | |
tree | 257e9a3603898c4b447dd007c6e06228c192d5f3 /apps/ex2.subx | |
parent | 1969febce5c3043de55b5e28da2f38ca08d17562 (diff) | |
download | mu-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.subx')
0 files changed, 0 insertions, 0 deletions