gpui-component/crates/story/examples
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
..
fixtures editor: Add document_colors LSP. (#1329) 2025-10-06 18:08:12 +08:00
brush.rs setting: Add Settings component. (#1632) 2025-11-20 13:51:44 +00:00
dock.rs assets: Add gpui-component-assets crate. (#1601) 2025-11-14 15:03:26 +08:00
editor.rs theme: Use font_family for all elements. (#1618) 2025-11-17 03:18:17 +00:00
html.rs theme: Use font_family for all elements. (#1618) 2025-11-17 03:18:17 +00:00
large-text.rs input: Add to support CodeEditor as single line mode. (#1696) 2025-11-28 19:51:40 +08:00
markdown.rs theme: Use font_family for all elements. (#1618) 2025-11-17 03:18:17 +00:00
tiles.rs theme: Use font_family for all elements. (#1618) 2025-11-17 03:18:17 +00:00
webview.rs assets: Add gpui-component-assets crate. (#1601) 2025-11-14 15:03:26 +08:00