Floyd Wang
b80fca28c1
Bump v0.3.0-preview2
2025-10-23 16:36:23 +08:00
Jason Lee
b42a429fdc
input: Fix Input to prepare text wrapper. ( #1417 )
...
To ensure call update_all in TextWrapper.
2025-10-23 08:03:38 +00:00
Jason Lee
804a89df20
chore: Update GPUI v0.2.2 ( #1416 )
2025-10-23 07:41:50 +00:00
Copilot
3c6a7b6a9b
highlighter: Make SyntaxHighlighter::styles method public for external use ( #1415 )
2025-10-23 10:34:13 +08:00
Stephan Aßmus
5ccdba41af
Call dropdown item's display_title() method also for rendering within the dropdown when open ( #1410 )
...
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2025-10-22 11:35:34 +08:00
Jason Lee
65b53c86e4
input: Hide scrollbar when not overflow in auto grow mode. ( #1407 )
2025-10-21 11:05:22 +00:00
Jason Lee
1af28c49bd
input: Stop propagation on scroll wheel. ( #1406 )
...
Close #1397
2025-10-21 18:50:50 +08:00
Vincent Hanquez
2b37028e08
chore: Update dependencies to smol = 2 ( #1404 )
...
just noticed the dependency is set to a fairly old version of smol (=
1), so update to smol = 2.
Also gpui/zed seems to be using smol = 2
2025-10-21 10:56:48 +08:00
Jason Lee
17ec395853
Bump v0.3.0-preview0
2025-10-17 10:37:49 +08:00
Jason Lee
f16487a2cb
chore: Fix license link in crate meta. ( #1393 )
...
Close #1392
2025-10-17 10:32:09 +08:00
Jason Lee
31db24b689
editor: Improve hover popover delay. ( #1389 )
2025-10-17 02:14:20 +00:00
Jason Lee
e0c1f91ed4
virtual_list: Fix VirtualList by measure item to get correct content_size to avoid scroll overflow. ( #1388 )
...
- Fixed VirtualList example the horizontal scrollbar not appear.
- Fixed VirtualList example scroll slow, this because not call
`self.scroll_handle.set_offset` to update.
2025-10-16 07:50:09 +00:00
Jason Lee
2a9bc2a2f8
Revert "virtual_list: Fix VirtualList to limit only allow 1 direction scrollable." ( #1387 )
...
Reverts longbridge/gpui-component#1386
2025-10-16 14:27:28 +08:00
Jason Lee
4341cf81d3
virtual_list: Fix VirtualList to limit only allow 1 direction scrollable. ( #1386 )
...
It should only allow to scroll in one direction.
For example, when `axis` is `vertical`, the horizontal should not able
to scroll.
2025-10-16 14:25:13 +08:00
Floyd Wang
43a2c814a3
checkbox: Do not stop propagation when click ( #1385 )
2025-10-16 06:01:06 +00:00
Jason Lee
1adaf3ec55
tree: Add Tree. ( #1373 )
...
Close #318
https://github.com/user-attachments/assets/1fed12e2-df53-4213-a3f5-c57bd8b4cadb
2025-10-15 18:39:47 +08:00
Copilot
4fef96e407
story: Fix story panic when save state failed. ( #1384 )
...
Close #1383
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-10-15 08:20:44 +00:00
han
1bc5ff03df
story: Add interactive brush drawing canvas ( #1370 )
...
<img width="2175" height="1358" alt="image"
src="https://github.com/user-attachments/assets/41716d72-655f-440a-ac9e-cdb91e1b4417 "
/>
---------
Co-authored-by: hl <hl@nmcsoft.com>
2025-10-15 15:27:59 +08:00
Jason Lee
59f4e26c7b
input: Fix Input panics when masked have non-ASCII characters. ( #1382 )
...
Close #1377
2025-10-15 07:15:50 +00:00
Jason Lee
491bacfd0e
scrollbar: Fix scroll to show mode. ( #1381 )
...
Close #1379 , this bug is introduced from #1196 .
2025-10-15 05:51:13 +00:00
Jason Lee
4ccd7d99d0
examples: Add examples folder. ( #1378 )
2025-10-15 02:26:13 +00:00
Jason Lee
6998708b81
Revert "chore: Update GPUI dependency." ( #1376 )
...
Reverts longbridge/gpui-component#1374
Because `gpui v0.2.1` have but, the text render not in vertical center.
2025-10-14 21:41:31 +08:00
Jason Lee
889382cba1
input: Grouping input history to avoid IME placeholder. ( #1375 )
2025-10-14 13:27:23 +00:00
Jason Lee
e56c7a39bf
chore: Update GPUI dependency. ( #1374 )
2025-10-14 12:37:15 +00:00
Jason Lee
0c0c36cb87
menu: Fix trigger action with context. ( #1372 )
...
Fix previous #1338 broken trigger action with context.
2025-10-14 19:58:11 +08:00
Floyd Wang
47978bc50e
button: Support specified anchor to dropdown button ( #1367 )
2025-10-14 11:19:22 +08:00
Floyd Wang
1abb6c2222
plot(line_chart): Add missing natural stroke style ( #1366 )
2025-10-14 09:40:10 +08:00
Martí Gimeno Ortí
5f13b49690
plot: Add stroke style per each Y series ( #1364 )
...
Enables the user to set different `stroke_style` to each Y data series,
keeping retrocompatibility with the previous API.
<img width="1300" height="411" alt="Screenshot from 2025-10-13 11-33-28"
src="https://github.com/user-attachments/assets/d665b87c-0d79-479c-9156-15a0f1c8ca10 "
/>
2025-10-14 09:36:30 +08:00
Jason Lee
5b2fed0ccb
markdown: Use list for Markdown render and add scrollbar. ( #1357 )
2025-10-13 22:06:07 +08:00
Jason Lee
2574e7f812
story: Add open file to Markdown and Editor example. ( #1363 )
...
Close #1352
2025-10-13 11:52:16 +08:00
Jason Lee
97df4efd46
input: Fix set_value when Input is disabled. ( #1362 )
...
Close #1350
2025-10-13 11:15:32 +08:00
Jason Lee
08cf199b39
editor: Add delay to trigger hover popover. ( #1361 )
2025-10-13 10:40:09 +08:00
Sunli
8a63fd67ab
chore: Fix webview example ( #1360 )
2025-10-13 10:10:35 +08:00
Martí Gimeno Ortí
32b8d65075
plot: Add StepAfter kind to StokeStrike ( #1356 )
...
Implements new `StokeStrike::StepAfter` for plot component
<img width="1700" height="1030" alt="step-after-plot-stoke-style"
src="https://github.com/user-attachments/assets/89252ba9-2834-4c9a-9020-7977ffea6865 "
/>
2025-10-13 09:59:51 +08:00
richerfu
20ddb88e95
input: impl Selectable for TextInput that allow it as tigger for popover ( #1353 )
2025-10-12 21:20:38 +08:00
Jason Lee
6817c8d3cc
menu: Add AppMenuBar. ( #1338 )
...
- input: Change Input to not unselect when blur.
- popup_menu: Fix get key binding on PopupMenu with action context.
<img width="935" height="694" alt="image"
src="https://github.com/user-attachments/assets/295fa84e-f1d8-4f6f-8a77-601a45f8ad6d "
/>
## TODO
- [x] Keyboard support.
- [x] Add submenu to example.
- [ ] ~~Icon~~ and check support. Wait
https://github.com/zed-industries/zed/pull/39876
2025-10-10 21:03:16 +08:00
Jason Lee
d364402a94
editor: Fix code actions not display. ( #1347 )
2025-10-10 19:28:59 +08:00
Floyd Wang
d4b0aff534
button: Fix the on_hover does not respond ( #1346 )
2025-10-10 10:52:05 +08:00
ihavecoke
9d01ac26bc
menu: Fix submenu item selection when multiple submenus exist ( #1342 )
...
Before:
https://github.com/user-attachments/assets/8653953e-4e9d-49e6-946a-1696ea6abee0
After:
https://github.com/user-attachments/assets/f5bfbf19-69e1-4e64-81c1-072c61e8a8f7
---------
Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-10-09 21:32:51 +08:00
Floyd Wang
7a8be9a628
button: Add Support for on_hover event ( #1341 )
2025-10-09 18:43:50 +08:00
Jason Lee
ca9d5b77e2
chore: Release v0.2.0
2025-10-09 15:21:10 +08:00
Jason Lee
6ca9ac46fa
chore: Bump crate version. ( #1340 )
2025-10-09 15:20:34 +08:00
Jason Lee
1fce2e1ac4
menu: Improve MenuItem paddings and fix submenu support. ( #1339 )
...
Fix #1332 was broken submenu selection.
2025-10-09 10:52:33 +08:00
Jason Lee
1db3e03fc3
context_menu: Fix subscription leak. ( #1337 )
2025-10-08 16:02:21 +08:00
Floyd Wang
66851c55e4
Bump gpui ( #1336 )
2025-10-08 11:20:06 +08:00
ihavecoke
d47b9c15ed
menu: Add flex property to custom element in popup menu items for better layout ( #1335 )
2025-10-08 11:04:21 +08:00
Floyd Wang
c3954b0455
input: Implement styled for number input ( #1333 )
2025-10-08 10:36:28 +08:00
Jason Lee
c579db975f
menu: Better handle hover for menu item. ( #1332 )
...
Follow #1328 to improve again.
2025-10-08 10:17:08 +08:00
Jason Lee
d0396d779e
editor: Add document_colors LSP. ( #1329 )
2025-10-06 18:08:12 +08:00
Jason Lee
efe7e14e88
menu: Unselect menu item when mouse move out. ( #1328 )
2025-10-06 09:45:45 +08:00
Jason Lee
794f4d6397
editor: Add to support move vertical for soft wrapped lines. ( #1312 )
2025-10-03 18:19:37 +08:00
Jason Lee
f59bac8c8b
tab_bar: Let normal/active tab has same border to avoid flash on active change. ( #1327 )
2025-10-03 16:30:28 +08:00
Jason Lee
a48232cefd
input: Clean to reset selection and scroll offset. ( #1326 )
...
- Focus back to input when click `clean` button.
2025-10-03 16:11:27 +08:00
Floyd Wang
9754cab4d7
button: Bind element ID after button is created ( #1325 )
...
- Fix the selected-state error in the popup menu.
2025-10-03 14:52:53 +08:00
Floyd Wang
1358b2906e
Bump gpui ( #1324 )
...
* Wireup the `Pixels` change
https://github.com/zed-industries/zed/pull/39367 .
2025-10-03 14:32:29 +08:00
Floyd Wang
4d459ea160
chore: Remove debugging logs
2025-10-03 13:37:45 +08:00
Jason Lee
cfd060b66d
editor: Split Input and Editor background color. ( #1323 )
...
Keep input to use window background color, the `editor.background` only
for Editor mode.
2025-10-03 11:20:01 +08:00
Jason Lee
e84e8ebaad
button: Fix button label display has overflow hidden. ( #1322 )
2025-10-03 10:18:00 +08:00
Carlo Corradini
908c022efe
chore: Assets interpolate folder path via rust embed ( #1318 )
...
Use `rust-embed` feature `interpolate-folder-path` to always
(`debug`/`release`) load assets from the correct `assets` directory
2025-10-02 16:04:33 +08:00
Jason Lee
463f01bb16
theme: Update macos-clasic dark theme color. ( #1320 )
...
<img width="1073" height="1006" alt="image"
src="https://github.com/user-attachments/assets/625df905-b2f9-405f-a806-4574209d39de "
/>
<img width="908" height="893" alt="image"
src="https://github.com/user-attachments/assets/2d816d64-2e69-43dc-a707-a49e5f9842d4 "
/>
2025-10-02 14:46:27 +08:00
Floyd Wang
df8bcefaaa
tag: Implement styled for custom style ( #1319 )
2025-10-02 14:07:07 +08:00
Xu Desheng
8c6cde3719
highlighter: Use clip_offset to ensure UTF-8 char boundaries ( #1317 )
...
## Problem
SyntaxHighlighter panics when highlighting text containing multi-byte
UTF-8 characters (Chinese, Japanese, emoji, etc).
**Error**: `thread 'main' panicked at
ropey-2.0.0-beta.1/src/rope.rs:694:59`
**Root Cause**: tree-sitter may return byte offsets that fall in the
middle of multi-byte UTF-8 characters. When `Rope::slice()` receives
such offsets, it checks `is_char_boundary()` and panics with
`NonCharBoundary` error.
## Solution
Use `RopeExt::clip_offset()` to adjust byte offsets to the nearest char
boundaries before calling `slice()`.
**Changes**:
- Line 395-398: Clip offsets in main highlighting loop
- Line 441-443: Clip offsets when extracting injection content
- Line 478-479: Added explanatory comment for injection highlighting
- Added imports for `RopeExt` and `Bias`
**Safety**:
- `Bias::Left` for start offset ensures we don't skip the beginning of a
character
- `Bias::Right` for end offset ensures we include the full character
- The adjustment is minimal (at most 3 bytes for UTF-8)
- Uses existing project API (`RopeExt::clip_offset`)
## Testing
Tested with:
- ✅ Chinese text: "你好世界"、"**加粗中文**"
- ✅ Japanese text: "こんにちは"、"日本語"
- ✅ Emoji: "😀 🎉 ✨ 🚀 "
- ✅ Markdown syntax highlighting with CJK characters
- ✅ Code blocks with mixed languages
All tests pass without panics. Syntax highlighting works correctly. No
performance degradation observed.
## AI Assistance
🤖 This fix was developed with AI assistance (Claude). The solution
approach (using `clip_offset`) was identified through code analysis and
testing. The AI analyzed:
- ropey source code to understand the panic condition
- Existing usage of `clip_offset` in the codebase
- Tree-sitter byte offset behavior with UTF-8
All code has been reviewed and tested by humans, and further validated
by Gemini AI.
## Checklist
- [x] Follows existing code style
- [x] One PR does one thing (UTF-8 panic fix only)
- [x] All manual tests pass
- [x] Tested with real multi-byte UTF-8 content
- [x] No breaking changes
- [x] No performance regression
2025-10-02 12:14:07 +08:00
Jason Lee
935cd93f5a
chore: Fix rust logo URL in test.md.
2025-09-30 16:29:56 +08:00
Sunli
d619e00ecb
input: Only recreate the TextView used to display hover information when necessary. ( #1313 )
2025-09-30 16:11:32 +08:00
Jason Lee
69af1be6e5
chore: Update GPUI and fix DeferredScrollToItem API changes. ( #1315 )
2025-09-30 16:10:25 +08:00
Jason Lee
8b0898147f
editor: Fix Editor crash when text is empty to display placeholder. ( #1314 )
2025-09-30 16:07:03 +08:00
Sunli
591cfc8dab
text_view: Use weak references to the state in async task to avoid memory leaks. ( #1311 )
2025-09-30 15:26:59 +08:00
Sunli
880c019fb8
text_view: Reworks TextView to defer state initialization until first layout. ( #1310 )
2025-09-30 13:50:27 +08:00
Jason Lee
d5ae887cbb
editor: Fix hover definition to immediately hide when move out. ( #1309 )
2025-09-30 11:29:59 +08:00
Jason Lee
f92944546f
chore: Disable tab stop for some popover elements. ( #1306 )
2025-09-29 18:11:25 +08:00
Jason Lee
03cf48a783
input: Avoid scroll on select all. ( #1305 )
2025-09-29 17:49:59 +08:00
Jason Lee
6028de3b5a
editor: Input enter to get next indent level performance. ( #1304 )
...
Now we can handle about 1M lines.
https://github.com/user-attachments/assets/cb55cd18-6755-40cd-a5b0-3d0f865d12e1
2025-09-29 17:35:58 +08:00
Jason Lee
aca03d47c0
input: Fix Input to unselect on blur. ( #1303 )
2025-09-29 17:29:11 +08:00
Jason Lee
5e504d10bb
chore: Refactor tab key to switch focus. ( #991 )
...
Wait https://github.com/zed-industries/zed/pull/33008 ,
https://github.com/zed-industries/zed/pull/34804 to merge.
https://github.com/user-attachments/assets/3c21ebc9-44a0-4311-bb0f-5f63fe8d4bb3
- Improved `focus_ring` to render like an outline.
- Added to support press `Enter`, `Space` key to trigger Checkbox,
Button, Radio.
## Break Changes
- The `FocusableExt` has been changed to only for crate internal.
- The `FocusableCycle` has been removed, now GPUI has it own tab stop
implementation.
2025-09-29 16:48:24 +08:00
Copilot
ed05c3ebec
chore: Remove Wef code as it has been extracted to separate repository ( #1302 )
...
All WEF (Web Embedding Framework) related code has been successfully
removed from the repository as it has been extracted to
https://github.com/longbridge/wef
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huacnlee <5518+huacnlee@users.noreply.github.com>
2025-09-29 15:31:58 +08:00
Sunli
b8651515f0
chore: Remove unnecessary RefCell ( #1301 )
2025-09-29 14:39:04 +08:00
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
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
Jason Lee
f1b6d7c5ed
editor: Add completion, code_action provider. ( #1242 )
2025-09-15 19:25:02 +08:00
Floyd Wang
b34d8b6716
label: Add HighlightsMatch to support prefix matching ( #1243 )
...
| Mode | |
| - | - |
| Full | <img width="480" alt="SCR-20250912-ptai"
src="https://github.com/user-attachments/assets/fbaaec1c-c376-42a0-a88c-18fc21a24ac3 "
/> |
| Prefix | <img width="480" alt="SCR-20250912-ptbv"
src="https://github.com/user-attachments/assets/f68ca47f-7ad2-4214-b132-bf5abbc92764 "
/> |
| | <img width="480" alt="SCR-20250912-ptef"
src="https://github.com/user-attachments/assets/1a3807cb-d2e4-4ed0-ab0b-d375deae1359 "
/> |
2025-09-12 18:35:55 +08:00
Cookie
feabb748ec
calendar: Fixed cross year name and multi month linkage click issues ( #1241 )
...
<img width="864" height="298" alt="image"
src="https://github.com/user-attachments/assets/7f0a34d7-e000-4756-b1ae-0e6511679660 "
/>
2025-09-12 10:29:07 +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
db5ba1e04c
input: Fix horizontal scroll to match the longest line width. ( #1238 )
...
Close #1234
2025-09-10 18:17:15 +08:00
Jason Lee
5beaed2a9e
input: Pause blink and keep show cursor on moving or editing. ( #1236 )
...
https://github.com/user-attachments/assets/751d0b62-18f9-41c8-80a0-e11439e3b91e
2025-09-10 14:49:14 +08:00
Jason Lee
43c848893c
input: Refactor start_of_line, end_of_line by use Rope. ( #1232 )
...
- Removed `Cursor` struct, now use `usize` for selection offset.
2025-09-10 14:43:11 +08:00
Jason Lee
844574befc
input: Fix track scroll to selected end on drag move. ( #1231 )
2025-09-10 13:59:02 +08:00
Jason Lee
7998d64501
highlighter: Improve Syntax Highlighter performance. ( #1230 )
...
Now can support up to 50K lines with code highlight.
https://github.com/user-attachments/assets/3bbba2cd-ea56-4778-b471-6beea323fbaa
----
Ref Links
- https://zed.dev/blog/syntax-aware-editing
2025-09-10 00:11:53 +08:00
Floyd Wang
ab98e53a5a
plot(tooltip): Fix the dots not centered ( #1229 )
2025-09-09 18:01:01 +08:00
Floyd Wang
51caf932db
plot(tooltip): Add support for custom appearance ( #1226 )
2025-09-09 14:47:07 +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
d71a32d0e4
input: Fix move to to skip \r on Windows. ( #1223 )
...
This PR for continue #1214 to fix move cursor to ignore` `\r` for
Windows.
2025-09-09 09:40:07 +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
a9e6b49a15
highlighter: Fix #1204 changes cause to incorrect highlight result. ( #1218 )
...
This PR for fix some incorrect changes in #1204
## Before
<img width="854" height="864" alt="image"
src="https://github.com/user-attachments/assets/eebd07e5-3437-444d-a55d-2941228e3b08 "
/>
## After
<img width="954" height="962" alt="image"
src="https://github.com/user-attachments/assets/60761848-8d4f-4fe9-88b9-f0b0f0985d2f "
/>
<img width="1515" height="867" alt="image"
src="https://github.com/user-attachments/assets/3d4654a7-f977-4919-9c9e-f013fcdd8fde "
/>
2025-09-08 16:14:07 +08:00
Floyd Wang
78dccd4d79
plot: Apply linear scale based on the direction of given range ( #1219 )
...
## Breaking Change
- Apply linear scale based on the direction of given range.
```diff
- ScaleLinear::new(vec![1., 2., 3.], vec![0., 100.])
+ ScaleLinear::new(vec![1., 2., 3.], vec![100., 0.])
```
Currently, you can draw the linear scale from minimum to maximum or from
maximum to minimum; it depends on the direction of the range.
2025-09-08 15:56:58 +08:00
Floyd Wang
5e302866ce
inspector: Improve UI details ( #1217 )
2025-09-08 13:29:54 +08:00
Floyd Wang
00dd457441
drawer: Ensure the drawer’s height matches the application ( #1216 )
2025-09-08 10:36:13 +08:00
Jason Lee
f35398d797
input: Fix some Rope method call will crash. ( #1213 )
2025-09-05 19:09:46 +08:00
Jason Lee
cfc2449820
input: Fix column position update when text added, to support move vertical keep column. ( #1211 )
...
Refactor this logic by use Rope line, column.
2025-09-05 18:47:24 +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
Floyd Wang
19be9b8d96
inspector: Trim the diagnostic error at the end ( #1210 )
2025-09-05 15:21:25 +08:00