This PR implements the Centered Layout feature (#4685):
- Added the `toggle centered layout` action.
- The centered layout mode only takes effect when there's a single
central pane.
- The state of the centered layout toggle is saved / restored between
Zed restarts.
- The paddings are controlled by the `centered_layout` setting:
```json
"centered_layout": {
"left_padding": 0.2,
"right_padding": 0.2
}
```
This allows us to support both the VSCode-style (equal paddings) and
IntelliJ-style (only left padding in Zen mode).
Release Notes:
- Added support for Centered Layout
([#4685](https://github.com/zed-industries/zed/pull/9754)).
https://github.com/zed-industries/zed/assets/2101250/2d5b2a16-c248-48b5-9e8c-6f1219619398
Related Issues:
- Part of #4382
The changes in #10437 accidentally switched 'x64' to 'x86_64' which
breaks installs on linux x64, macos x64 and windows x64. This yields the
following error:
```
[2024-04-16T12:58:01-04:00 ERROR project] failed to start language server "lua-language-server": no asset found matching "lua-language-server-3.7.4-darwin-x86_64.tar.gz"
[2024-04-16T12:58:01-04:00 ERROR project] server stderr: Some("")
```
It's trying to download:
`lua-language-server-3.7.4-darwin-x86_64.tar.gz`
which should be
`lua-language-server-3.7.4-darwin-x64.tar.gz`
See [LuaLS release
page](https://github.com/LuaLS/lua-language-server/releases/tag/3.6.25).
CC: @maxbrunsfeld
lua.rs before ef4c70c:
c6028f6651/crates/languages/src/lua.rs (L35)
lua.rs after:
5d7148bde1/extensions/lua/src/lua.rs (L49)
Release Notes:
- N/A
This PR renames the `cached_binary` field on the `ZigExtension` back to
`cached_binary_path` to make it match the other extensions.
Release Notes:
- N/A
This was a bug introduced when moving to extensions: when we find a
binary in the user's project environment, we shouldn't cache that
globally since it might not work for other projects.
See also: https://github.com/zed-industries/zed/pull/10559
Release Notes:
- N/A
This uses the language server settings added in #9293 to allow users to
specify the binary path and arguments with which to start up `clangd`.
Example user settings for `clangd`:
```json
{
"lsp": {
"clangd": {
"binary": {
"path": "/usr/bin/clangd",
"arguments": ["--log=verbose"]
},
}
}
}
```
Constraints:
* Right now this only allows ABSOLUTE paths.
Release Notes:
- Added ability to specify `clangd` binary `path` (must be absolute) and
`arguments` in user settings. Example: `{"lsp": {"clangd": {"binary":
{"path": "/usr/bin/clangd", "arguments": ["--log=verbose"] }}}}`
Add some keywords (bracket, quote, etc)to the comments describing
`use_autoclose` preference in the settings json.
This setting took me a while to find -- so now it'll be more easily
searchable for others.
Release Notes:
- N/A
Fixes https://github.com/zed-industries/zed/issues/10611
Zed has `workspace::NewSearch` (without a default keybinding) and
`workspace::DeploySearch` (with the default keybinding for its
`DeploySearch::find()` form).
Use the one with the keybinding, as it's the whole point of the menu.
Release Notes:
- Fixed "Find In Project" app menu item having no keybinding
([10611](https://github.com/zed-industries/zed/issues/10611))
We were previously not conforming to LSP spec, as we were setting
**both** result field and error field on response fields, which could
confuse servers. Excerpt from the spec:
> * The result of a request. This member is REQUIRED on success.
> * This member MUST NOT exist if there was an error invoking the
method.
Fixes#10595
Release Notes:
- N/A
Some code blocks that are returned in tooltips (returned by language
servers, for example) use the language file extension as the language in
the the triple-backtick code blocks.
Example:
```rs
fn rust_code() {}
```
```cpp
fn rust_code() {}
```
Before this change we only looked up the language with the
`rs`/`cpp`/... being interpreted as the language name. Now we also treat
it as a possible file extension.
Release Notes:
- Fixed Markdown code blocks in tooltips not having correct language
highlighting.
Before:
![image](https://github.com/zed-industries/zed/assets/1185253/1f3870a6-467c-4e5f-9e49-1ff32240d10f)
After:
![screenshot-2024-04-16-12 43
39@2x](https://github.com/zed-industries/zed/assets/1185253/21a45ed5-825a-412d-9dc0-35a444fc64ba)
Co-authored-by: Bennet <bennetbo@gmx.de>
This fixes#10511 by turning off the YAML metadata block rendering in
the Markdown parser.
`clangd` uses `---` as dividers, but our parser interpreted it as a YAML
metadata block, even though it didn't contain any valid YAML.
Example Markdown from `clangd`:
### instance-method `format`
---
→ `void`
Parameters:
- `const int &`
- `const std::tm &`
- `int & dest`
---
```cpp
// In my_formatter_flag
public: void format(const int &, const std::tm &, int &dest)
```
What's between the two `---` is *not* valid YAML. Neovim, too,
interprets these as dividers and renders them as such.
And since we don't handle any possible metadata anyway, we can turn off
the metadata handling, which causes the parser to interpret the `---` as
dividers.
Release Notes:
- Fixed Markdown returned by `clangd` being rendered the wrong way.
([#10511](https://github.com/zed-industries/zed/issues/10511)).
Before:
![screenshot-2024-04-16-12 32
15@2x](https://github.com/zed-industries/zed/assets/1185253/a268f106-9504-48aa-9744-42a7521de807)
After:
![screenshot-2024-04-16-12 33
02@2x](https://github.com/zed-industries/zed/assets/1185253/dd178a63-a075-48a9-85d9-565157a5b050)
Co-authored-by: Bennet <bennetbo@gmx.de>
Release Notes:
- Added a setting to show/hide the terminal button in the status bar:
`{"terminal": {"button": false}}` to hide it. (#10513)
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Zed displays scrollbar markers of three types: git diffs, background
highlights and diagnostics. At the moment, the "background highlights"
markers are displayed for all the supported highlights:
- Occurences of the symbol under cursor.
- Search results.
- Scope boundaries (only works when a symbol is selected).
- Active hover popover position.
They all use the same color, which leads to confusing results. For
instance, in the following case I expect to see markers for the
`new_anchor` occurences in lines 43 and 47. But besides them, there're
also scope-markers for `ScrollAnchor` initialization block in lines 46
and 49, which makes me think that there're four places where
`new_anchor` appears.
<img width="740" alt="zed-scrollbar-markers"
src="https://github.com/zed-industries/zed/assets/2101250/78700e6b-fdd1-4c2f-beff-e564d8defc13">
Existing settings `selection` and `symbol_selection` in the `scrollbar`
section [don't work as
expected](https://github.com/zed-industries/zed/pull/10080#discussion_r1552325493),
which increases confusion.
This PR only leaves two types of bg-highlight-markers and provides
dedicated settings for them:
- Occurences of the symbol under cursor. Setting: `selected_symbol`,
default is `true`.
- Search results. Setting: `search_results`, default is `true`.
The `selection` and `symbol_selection` settings are not used anymore.
Release Notes:
- Breaking changes. Settings `selection` and `symbol_selection` in the
`scrollbar` section renamed to `search_results` and `selected_symbol`
respectively. Fixed the effect of these settings on which markers are
displayed on the scrollbar.
Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.
- N/A
/cc @mrnugget
This moves the diagnostics and find all references to be in line with
the search pane. This also centralizes the constant into the editor code
base.
Release Notes:
- Increased diagnostic context to match the project search context.
This PR updates the extension list to disable remote entries when the
corresponding dev extension is installed.
Here is what this looks like:
<img width="1189" alt="Screenshot 2024-04-15 at 4 09 45 PM"
src="https://github.com/zed-industries/zed/assets/1486634/48bb61d4-bc85-4ca6-b233-716831dfa7d8">
Release Notes:
- Disabled extension entries when there is a development copy of that
extension installed.
Fixes the cursor not updating when (a) switching windows from another
program via a shortcut and (b) when cursor updates were triggered by
something other than moving the mouse (e.g. when scrolling or pressing a
key).
Release Notes:
- N/A
This PR makes it so clicking "Install" will install the latest
compatible version of an extension instead of disabling the button when
the latest version is not compatible.
The "Upgrade" button will still be disabled when the latest version is
not compatible. We will also now display a tooltip to better indicate
why the button is disabled:
<img width="607" alt="Screenshot 2024-04-15 at 2 41 26 PM"
src="https://github.com/zed-industries/zed/assets/1486634/16ad516e-1c0c-4505-b994-158ea655641b">
Related to https://github.com/zed-industries/zed/issues/10509.
Release Notes:
- Changed the "Install" button for extensions to always install the
latest compatible version instead of becoming disabled when the latest
version of an extension is incompatible with the current Zed version.
This PR adds an indicator to show what extension version is currently
installed when on an extension version that is not the latest.
<img width="1156" alt="Screenshot 2024-04-15 at 2 10 33 PM"
src="https://github.com/zed-industries/zed/assets/1486634/61c5e4cf-a0b8-48fc-8e52-f04f1c351794">
Release Notes:
- Added an indicator to show the currently-installed extension version
when not on the latest version.
This fixes an issue that could cause `from_iter` to never finish if the
underlying iterator restarted after returning `None` for the first time.
We only saw this in development but I wanna cherry-pick it to stable and
preview, just in case.
Release Notes:
- N/A
Co-authored-by: Kyle <kylek@zed.dev>