gpui-component/docs/docs
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
..
components input: Add to support CodeEditor as single line mode. (#1696) 2025-11-28 19:51:40 +08:00
assets.md assets: Move assets files into crates/assets folder for crate publish. (#1609) 2025-11-14 19:00:29 +08:00
context.md docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
element_id.md docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
getting-started.md docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00
index.md docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00
installation.md docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00
root.md example: Follow up #1594 missed changes. (#1595) 2025-11-14 11:22:55 +08:00
theme.md docs: Fix theme_name type (#1614) 2025-11-17 09:56:24 +08:00