Commit Graph

12 Commits (42619d764626049da36effb2b38e719e26128d30)

Author SHA1 Message Date
Michael Davis 42619d7646
wip core 2025-06-07 09:06:21 -04:00
Michael Davis 5d641b1722
Adapt stdx 2025-06-06 18:25:53 -04:00
Michael Davis 20151a5594
Move rope grapheme iterators from core to stdx 2025-01-27 09:24:40 -05:00
Michael Davis 39b72329b4
stdx: Add floor/ceil/is grapheme boundary functions to RopeSliceExt
These functions are the equivalent of 23b424a46 for grapheme clusters.
In order to add the `is_grapheme_boundary` function we also need to
query whether a byte index lies on a character boundary, so this change
also adds `is_char_boundary`.
2025-01-27 09:24:40 -05:00
Michael Davis 360c6bb061
stdx: Replace RopeSliceExt::byte_to_next_char with ceil_char_boundary
The new `RopeSliceExt::ceil_char_boundary` from the parent commits can
be used to implement `RopeSliceExt::byte_to_next_char` when used with
`RopeSlice::byte_to_char`. That function had only one caller and that
caller will eventually disappear when we switch to Ropey v2 and drop
character indexing, so we can drop `byte_to_next_char` now and replace
its caller with `byte_to_char` plus `ceil_char_boundary`.

This change keeps the unit tests for `byte_to_next_char` and checks them
against a polyfill of `byte_to_char` plus `ceil_char_boundary` to ensure
that `byte_to_next_char`'s intended behavior is not changed.
2025-01-26 11:11:53 -05:00
Michael Davis 23b424a46d
stdx: Add floor/ceil char boundary functions to RopeSliceExt
These functions mimic `str::floor_char_boundary` and
`str::floor_char_boundary` (currently unstable under
`round_char_boundary`). They're useful for correcting a byte index
which may not lie on a character boundary. For example you might limit
a search within a slice to some fixed number of bytes. The fixed number
might not lie on a boundary though so it needs to be corrected to
either the earlier (floor) or later (ceil) boundary.
2025-01-26 11:10:24 -05:00
Rolo c1d382a532 fix(lints): clippy 1.84 2025-01-23 15:18:16 -05:00
rhogenson 5717aa8e35
Fix Rope.starts_with. (#11739)
Co-authored-by: Rose Hogenson <rosehogenson@posteo.net>
2024-09-21 23:05:17 +09:00
Pascal Kuthe 73d26d0d97
don't manually grapheme align ts highlights (#10310) 2024-04-11 00:14:08 +09:00
Gabriel Dinner-David 26b3dc29be
toggling of block comments (#4718) 2024-02-27 22:36:25 +09:00
Pascal Kuthe cd02976fa3
switch to regex-cursor (#9422) 2024-02-26 16:45:20 +09:00
Pascal Kuthe 8e592a151f refactor completion and signature help using hooks 2024-01-23 11:20:19 +09:00