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

feat: use ropey as text buffer backend #20

Merged
merged 20 commits into from
Mar 1, 2025
Merged

feat: use ropey as text buffer backend #20

merged 20 commits into from
Mar 1, 2025

Conversation

yamgent
Copy link
Owner

@yamgent yamgent commented Feb 16, 2025

Closes #1.

  • Check text_box_impl.rs (continue from remove_character()
  • Simply TextBuffer interface before introducing ropey.
    • Note: We definitely need line() returning a String, some data structures can't really return a &str, including rope buffers, as a line content is not guaranteed to be in a contiguous memory space.
    • Maybe write the above finding as a doc-comment.
  • Actually integrate ropey.
  • Fix ropey crash if try to insert after the last line.
  • Implement search for ropey
  • Add tests for VecTextBuffer
  • Add tests for RopeTextBuffer
  • Currently will crash if we start with a new buffer, enter text "abc", then try to search for "aaa". Fix this.
  • Add tests for TextBox (added to Add tests #5).
  • Check TODOs
  • Check pub visibility
  • get_line_len() in TextBox is confusing, because it is not clear whether it is talking about the byte_len, or fragment_len (the actual length for this method). We should clean it up (added to Tidy up TextLine usage #23).
  • Explore exposing char_cursor() if necessary (efficient way of traversing through characters in a line) (not needed for now)

@yamgent yamgent force-pushed the ropey branch 2 times, most recently from 9345247 to 3385133 Compare February 16, 2025 12:46
@yamgent yamgent mentioned this pull request Feb 16, 2025
2 tasks
If the cursor is directly at the first letter of the word, that word's
instance should be ignored. Otherwise, we can never traverse backwards
in a search, because the textbox does not manually subtract one from
the cursor position (and it should never need to, since there can be
troublesome edge cases that should be handled by the text buffer, rather
than by the textbox).
@yamgent yamgent marked this pull request as ready for review February 27, 2025 14:10
@yamgent yamgent merged commit e84f626 into main Mar 1, 2025
4 checks passed
@yamgent yamgent deleted the ropey branch March 1, 2025 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ropey for text buffers
1 participant