Compare commits
2 Commits
missing-gi
...
markdown-f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db28a0ecde | ||
|
|
2223e6e5e1 |
@@ -2,7 +2,8 @@
|
||||
"languages": {
|
||||
"Markdown": {
|
||||
"tab_size": 2,
|
||||
"formatter": "prettier"
|
||||
"formatter": "prettier",
|
||||
"format_on_save": "on"
|
||||
},
|
||||
"TOML": {
|
||||
"formatter": "prettier",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Design notes:
|
||||
|
||||
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.
|
||||
- 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.
|
||||
|
||||
|
||||
@@ -26,21 +26,21 @@ Now let's dive a bit deeper into how to customize `Label` instances:
|
||||
|
||||
- **Setting Color:** To set the color of the label using various predefined color options such as `Default`, `Muted`, `Created`, `Modified`, `Deleted`, etc, the `color()` function is called on the `Label` instance:
|
||||
|
||||
```rust
|
||||
Label::new("Hello, world!").color(LabelColor::Default);
|
||||
```
|
||||
```rust
|
||||
Label::new("Hello, world!").color(LabelColor::Default);
|
||||
```
|
||||
|
||||
- **Setting Line Height Style:** To set the line height style, the `line_height_style()` function is utilized:
|
||||
|
||||
```rust
|
||||
Label::new("Hello, world!").line_height_style(LineHeightStyle::TextLabel);
|
||||
```
|
||||
```rust
|
||||
Label::new("Hello, world!").line_height_style(LineHeightStyle::TextLabel);
|
||||
```
|
||||
|
||||
- **Adding a Strikethrough:** To add a strikethrough in a `Label`, the `set_strikethrough()` function is used:
|
||||
- **Adding a Strikethrough:** To add a strikethrough in a `Label`, the `set_strikethrough()` function is used:
|
||||
|
||||
```rust
|
||||
Label::new("Hello, world!").set_strikethrough(true);
|
||||
```
|
||||
```rust
|
||||
Label::new("Hello, world!").set_strikethrough(true);
|
||||
```
|
||||
|
||||
That's it! Now you can use the `Label` component to create and customize text on your application's interface.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
~~~rust
|
||||
```rust
|
||||
struct TodoList<V: 'static> {
|
||||
headline: SharedString,
|
||||
items: Vec<TodoItem>,
|
||||
@@ -36,7 +36,7 @@ impl<V: 'static> TodoList<V> {
|
||||
}
|
||||
}
|
||||
}
|
||||
~~~
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
~~~rust
|
||||
```rust
|
||||
use gpui::hsla
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
~~~
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
~~~rust
|
||||
```rust
|
||||
impl<V: 'static> TodoList<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)
|
||||
}
|
||||
}
|
||||
~~~
|
||||
```
|
||||
|
||||
Now we have access to the complete set of colors defined in the theme.
|
||||
|
||||
~~~rust
|
||||
```rust
|
||||
use gpui::hsla
|
||||
|
||||
impl<V: 'static> TodoList<V> {
|
||||
@@ -108,11 +108,11 @@ impl<V: 'static> TodoList<V> {
|
||||
div().size_4().bg(color.surface)
|
||||
}
|
||||
}
|
||||
~~~
|
||||
```
|
||||
|
||||
Let's finish up some basic styles for the container then move on to adding the other elements.
|
||||
|
||||
~~~rust
|
||||
```rust
|
||||
use gpui::hsla
|
||||
|
||||
impl<V: 'static> TodoList<V> {
|
||||
@@ -140,7 +140,7 @@ impl<V: 'static> TodoList<V> {
|
||||
)
|
||||
}
|
||||
}
|
||||
~~~
|
||||
```
|
||||
|
||||
### Headline
|
||||
|
||||
@@ -154,7 +154,6 @@ TODO
|
||||
|
||||
TODO
|
||||
|
||||
|
||||
### End result
|
||||
|
||||
TODO
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Extracting an extension to dedicated repo
|
||||
|
||||
These are some notes of how to extract an extension from the main zed repository and generate a new repository which preserves the history as best as possible. In the this example we will be extracting the `ruby` extension, substitute as appropriate.
|
||||
These are some notes of how to extract an extension from the main zed repository and generate a new repository which preserves the history as best as possible. In the this example we will be extracting the `ruby` extension, substitute as appropriate.
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
@@ -23,7 +23,7 @@ regex:(?<![\[a-zA-Z0-9])(#[0-9]{3,5})==>zed-industries/zed\1
|
||||
```
|
||||
|
||||
This file takes the form of `patern==>replacement`, where the replacement is optional.
|
||||
Note whitespace matters so `ruby: ==>` is removing the `ruby:` prefix from a commit messages and adding a space after `==> ` means the replacement begins with a space. Regex capture groups are numbered `\1`, `\2`, etc.
|
||||
Note whitespace matters so `ruby: ==>` is removing the `ruby:` prefix from a commit messages and adding a space after `==> ` means the replacement begins with a space. Regex capture groups are numbered `\1`, `\2`, etc.
|
||||
|
||||
See: [Git Filter Repo Docs](https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html) for more.
|
||||
|
||||
@@ -69,6 +69,7 @@ git log --grep="(\d+\.\d+\.\d+\.)" --perl-regexp --oneline --reverse
|
||||
```
|
||||
|
||||
Then just:
|
||||
|
||||
```
|
||||
git tag v0.0.2 abcd1234
|
||||
git tag v0.0.3 deadbeef
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Zed Terms of Use
|
||||
slug: terms
|
||||
---
|
||||
|
||||
PLEASE READ THESE TERMS AND CONDITIONS CAREFULLY BEFORE USING THE SERVICE OR SOFTWARE OFFERED BY ZED INDUSTRIES, INC. ("ZED", OR "WE"). BY ACCESSING OR USING THE SOLUTION (AS DEFINED BELOW) IN ANY MANNER, YOU ("YOU" OR "CUSTOMER") AGREE TO BE BOUND BY THESE TERMS (THE "AGREEMENT") TO THE EXCLUSION OF ALL OTHER TERMS. YOU REPRESENT AND WARRANT THAT YOU HAVE THE AUTHORITY TO ENTER INTO THIS AGREEMENT; IF YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF AN ORGANIZATION OR ENTITY, REFERENCES TO "CUSTOMER" AND "YOU" IN THIS AGREEMENT, REFER TO THAT ORGANIZATION OR ENTITY. IF YOU DO NOT AGREE TO ALL OF THE FOLLOWING, YOU MAY NOT USE OR ACCESS THE SOLUTION IN ANY MANNER. IF THE TERMS OF THIS AGREEMENT ARE CONSIDERED AN OFFER, ACCEPTANCE IS EXPRESSLY LIMITED TO SUCH TERMS.
|
||||
PLEASE READ THESE TERMS AND CONDITIONS CAREFULLY BEFORE USING THE SERVICE OR SOFTWARE OFFERED BY ZED INDUSTRIES, INC. ("ZED", OR "WE"). BY ACCESSING OR USING THE SOLUTION (AS DEFINED BELOW) IN ANY MANNER, YOU ("YOU" OR "CUSTOMER") AGREE TO BE BOUND BY THESE TERMS (THE "AGREEMENT") TO THE EXCLUSION OF ALL OTHER TERMS. YOU REPRESENT AND WARRANT THAT YOU HAVE THE AUTHORITY TO ENTER INTO THIS AGREEMENT; IF YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF AN ORGANIZATION OR ENTITY, REFERENCES TO "CUSTOMER" AND "YOU" IN THIS AGREEMENT, REFER TO THAT ORGANIZATION OR ENTITY. IF YOU DO NOT AGREE TO ALL OF THE FOLLOWING, YOU MAY NOT USE OR ACCESS THE SOLUTION IN ANY MANNER. IF THE TERMS OF THIS AGREEMENT ARE CONSIDERED AN OFFER, ACCEPTANCE IS EXPRESSLY LIMITED TO SUCH TERMS.
|
||||
|
||||
## 1. ACCESS TO AND USE OF THE SOLUTION
|
||||
|
||||
@@ -94,7 +94,7 @@ Zed does not represent or warrant that the operation of the Zed Service or Edito
|
||||
|
||||
## 8. LIMITATIONS OF LIABILITY
|
||||
|
||||
IN NO EVENT SHALL ZED BE LIABLE FOR ANY LOST DATA, LOST PROFITS, BUSINESS INTERRUPTION, REPLACEMENT SERVICE OR OTHER SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR INDIRECT DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY. ZED'S LIABILITY FOR ALL CLAIMS ARISING UNDER THIS AGREEMENT, WHETHER IN CONTRACT, TORT OR OTHERWISE, SHALL NOT EXCEED ONE THOUSAND US DOLLARS ($1,000).
|
||||
IN NO EVENT SHALL ZED BE LIABLE FOR ANY LOST DATA, LOST PROFITS, BUSINESS INTERRUPTION, REPLACEMENT SERVICE OR OTHER SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR INDIRECT DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY. ZED'S LIABILITY FOR ALL CLAIMS ARISING UNDER THIS AGREEMENT, WHETHER IN CONTRACT, TORT OR OTHERWISE, SHALL NOT EXCEED ONE THOUSAND US DOLLARS ($1,000).
|
||||
|
||||
## 9. Third Party Services
|
||||
|
||||
@@ -112,11 +112,11 @@ You shall comply with all applicable laws and regulations in its use of the Solu
|
||||
|
||||
### 10.3. Assignment
|
||||
|
||||
Neither party may transfer and assign its rights and obligations under this Agreement without the prior written consent of the other party. Notwithstanding the foregoing, Zed may transfer and assign its rights under this Agreement without consent from the other party in connection with a change in control, acquisition or sale of all or substantially all of its assets.
|
||||
Neither party may transfer and assign its rights and obligations under this Agreement without the prior written consent of the other party. Notwithstanding the foregoing, Zed may transfer and assign its rights under this Agreement without consent from the other party in connection with a change in control, acquisition or sale of all or substantially all of its assets.
|
||||
|
||||
### 10.4. Force Majeure
|
||||
|
||||
Neither party shall be responsible for failure or delay in performance by events out of their reasonable control, including but not limited to, acts of God, Internet outage, terrorism, war, fires, earthquakes and other disasters (each a "Force Majeure"). Notwithstanding the foregoing: if a Force Majeure continues for more than thirty (30) days, either party may to terminate this agreement by written notice to the other party.
|
||||
Neither party shall be responsible for failure or delay in performance by events out of their reasonable control, including but not limited to, acts of God, Internet outage, terrorism, war, fires, earthquakes and other disasters (each a "Force Majeure"). Notwithstanding the foregoing: if a Force Majeure continues for more than thirty (30) days, either party may to terminate this agreement by written notice to the other party.
|
||||
|
||||
### 10.5. Notice
|
||||
|
||||
@@ -124,11 +124,11 @@ All notices between the parties shall be in writing and shall be deemed to have
|
||||
|
||||
### 10.6. No Agency
|
||||
|
||||
Both parties agree that no agency, partnership, joint venture, or employment is created as a result of this Agreement. You do not have any authority of any kind to bind Zed.
|
||||
Both parties agree that no agency, partnership, joint venture, or employment is created as a result of this Agreement. You do not have any authority of any kind to bind Zed.
|
||||
|
||||
### 10.7. Governing Law
|
||||
|
||||
This Agreement shall be governed exclusively by, and construed exclusively in accordance with, the laws of the United States and the State of California, without regard to its conflict of laws provisions. The federal courts of the United States in the Northern District of California and the state courts of the State of California shall have exclusive jurisdiction to adjudicate any dispute arising out of or relating to this Agreement. Each party hereby consents to the jurisdiction of such courts and waives any right it may otherwise have to challenge the appropriateness of such forums, whether on the basis of the doctrine of forum non conveniens or otherwise. The United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement or any Purchase Order issued under this Agreement.
|
||||
This Agreement shall be governed exclusively by, and construed exclusively in accordance with, the laws of the United States and the State of California, without regard to its conflict of laws provisions. The federal courts of the United States in the Northern District of California and the state courts of the State of California shall have exclusive jurisdiction to adjudicate any dispute arising out of or relating to this Agreement. Each party hereby consents to the jurisdiction of such courts and waives any right it may otherwise have to challenge the appropriateness of such forums, whether on the basis of the doctrine of forum non conveniens or otherwise. The United Nations Convention on Contracts for the International Sale of Goods shall not apply to this Agreement or any Purchase Order issued under this Agreement.
|
||||
|
||||
### 10.8. Updated Agreement
|
||||
|
||||
|
||||
Reference in New Issue
Block a user