According to #23223, manually setting `RUSTFLAGS` env var overrides
settings in `.cargo/config.toml`. Since users possibly may set their own
`RUSTFLAGS` when building, this creates an avenue where builds may fail
for really strange reasons that are difficult to debug.
This PR adds notes to the troubleshooting section to avoid setting
`RUSTFLAGS`, and offers alternatives which do not conflict.
This problem most recently affected nightly CI builders since we had
been setting `RUSTFLAGS` in our workflows to enable custom things like
gles or compiling with a specific target cpu. PR #23117 caused builds to
fail unless they were compiled with `-C target-feature=+crt-static`,
which due to this issue the `RUSTFLAGS` env var we set overrode the
`config.toml` compile flags, causing our builds to fail.
Release Notes:
- N/A
Closes#4798
This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.
While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.
Preview:
https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f
Todo:
- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal
Release Notes:
- Added scrollbar to the terminal
I’ve also updated the documentation in
`development\local-collaboration.md` and
`docs\src\development\windows.md`.
Testing collab on my Windows machine:
![屏幕截图 2025-01-14
162021](https://github.com/user-attachments/assets/28b4a36a-e156-4012-981a-5d0a23dcc613)
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
It seems the original author intended to write either "`ctrl+c` to copy"
or "`ctrl+v` to paste". Updated to be "`ctrl+v` to paste".
Release Notes:
- N/A
Co-authored-by: Michael Sloan <michael@zed.dev>
Add a missing } in the multiple formatters example in the configuring
Zed section of the manual.
Release Notes:
- Fixed a missing } in the multiple formatters doc example
Closes#9656. Continuation of #9654, but with the addition of backwards
compatibility for the existing captures.
Release Notes:
- Improved Tree-sitter support with added compatibility for standard
injections captures
---------
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Added documentation explaining that clangd requires
`compile_commands.json` for proper functionality in both C and C++
projects. Includes instructions for generating the file using CMake.
This is related to
https://github.com/zed-industries/zed/discussions/6480
Release Notes:
- N/A
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
- Little tweaks to wording and punctuation
- Remove redundancy on the Configuration and Key binding sections
- Ensure key bindings for the sections mentioned above appear
Release Notes:
- N/A
Hello,
This PR documents the `use_bundler` configuration option that was added
in https://github.com/zed-extensions/ruby/releases/tag/v0.3.3
**What it does?**
This option allows users to run `solargraph` and `rubocop` within the
context of Bundler, which is the most commonly used scenario in the Ruby
ecosystem. Ruby LSP is not configured to run in the context of Bundler
because it is recommended not to add it to the project dependencies
(https://shopify.github.io/ruby-lsp/composed-bundle.html). However, if
this is the case, the Ruby LSP can still be configured to run in the
context of Bundler via the same configuration option.
This configuration option has the following default values:
- `rubocop` - `use_bundler` is `true`.
- `solargraph` - `use_bundler` is `true`.
- `ruby-lsp` - `use_bundler` is `false`.
Release Notes:
- N/A
Closes#22272
Release Notes:
- Added documentation for the new "bounded" mode in the soft_wrap
configuration
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Closes#13585
Currently, saving files with `root` ownership or `root` as the group
throws a `Permission denied (os error 13). Please try again.` error.
This PR fixes the issue on Linux by prompting the user for a password
and saving the file with elevated privileges.
It uses `pkexec` (Polkit), which is by default available on GNOME, KDE,
and most Linux systems. I haven't implemented this for macOS as I don't
have a device to test it on.
This implementation is similar to how Vscode handles it. Except, they
don't show custom message.
**Working**:
When file saving fails due to a `PermissionDenied` error, we create a
temporary file in the same directory as the target file and writes the
data to this temporary file. After, the contents of this file are copied
to the original file using the `tee` command instead of `cp` or `mv`.
This ensures that the ownership and permissions of the original file are
preserved. This command is executed using `pkexec` which will prompt
user for their password.
**Custom Message**:
The message displayed to the user in the prompt is automatically
retrieved from the `org.zed.app.policy` file, which is located at
`/usr/share/polkit-1/actions/`. This file should be installed during the
setup process. While the policy file is optional, omitting it will cause
the user to see the underlying command being executed rather than a
user-friendly message. Currently, VSCode does not display the
user-friendly message.
The policy file must specify a unique binary, ensuring that only that
binary can use the policy file. It cannot be as generic as a
`/bin/bash`, as any software using bash to prompt will end up showing
Zed’s custom message. To address this, we will create a custom bash
script, as simple as the following, placed in `/usr/bin/zed/elevate.sh`.
The script should have root ownership and should not reside in the home
directory, since the policy file cannot resolve `$HOME`.
```sh
#!/bin/bash
eval "$@"
```
*IMPORTANT NOTE*
Since copying the policy file and our script requires sudo privileges,
the installation script will now prompt for the password at very end.
Only on Linux, if `pexec` is installed.
Screenshots:
KDE with policy file:
![Screenshot from 2024-12-15
22-13-06](https://github.com/user-attachments/assets/b8bb7565-85df-4c95-bb10-82e50acf9b56)
Gnome with policy file:
![Screenshot from 2024-12-15
22-21-48](https://github.com/user-attachments/assets/83d15056-a2bd-41d9-a01d-9b8954260381)
Gnome without policy file:
![image](https://github.com/user-attachments/assets/66c39d02-eed4-4f09-886f-621b6d37ff43)
VSCode:
![image](https://github.com/user-attachments/assets/949dc470-c3df-4e2f-8cc6-31babaee1d18)
User declines the permission request:
![image](https://github.com/user-attachments/assets/c5cbf056-f6f9-43a8-8d88-f2b0597e14d6)
Release Notes:
- Fixed file saving with root ownership on Linux.
Update macOS system requirements to include Sequoia (15.x), the latest
major version.
Release Notes:
- N/A
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
![editor_scrollbars](https://github.com/user-attachments/assets/76c26776-8fe4-47f8-9c79-9add7d7d2151)
Closes#4427
Release Notes:
- Added a horizontal scrollbar to the editor panel
- Added `axis` option to `scrollbar` in the Zed configuration, which can
forcefully disable either the horizontal or vertical scrollbar
- Added `horizontal_scroll_margin` equivalent to
`vertical_scroll_margin` in the Zed configuration
Rough Edges:
This feature seems mostly stable from my testing. I've been using a
development build for about a week with no issues. Any feedback would be
appreciated. There are a few things to note as well:
1. Scrolling to the lower right occasionally causes scrollbar clipping
on my end, but it isn't consistent and it isn't major. Some more testing
would definitely be a good idea. [FIXED]
2. Documentation may need to be modified
3. I added an `AxisPair` type to the `editor` crate to manage values
that have a horizontal and vertical variant. I'm not sure if that's the
optimal way to do it, but I didn't see a good alternative. The `Point`
type would technically work, but it may cause confusion.
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Follow-up of https://github.com/zed-industries/zed/pull/22004
* Reuse center terminals for tasks, when requested
* Extend task templates with `RevealTarget`, moving it from
`TaskSpawnTarget` into the core library
* Use `reveal_target` instead of `target` to avoid misinterpretations in
the task template context
* Do not expose `SpawnInTerminal` to user interface, avoid it
implementing `Serialize` and `Deserialize`
* Remove `NewCenterTask` action, extending `task::Spawn` interface
instead
* Do not require any extra unrelated parameters during task resolution,
instead, use task overrides on the resolved tasks on the modal side
* Add keybindings for opening the task modal in the
`RevealTarget::Center` mode
Release Notes:
- N/A
Closes#20060Closes#20720Closes#19873Closes#9445
Release Notes:
- Fixed a bug where tasks would be spawned with their working directory
set to a file in some cases
- Added the ability to spawn tasks in the center pane, when spawning
from a keybinding:
```json5
[
{
// Assuming you have a task labeled "echo hello"
"ctrl--": [
"task::Spawn",
{ "task_name": "echo hello", "target": "center" }
]
}
]
```
Closes https://github.com/zed-industries/zed/issues/6843
I don't see where is the logic to remove old document highlight when new
one applies,
ideally, old highlight should be cleared as soon as possible when cursor
moves if the new position does not
sits in old highlight ranges to avoid linger highlights described in
https://github.com/zed-industries/zed/issues/13682#issuecomment-2498368680.
So current solution is still not ideal, because only when lsp responses
highlight ranges (even is a empty set) can we clear the old one.
Release Notes:
- Added a setting `lsp_highlight_debounce` to configure delay for
querying highlights from language server.
---------
Co-authored-by: mgsloan@gmail.com <michael@zed.dev>
Release Notes:
- Added `show_completions_on_input` and `show_completion_documentation`
per-language settings. These settings were available before, but were
not configurable per-language.