Compare commits

...

2 Commits

Author SHA1 Message Date
Conrad Irwin
db28a0ecde Format markdowns 2024-12-03 09:58:15 -07:00
Conrad Irwin
2223e6e5e1 Format markdown by default 2024-12-03 09:09:59 -07:00
7 changed files with 32 additions and 31 deletions

View File

@@ -2,7 +2,8 @@
"languages": { "languages": {
"Markdown": { "Markdown": {
"tab_size": 2, "tab_size": 2,
"formatter": "prettier" "formatter": "prettier",
"format_on_save": "on"
}, },
"TOML": { "TOML": {
"formatter": "prettier", "formatter": "prettier",

View File

@@ -1,6 +1,7 @@
Design notes: Design notes:
This crate is split into two conceptual halves: This crate is split into two conceptual halves:
- The terminal.rs file and the src/mappings/ folder, these contain the code for interacting with Alacritty and maintaining the pty event loop. Some behavior in this file is constrained by terminal protocols and standards. The Zed init function is also placed here. - The terminal.rs file and the src/mappings/ folder, these contain the code for interacting with Alacritty and maintaining the pty event loop. Some behavior in this file is constrained by terminal protocols and standards. The Zed init function is also placed here.
- Everything else. These other files integrate the `Terminal` struct created in terminal.rs into the rest of GPUI. The main entry point for GPUI is the terminal_view.rs file and the modal.rs file. - Everything else. These other files integrate the `Terminal` struct created in terminal.rs into the rest of GPUI. The main entry point for GPUI is the terminal_view.rs file and the modal.rs file.

View File

@@ -6,7 +6,7 @@ Let's work through the prototypical "Build a todo app" example to showcase how w
We'll create a headline, a list of todo items, and a form to add new items. We'll create a headline, a list of todo items, and a form to add new items.
~~~rust ```rust
struct TodoList<V: 'static> { struct TodoList<V: 'static> {
headline: SharedString, headline: SharedString,
items: Vec<TodoItem>, items: Vec<TodoItem>,
@@ -36,7 +36,7 @@ impl<V: 'static> TodoList<V> {
} }
} }
} }
~~~ ```
All of this is relatively straightforward. All of this is relatively straightforward.
@@ -44,7 +44,7 @@ We use [gpui::SharedString] in components instead of [std::string::String]. This
When we want to pass an action we pass a `ClickHandler`. Whenever we want to add an action, the struct it belongs to needs to be generic over the view type `V`. When we want to pass an action we pass a `ClickHandler`. Whenever we want to add an action, the struct it belongs to needs to be generic over the view type `V`.
~~~rust ```rust
use gpui::hsla use gpui::hsla
impl<V: 'static> TodoList<V> { impl<V: 'static> TodoList<V> {
@@ -53,7 +53,7 @@ impl<V: 'static> TodoList<V> {
div().size_4().bg(hsla(50.0/360.0, 1.0, 0.5, 1.0)) div().size_4().bg(hsla(50.0/360.0, 1.0, 0.5, 1.0))
} }
} }
~~~ ```
Every component needs a render method, and it should return `impl Element<V>`. This basic component will render a 16x16px yellow square on the screen. Every component needs a render method, and it should return `impl Element<V>`. This basic component will render a 16x16px yellow square on the screen.
@@ -84,7 +84,7 @@ Let's grab our [theme::colors::ThemeColors] from the theme and start building ou
We can access the current theme's colors like this: We can access the current theme's colors like this:
~~~rust ```rust
impl<V: 'static> TodoList<V> { impl<V: 'static> TodoList<V> {
// ... // ...
fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Element<V> { fn render(self, _view: &mut V, cx: &mut ViewContext<V>) -> impl Element<V> {
@@ -93,11 +93,11 @@ impl<V: 'static> TodoList<V> {
div().size_4().hsla(50.0/360.0, 1.0, 0.5, 1.0) div().size_4().hsla(50.0/360.0, 1.0, 0.5, 1.0)
} }
} }
~~~ ```
Now we have access to the complete set of colors defined in the theme. Now we have access to the complete set of colors defined in the theme.
~~~rust ```rust
use gpui::hsla use gpui::hsla
impl<V: 'static> TodoList<V> { impl<V: 'static> TodoList<V> {
@@ -108,11 +108,11 @@ impl<V: 'static> TodoList<V> {
div().size_4().bg(color.surface) div().size_4().bg(color.surface)
} }
} }
~~~ ```
Let's finish up some basic styles for the container then move on to adding the other elements. Let's finish up some basic styles for the container then move on to adding the other elements.
~~~rust ```rust
use gpui::hsla use gpui::hsla
impl<V: 'static> TodoList<V> { impl<V: 'static> TodoList<V> {
@@ -140,7 +140,7 @@ impl<V: 'static> TodoList<V> {
) )
} }
} }
~~~ ```
### Headline ### Headline
@@ -154,7 +154,6 @@ TODO
TODO TODO
### End result ### End result
TODO TODO

View File

@@ -30,7 +30,6 @@ cargo test -p vim --features neovim test_visual_star_hash
This will run your keystrokes against a headless neovim and cache the results in the test_data directory. This will run your keystrokes against a headless neovim and cache the results in the test_data directory.
## Testing zed-only behavior ## Testing zed-only behavior
Zed does more than vim/neovim in their default modes. The `VimTestContext` can be used instead. This lets you test integration with the language server and other parts of zed's UI that don't have a NeoVim equivalent. Zed does more than vim/neovim in their default modes. The `VimTestContext` can be used instead. This lets you test integration with the language server and other parts of zed's UI that don't have a NeoVim equivalent.

View File

@@ -69,6 +69,7 @@ git log --grep="(\d+\.\d+\.\d+\.)" --perl-regexp --oneline --reverse
``` ```
Then just: Then just:
``` ```
git tag v0.0.2 abcd1234 git tag v0.0.2 abcd1234
git tag v0.0.3 deadbeef git tag v0.0.3 deadbeef