gpui-component/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
..
.vitepress docs: Add icons for page background to website. (#1701) 2025-11-28 07:14:43 +00:00
data docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
docs input: Add to support CodeEditor as single line mode. (#1696) 2025-11-28 19:51:40 +08:00
public docs: Add icons for page background to website. (#1701) 2025-11-28 07:14:43 +00:00
src docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
.gitignore docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
bun.lock docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00
contributors.md docs: Add icons for page background to website. (#1701) 2025-11-28 07:14:43 +00:00
contributors.vue docs: Add icons for page background to website. (#1701) 2025-11-28 07:14:43 +00:00
index.md docs: Remove index page warrning. 2025-11-17 10:22:01 +08:00
index.vue docs: Add icons for page background to website. (#1701) 2025-11-28 07:14:43 +00:00
package.json docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00
postcss.config.mjs docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
README.md docs: Improve docs to use variable version from toml. (#1603) 2025-11-14 16:10:48 +08:00

gpui-component-docs

To install dependencies:

bun install

To run:

bun run dev

This project was created using bun init in bun v1.2.23. Bun is a fast all-in-one JavaScript runtime.