Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make hat allocations more stable #432

Closed
pokey opened this issue Jan 7, 2022 · 0 comments · Fixed by #1225
Closed

Make hat allocations more stable #432

pokey opened this issue Jan 7, 2022 · 0 comments · Fixed by #1225
Labels
enhancement New feature or request

Comments

@pokey
Copy link
Member

pokey commented Jan 7, 2022

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

@pokey pokey added the enhancement New feature or request label Jan 7, 2022
@pokey pokey mentioned this issue Jan 12, 2023
4 tasks
AndreasArvidsson pushed a commit that referenced this issue Feb 4, 2023
- Fixes #432 

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] Add test for case where enabled hat styles change, both adding or
removing an enabled hat style
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
cursorless-bot pushed a commit that referenced this issue Feb 10, 2023
- Fixes #432 

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] Add test for case where enabled hat styles change, both adding or
removing an enabled hat style
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this issue Mar 27, 2024
- Fixes cursorless-dev#432 

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] Add test for case where enabled hat styles change, both adding or
removing an enabled hat style
- [ ] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant