gpui-component/crates
Andreas Johansson 7e479aa7f2
input: Add to support CodeEditor as single line mode. (#1696)
## Screenshot

From `input_story`:

<img width="1069" height="122" alt="Screenshot From 2025-11-28 09-14-03"
src="https://github.com/user-attachments/assets/f14ef2fc-4939-4ceb-be3e-bede492f8602"
/>

## Breaking Changes

- `.multi_line()` was changed to `.multi_line(bool)`.  
- Removed pub `InputMode`, this should only for internal.

```diff
InputState::new(window, cx)
-    .multi_line()
+    .multi_line(true)
```

## Checklist

- [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [x] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [x] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)

Use cases,

1) In my API client, I have a tree sitter language for the URL input,

<img width="1001" height="162" alt="Image"
src="https://github.com/user-attachments/assets/9771decf-b0b7-4230-8ed6-784a95b72af1"
/>

2) In my SQL editor I want to be able to allow JSON syntax highlighting
for inline editing of json columns,

<img width="501" height="130" alt="Image"
src="https://github.com/user-attachments/assets/f0f879cc-841f-49d2-a23a-2effc3747f38"
/>

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-11-28 19:51:40 +08:00
..
assets Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
macros Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
reqwest_client Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
story input: Add to support CodeEditor as single line mode. (#1696) 2025-11-28 19:51:40 +08:00
ui input: Add to support CodeEditor as single line mode. (#1696) 2025-11-28 19:51:40 +08:00