The problem
Today, we don't make any effort to use the same hats for the same tokens when we refresh the hat map. This behaviour can lead to problems where
- the hat map can shift while you're thinking / formulating a command,
- it can be distracting
- you cannot start issuing a new cursorless command while the previous one is running
- race conditions with scrolling / edits while you're starting to say a command
The issue was improved by #318, but that only works for single phrases, not continuity between phrases
The solution
We could treat hats more like a resource, the way a memory allocator treats memory blocks. Then when we go to reallocate the hat map, we only allocate new hats, or hats that have been freed from a deletion / scroll
Note: a lot of implementation might overlap with #308, and arguably this issue is a better solution to the problem that #308 attempts to solve, though #308 would allow frozen sections to persist even when off screen
Fwiw, here is some initial work: #1225 / a4802ea
The problem
Today, we don't make any effort to use the same hats for the same tokens when we refresh the hat map. This behaviour can lead to problems where
The issue was improved by #318, but that only works for single phrases, not continuity between phrases
The solution
We could treat hats more like a resource, the way a memory allocator treats memory blocks. Then when we go to reallocate the hat map, we only allocate new hats, or hats that have been freed from a deletion / scroll
Note: a lot of implementation might overlap with #308, and arguably this issue is a better solution to the problem that #308 attempts to solve, though #308 would allow frozen sections to persist even when off screen
Fwiw, here is some initial work: #1225 / a4802ea