Sunli
34b570cd8f
text_view: Refactor TextView, SyntaxHighlighter to use async to parsing. ( #1299 )
...
1. Parse content in the background thread
2. Remove unnecessary clones
3. `TextViewStyle` and `LanguageRegistry` can now be used across threads
2025-09-29 14:04:24 +08:00
Sunli
3413c33d1c
chore: use async-wry ( #1300 )
2025-09-29 13:32:12 +08:00
Jason Lee
3ee8d7ffd2
input: Fix input mark text render. ( #1298 )
...
Fix #1293 change broken the input mask render (password mask,
placeholder ...)
2025-09-29 10:40:39 +08:00
Jason Lee
172015f147
input: Use shape line for soft wrap lines. ( #1293 )
...
This change aim to fix the before version `shape_text` (in Element
paint) and `wrap_line` (in TextWrapper cached soft wrap map) may have
difference wrap width.
Now move to based on TextWrapper's wrap map to paint text by use
`shape_line` method.
2025-09-28 10:31:03 +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
13e2b08873
editor: Improve line number width by max lines. ( #1291 )
2025-09-25 22:21:09 +08:00
Jason Lee
6b7a481fc8
editor: Improve TextWrapper performance. ( #1292 )
2025-09-25 20:02:17 +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
512f46aec8
text_view: Add to support custom code block style. ( #1288 )
...
And remove bg, padding for editor hover code blocks.
<img width="589" height="214" alt="image"
src="https://github.com/user-attachments/assets/55870f2f-e49e-4c2d-8899-9aa7edd17630 "
/>
2025-09-25 17:11:14 +08:00
Jason Lee
a6a14fd57b
input: Disable context menu item for disabled input. ( #1280 )
2025-09-25 16:36:57 +08:00
Jason Lee
16105da122
editor: Avoid trigger hover on selection. ( #1287 )
2025-09-25 15:50:12 +08:00
Jason Lee
8f5bff61fb
chore: Fix sum_tree API changes. ( #1286 )
...
https://github.com/zed-industries/zed/pull/38776
2025-09-25 10:41:37 +08:00
Jason Lee
5aaf8c6a66
input: Fix move cursor to scroll x to viewport. ( #1285 )
2025-09-24 21:15:13 +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
ca8d595936
editor: Fix line number to use same editor background. ( #1282 )
2025-09-24 14:14:32 +08:00
Jason Lee
bd3bffaf67
editor: Fix completion width align to longest item. ( #1281 )
2025-09-24 11:43:59 +08:00
Jason Lee
bf5650b5db
input: Add context menu for cut, copy, paste. ( #1279 )
...
Close #27
<img width="756" height="674" alt="image"
src="https://github.com/user-attachments/assets/07884a7e-366b-47b8-8bd7-a88f3cae52b8 "
/>
2025-09-23 22:06:58 +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
Floyd Wang
4b3731bf14
divider: Remove the horizontal divider full width style ( #1278 )
2025-09-23 13:46:35 +08:00
Jason Lee
d4f51f3135
theme: Fix Ayu theme. ( #1276 )
...
<img width="1115" height="940" alt="image"
src="https://github.com/user-attachments/assets/cce54665-a9b5-446b-aaef-447ed7265c27 "
/>
2025-09-23 11:16:26 +08:00
Jason Lee
9febc52387
kbd: Fix byte slice crash. ( #1275 )
2025-09-23 09:47:32 +08:00
Jason Lee
455605d64b
menu: Fix to support keyboard to select menu items. ( #1263 )
...
- And add to support scroll to selected item.
---------
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
2025-09-22 21:47:30 +08:00
Jason Lee
c80704d4d8
input: Fix invalid vertical scroll in single line mode. ( #1273 )
2025-09-22 19:47:47 +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
f93e9a9475
editor: Change to pass cursor as offset for completions method. ( #1271 )
...
And to support `filter_text` as completion item highlight match.
2025-09-22 16:29:51 +08:00
Jason Lee
62748aad9b
editor: Update CompletionProvider return type. ( #1270 )
2025-09-22 14:31:21 +08:00
Jason Lee
aa0f6d6222
editor: Improve range_to_utf16 and range_from_utf16 by use Rope. ( #1268 )
...
Now, we can work on 200K lines (editing).
--------
Now, all cost are on tree-sitter parse.
<img width="1091" height="672" alt="image"
src="https://github.com/user-attachments/assets/b111bc58-1334-40b2-9920-7006ad86bb3c "
/>
2025-09-22 14:07:30 +08:00
Jason Lee
692057f799
editor: Update completions to support CompletionTextEdit. ( #1267 )
...
- Fix completion menu width to longest item.
2025-09-22 11:39:50 +08:00
Jason Lee
13fa76e00d
editor: Improve TextWrapper performance by only rebuild changed lines. ( #1266 )
...
Continue #1220
Now, we can support editing on 100K lines (release mode).
https://github.com/user-attachments/assets/2daccc85-c713-4ddf-b08d-840cb1bb2643
2025-09-20 02:35:48 +08:00
Jason Lee
7e9606369e
editor: Improve line number to use shape_line method. ( #1265 )
2025-09-19 19:23:57 +08:00
Floyd Wang
d3d2a9ee49
chore: Remove gpui test-support feature
2025-09-19 17:38:42 +08:00
Jason Lee
299e5ed5fc
input: Fix possible IME input crash. ( #1264 )
2025-09-19 17:33:18 +08:00
Floyd Wang
c385da56c1
plot(shape): Add multi-label support for Bar ( #1262 )
...
## Breaking Change
```diff
- bar.label(move |_, point| Text::new("foo", point, "#red"));
+ bar.label(move |_, point| vec![Text::new("foo", point, "#red")]);
```
Add support for multiple labels on a single bar.
2025-09-19 14:13:51 +08:00
Jason Lee
5e7a2cb37f
editor: Add DefinitionProvider. ( #1261 )
...
https://github.com/user-attachments/assets/f8234a3f-3075-48ce-ae46-8ea869b6a13d
- Hold `cmd` to hover on a word to trigger definition check.
2025-09-19 13:49:24 +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
51efa766ea
editor: Improve search to select first match in visible range. ( #1258 )
2025-09-18 16:07:35 +08:00
Jason Lee
a942c57627
editor: Refactor the LSP config.
2025-09-18 14:17:18 +08:00
Jason Lee
3fe9bc8de0
example: Fix lint performance in CodeEditor example. ( #1259 )
...
Move AutoCorrect lint to background.
2025-09-18 11:25:53 +08:00
Jason Lee
8a3ef51ea1
input: Add to support search and replace. ( #1252 )
...
<img width="806" height="765" alt="image"
src="https://github.com/user-attachments/assets/5e2a7144-f814-4874-b9c1-89ebf5d942ec "
/>
- Close #1212 to support search for Input.
- Fix #1235 to support scroll to cursor when go to line.
2025-09-17 19:02:00 +08:00
Jason Lee
e01b139995
input: Fix completions API to assign Rope.
2025-09-17 14:37:21 +08:00
Jason Lee
478db2785a
input: Keep more empty space at top or bottom of the Editor. ( #1256 )
...
<img width="727" height="586" alt="image"
src="https://github.com/user-attachments/assets/2eb27326-831c-40fc-b0c8-48e6ab6ac67f "
/>
- Fix to keep 3 lines on top when move vertical.
- Improve to keep 1 line edge for cursor, when editor is too small.
2025-09-17 10:45:56 +08:00
Jason Lee
35568124bf
editor: Improve CodeEditor inset and line number width. ( #1255 )
...
<img width="756" height="580" alt="image"
src="https://github.com/user-attachments/assets/5748e7b3-74de-417a-856f-5db05c66f892 "
/>
2025-09-16 21:50:09 +08:00
Jason Lee
3c39641486
group_box: Fix incorrect h_full in GroupBox. ( #1253 )
...
Also fix the notifications example.
2025-09-16 21:23:29 +08:00
Floyd Wang
5ddaa9f5aa
form: Add col_start and col_end for the fields ( #1251 )
...
* Continue https://github.com/longbridge/gpui-component/pull/1250
2025-09-16 20:30:45 +08:00
Floyd Wang
731ab958f8
form: Add support for multi-column layout ( #1250 )
...
| Vertical | Horizontal |
| - | - |
| <img width="1642" height="1106" alt="SCR-20250916-nnry"
src="https://github.com/user-attachments/assets/279eb192-c660-449e-931e-1d7ff79ac69f "
/> | <img width="1642" height="1106" alt="image"
src="https://github.com/user-attachments/assets/289a6672-d82d-4f6f-a267-592874ccbe42 "
/> |
2025-09-16 16:28:43 +08:00
Jason Lee
717c83957d
input: Use position for preferred column for vertical move. ( #1249 )
...
For better support for non-monospaced font
2025-09-16 11:52:51 +08:00
dependabot[bot]
30b4723853
build(deps): bump gpui from 9c548a0 to 53b2f37 ( #1248 )
2025-09-15 23:47:25 +08:00
Jason Lee
aab1321b70
input: Refactor InputEvent::Change to not include the text. ( #1246 )
...
Change this to avoid Rope `to_string` performance cost. Ref #1220
The listeners of `InputEvent::Change` may not be going to use entire of
text.
## Break Change
- The `InputEvent::Change(SharedString)` removed value.
```diff
- pub enum InputEvent {
- Change(SharedString),
+ pub enum InputEvent {
+ Change,
```
2025-09-15 20:50:30 +08:00