Jason Lee
6ca9ac46fa
chore: Bump crate version. ( #1340 )
2025-10-09 15:20:34 +08:00
Floyd Wang
66851c55e4
Bump gpui ( #1336 )
2025-10-08 11:20:06 +08:00
Jason Lee
4983300ddf
input: Update RopeExt to use LF style for get correct line when have \r. ( #1296 )
2025-09-28 01:04:14 +08:00
Jason Lee
328da4da21
input: Fix RopeExt replace method may not on a char boundary. ( #1295 )
2025-09-26 22:27:44 +08:00
Jason Lee
9f1423324a
editor: Improve slice_line method performance. ( #1290 )
...
Now we can handle more than 200K lines (before is 150K).
2025-09-25 18:54:06 +08:00
Jason Lee
ef1d727c3d
chore: Improve RopeExt API and add more docs. ( #1289 )
2025-09-25 18:17:46 +08:00
Jason Lee
1c3eca93b8
editor: Revert to use ropey. ( #1284 )
...
For the License reason.
- The performance is slow down, before version can handle 200K lines,
now 150K lines is good.
2025-09-24 20:52:18 +08:00
Jason Lee
993ce34bd8
editor: Avoid scroll on select all. ( #1277 )
...
- Add `replace_text_in_range_silent` for some case to avoid show
completion, for example on cut, paster ...
- Improve to only call validation, mask on single line mode.
- Improve move cursor to scroll to visible to keep edge 3 lines.
https://github.com/user-attachments/assets/ca8bcca8-a55b-4c98-af7c-7639d1c34923
- Fix `RopeExt::offset_to_position` may crash.
- Add deffered_scroll_offset to improve paste to scroll to cursor.
https://github.com/user-attachments/assets/1af09a50-37f0-47c8-8185-4b78820d064a
2025-09-23 15:59:48 +08:00
Jason Lee
62e3f8126a
inspector: Add to support auto complete. ( #1272 )
...
<img width="1273" height="1138" alt="image"
src="https://github.com/user-attachments/assets/52a474c3-b936-468e-b56d-e3f0a4e3104d "
/>
2025-09-22 18:36:46 +08:00
Jason Lee
6a817d6a05
editor: Add to support HoverPopover. ( #1260 )
...
<img width="725" height="631" alt="image"
src="https://github.com/user-attachments/assets/0f4aba90-82cc-43c8-916b-b4a446b8abae "
/>
2025-09-18 18:18:54 +08:00
Jason Lee
f1b6d7c5ed
editor: Add completion, code_action provider. ( #1242 )
2025-09-15 19:25:02 +08:00
Jason Lee
da85754b96
input: Refactor diagnostics. ( #1240 )
...
<img width="613" height="530" alt="image"
src="https://github.com/user-attachments/assets/be86658d-706c-411c-8ba6-09b495208051 "
/>
## Break Changes
- The `Markers` has been renamed to use `Diagnostics`.
- The `input::LineNumber` has renamed to `input::Position` and changed
from 1-based to use 0-based.
- Renamed `go_to_line` to `set_cursor_position`, `line_column` to
`cursor_position`.
```diff
- pub fn line_column(&self) -> LineColumn
+ pub fn cursor_position(&self) -> Position
- pub fn go_to_line(&mut self, line: usize, column: Option<usize>, window: &mut Window, cx: &mut Context<Self>)
+ pub fn set_cursor_position(&mut self, position: impl Into<Position>, window: &mut Window, cx: &mut Context<Self>)
```
2025-09-11 16:54:40 +08:00
Jason Lee
3fa996c331
input: Fix line column by use chars offset. ( #1239 )
...
- Add autocorrect to markdown example for test `markers`.
<img width="1104" height="590" alt="image"
src="https://github.com/user-attachments/assets/03103088-e828-4039-82b0-c816d5f36141 "
/>
2025-09-10 20:56:15 +08:00
Jason Lee
2a918bf4de
input: Improve TextWrapper data structure. ( #1237 )
2025-09-10 18:52:35 +08:00
Jason Lee
03c2327cdb
input: Improve Input performance by only shape visible lines. ( #1222 )
...
Close #1193
Ref issue #1220
This PR aim to shape text in visible ranges to reduce `shape_text` time
for large document case.
- Fix rendering might be delayed and cause blanks when scrolling to
follow the selection.
- Fix `RopeExt::lines` method to avoid call `line` method on skipped
iter.
2025-09-09 14:41:52 +08:00
Floyd Wang
84b2d2a6f5
plot(scale): Add least index support for linear ( #1225 )
2025-09-09 11:40:09 +08:00
Jason Lee
a9953a9349
input: Use zed's Rope ( #1214 )
...
Now with 10K lines plain text, in release mode on macOS. The
`large-text` example can work with:
- 120 FPS for display.
- 90 FPS for update text.
```
MTL_HUD_ENABLED=1 cargo run --example large-text --release
```
- Fixed the cursor position at end of line, also support at start of
line.
https://github.com/user-attachments/assets/1de52f6c-e138-4ed3-a600-06372a807ed8
### Check list
- [x] Modifying Text with Rope
- [x] LineColumn, GoToLine
- [x] Code Highlight
- [x] Delete word, select word
- [x] Delete line
- [x] Move left, right, up, down
2025-09-08 16:44:52 +08:00
Jason Lee
f35398d797
input: Fix some Rope method call will crash. ( #1213 )
2025-09-05 19:09:46 +08:00
Jason Lee
344e4407ff
input: Use Rope for InputState. ( #1208 )
...
This PR to change the Input to use
[ropey](https://github.com/cessen/ropey ) to store the text.
## Break Changes
- The `value` method of `InputState` now returns a `SharedString` type.
```diff
- pub fn value(&self) -> &SharedString
+ pub fn value(&self) -> SharedString
```
Ref links:
- https://github.com/cessen/ropey
- https://zed.dev/blog/zed-decoded-rope-sumtree
- https://github.com/helix-editor/helix/blob/master/docs/architecture.md
2025-09-05 18:20:47 +08:00