This PR fixes autoscroll flickering issue caused by recent
[#24735](https://github.com/zed-industries/zed/pull/24735) which fixes
soft wrap scroll issues. No release notes, as this was few hours ago.
Adding vertical scrollbar width to viewport width, so that autoscroll
function don't try to that much pixels extra.
Release Notes:
- N/A
Closes#10232
Context:
We have three ways to open files or dirs in Zed: `zed`, `zed --new`, and
`zed --add`. `--new` forces the project to open in a new window, while
`--add` forces it to open in an existing window (even if the dir isn’t a
subdir of an existing project or the file isn’t part of it).
Using just `zed` tries to open it in an existing window based on similar
logic of `--add`, but if no related project is found the dir, opens in a
new window.
Problem:
Right now, subdirs that are part of an existing project open in the
existing window when using `zed`. By default, subdirs should open in a
new window instead. If someone wants to open it in the existing window,
they can explicitly use `--add`. After this PR, only root dir and files
will focus on existing window, when `zed ` is used.
Fix:
For the `zed` case, we’ve filtered out subdirs in the logic that assigns
them to an existing window.
Release Notes:
- Fixed an issue where subdirectories of an already opened project, when
opened via the terminal, would open in the existing project instead of a
new window.
- [x] Staging hunks
- [x] Unstaging hunks
- [x] Write a randomized test
- [x] Get test passing
- [x] Fix existing bug in diff_base_byte_range computation
- [x] Remote project support
- [ ] ~~Improve performance of
buffer_range_to_unchanged_diff_base_range~~
- [ ] ~~Bug: project diff editor scrolls to top when staging/unstaging
hunk~~ existing issue
- [ ] ~~UI~~ deferred
- [x] Tricky cases
- [x] Correctly handle acting on multiple hunks for a single file
- [x] Remove path from index when unstaging the last staged hunk, if
it's absent from HEAD, or staging the only hunk, if it's deleted in the
working copy
Release Notes:
- Add `ToggleStagedSelectedDiffHunks` action for staging and unstaging
individual diff hunks
Closes#22252
This PR fixes the bug introduced in
https://github.com/zed-industries/zed/pull/19495 by:
Problem:
The vertical scrollbar is currently rendered absolutely on top of the
editor. When calculating soft wrap, the editor uses its width to decide
how many words fit on a line. This causes words to overlap with the
vertical scrollbar because it doesn't account for the scrollbar's width.
To fix the overlap, extra overflow is added to the scrollbar, which
solves the issue but creates unnecessary scrolling in soft wrap mode.
Fix:
The editor width is adjusted to account for the scrollbar's width. This
makes sure the correct number of words fit on a line and prevents
overlapping with the scrollbar in soft wrap mode.
Since the scrollbar width is now accounted for in the editor's width,
there's no need to add extra overflow, unless there’s no soft wrap. In
that case, when text overflows the editor’s width, we still need to add
extra overscroll to match the scrollbar width. Without this, long lines
will overlap with the scrollbar.
Release Notes:
- Fixed issue where horizontal scrollbar would scroll few characters
width when soft wrap is active.
This makes the tab tab tab experience smoother
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: as-cii <as-cii@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Ben <ben@zed.dev>
This PR puts the "Eager Preview Mode" menu entry behind a feature flag
rather than a staff flag.
Currently it defaults to `false` for staff so that it doesn't leak into
any marketing/launch materials.
Folks who want to see it can opt-in to the flag explicitly, for now.
Release Notes:
- N/A
closes https://github.com/zed-industries/zed/issues/19620.
I am not 100% sure on how to test this though. @elithrar: would you mind
giving this branch a shot and seeing if it works for you? I kicked off
bundling for this pull request and you should be able to download a DMG
from the CI artifacts as soon as it's done building.
Release Notes:
- Fixed a bug that caused OS-level CA certificate bundles to not be
respected.
---------
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
This PR updates the file icon mappings such that:
- C# (`.cs`) files map to the `csharp` key
- Cue (`.cue`) files map to the `cue` key
- GitLab YAML (`gitlab-ci.yml`) files map to the `gitlab` key
- Luau (`.luau`) files map to the `luau` key
- Solidity (`.sol`) files map to the `solidity` key
Release Notes:
- Icon themes: Added the ability to change the file icon for C# (`.cs`)
files.
- Icon themes: Added the ability to change the file icon for Cue
(`.cue`) files.
- Icon themes: Added the ability to change the file icon for GitLab YAML
(`gitlab-ci.yml`) files.
- Icon themes: Added the ability to change the file icon for Luau
(`.luau`) files.
- Icon themes: Added the ability to change the file icon for Solidity
(`.sol`) files.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Rationale for the changes:
* `requires migration` -> `uses some deprecated settings` changed
because really it isn't required by this version of Zed, and I believe
we hope to offer support for deprecated settings and their migration for
a long time.
* Rename of `migration` -> `updated` is because to me, "updated" feels
lighter and more accurate. To me migration has connotations of moving to
a whole new format.
Formatting changes are due to shortening the line causing cargo fmt to
go from not formatting the code to doing so.
Release Notes:
- N/A
---------
Co-authored-by: smit <0xtimsb@gmail.com>
This PR adds:
- Support for deprecated keymap and settings (In-memory migration)
- Migration prompt only shown in `settings.json` / `keymap.json`.
Release Notes:
- The migration banner will only appear in `settings.json` and
`keymap.json` if you have deprecated settings or keybindings, allowing
you to migrate them to work with the new version on Zed.
Moves tab whitespace insertion logic out of `AcceptEditPrediction`
handler.
`edit_prediction_requires_modifier` context will now be true when on a
line with leading whitespace, so that `alt-tab` is used to accept
predictions in this case. This way leading indentation can be typed when
edit predictions are visible
Release Notes:
- N/A
Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Joao <joao@zed.dev>
This PR adds support for configuring both a light and dark icon theme in
`settings.json`.
In addition to accepting just an icon theme name, the `icon_theme` field
now also accepts an object in the following form:
```jsonc
{
"icon_theme": {
"mode": "system",
"light": "Zed (Default)",
"dark": "Zed (Default)"
}
}
```
Both `light` and `dark` are required, and indicate which icon theme
should be used when the system is in light mode and dark mode,
respectively.
The `mode` field is optional and indicates which icon theme should be
used:
- `"system"` - Use the icon theme that corresponds to the system's
appearance.
- `"light"` - Use the icon theme indicated by the `light` field.
- `"dark"` - Use the icon theme indicated by the `dark` field.
Closes https://github.com/zed-industries/zed/issues/24695.
Release Notes:
- Added support for configuring both a light and dark icon theme and
switching between them based on system preference.
Don't animate the cursor when previewing jumps.
Instead, display the jump popover with a line that resembles a cursor,
indicating the jump destination. If the jump destination is outside of
the view port, there is an extra step in which `tab` scrolls the
viewport to reveal the jump destination.
Release Notes:
- N/A
---------
Co-authored-by: danilo-leal <daniloleal09@gmail.com>
Co-authored-by: agu-z <hi@aguz.me>
In an effort to squash bugs like:
https://github.com/zed-industries/zed/issues/19620, and improve
confidence on PRs like:
https://github.com/zed-industries/zed/pull/24656, I created this little
test script using `mitmproxy` to simulate the situation.
Unfortunately, I don't see any issues with our current usage of the
local certificate store using this script. But I'd like to have it as a
base to build off of.
Release Notes:
- N/A
Re-lands https://github.com/zed-industries/zed/pull/24446 with a more
appropriate fix
https://github.com/user-attachments/assets/45f665f0-473a-49bd-b013-b9d1bdb902bd
After activating 2nd diagnostics group, `find_map` code for next
diagnostics did not skip the previous group for the same place.
This time, instead of fiddling with the diagnostics group comparison,
the code splits the diagnostics by search place, looks up the active
group (if any) in both split parts, and selects the entries after the
group elements.
Release Notes:
- Fixed `editor::GoToDiagnostics` action stuck when multiple diagnostics
groups belong to the same place
This PR updates the `GET /user` endpoint to update the user's email and
name from the provided GitHub profile information on sign-in.
Currently, these fields were only set when the user was first created.
Release Notes:
- N/A
This PR does some clean up for the edit predictions settings:
- Removed `editor.show_edit_predictions_in_menu`
- Renamed `edit_predictions.inline_preview` to `edit_predictions.mode`
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <agus@zed.dev>
This PR adds the ability to change the predict edits URL using the
`ZED_PREDICT_EDITS_URL` environment variable.
This allows for easily pointing Zed to a development version of the
Cloudflare Worker.
Release Notes:
- N/A
The `.mjsx`, `.cjsx`, `.mtsx`, and `.ctsx` file extensions are also
designed to contain JSX code.
Release Notes:
- Added file icon associations for more React files (`.mjsx`, `.cjsx`,
`.mtsx`, `.ctsx`).
Closes#21967
Add actions `CopyFileName` and `CopyFileNameWithoutExtension` to be used in the command palette.
Release Notes:
- Added commands `editor: copy file name` and `editor: copy file name without extensions`.