Skip to content
New issue

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

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

Already on GitHub? # to your account

replace tui-textarea with a custom textarea / fork #55

Open
achristmascarl opened this issue Sep 3, 2024 · 0 comments
Open

replace tui-textarea with a custom textarea / fork #55

achristmascarl opened this issue Sep 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@achristmascarl
Copy link
Owner

achristmascarl commented Sep 3, 2024

description

currently, rainfrog uses tui-textarea for the query editor. it's a great library with a lot of features, however, there are a few limitations:

  • syntax highlighting is currently not supported, so we use a hacky regex and the tui-textarea's search feature to do it. this is not very performant and also is not a great experience
  • some internal offsets are not currently exposed, making it hard to do things like auto-completion overlays / popups
  • the cursor's end-of-line behavior and insert-mode behavior is different from vim's, making some elements of vim emulation tricky

proposed solution

check out https://docs.rs/rat-widget/latest/rat_widget/textarea/struct.TextArea.html as a potential replacement. however, the library (rat-widget) is still in alpha and doesn't have much of a test suite, so although it has more flexibility, it may not be as reliable yet.

or, stick with tui-textarea, and instead of incrementally requesting desired features in tui-textarea, either make a fork and implement:

or, wait for rhysd/tui-textarea#82 to be resolved, and layer in inlays/overlays/syntax highlighting on top of tui-textarea. i think it's possible, but the syntax highlighting implementation might be a little hacky

@achristmascarl achristmascarl added the enhancement New feature or request label Sep 3, 2024
This was referenced Sep 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant