This PR addresses feedback from @maxbrunsfeld on new replace in buffer.
It fixes:
- missing padding surrounding replace input.
- missing padding around replace buttons.
- missing `.notify` call which made the replace fields not show up
immediately sometimes.
Release Notes:
- N/A
---------
Co-authored-by: Max <max@zed.dev>
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.
I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:
- Added "Replace" functionality to buffer search.
The major change here is a refactoring to allow controling the save
behaviour when closing items, which is pre-work needed for vim command
palette.
For zed-industries/community#1868
This should have no user-visible impact.
For vim `.` to repeat it's important that actions are replayable.
Currently editor::MoveDown *sometimes* moves the cursor down, and
*sometimes* selects the next completion.
For replay we need to be able to separate the two.
The latter is not posible to press in Zed, since `:` is typed as
`shift-;` with typical US keyboard layouts.
In the end, it's the same buttons you have to press to toggle the inlay
hints, but working this time.
- Tighten up toolbar
- Reduce intensity of active tools
- Remove divider between project + branch
- Add a styletree for toolbar + move breadcrumb into it
- Some ts theme tidying
[[PR Description]]
Release Notes:
- Improved density and contrast of a number of UI elements.
This changes vim motions to be relative to fold lines, not display
lines, to match the behaviour of vim.
This is necessary for relative line numbers to make sense (as the most
important thing is you can do `3j` to get th e line that is numbered 3).
Release Notes:
- vim: Fix handling of motions when `soft_wrap` is enabled in zed. Like
in vim `j,k,up,down,$,^,0,home,end` will all now navigate in file
coordinates not display coordinates.
- vim: Add `g {j,k,up,down,$,^,0,home,end}` to navigate in display
coordinates.
- vim: Add `z o` and `z c` to open and close folds.
- vim: Add `z f` in visual mode to fold selection.
Note: this may be a jarring change if you're grown used to the current
behaviour of `j` and `k`. You can make the issue less acute by setting
`"soft_wrap":"none"` in your settings; or you can manually copy the
bindings for `g j` to the binding for `j` (etc.) in your keymap.json to
preserve the existing behaviour.
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).
To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:
- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line
Fixes: zed-industries/community#1562
- vim: support P for paste before
- vim: support P in visual mode for paste without overriding clipboard
- vim: fix position when using `p` on text copied outside zed
- vim: fix indentation when using `p` on text copied from zed
[This PR has been sitting around for a
bit](https://github.com/zed-industries/zed/pull/2845). I received a bit
of mixed opinions from the team on how this setting should work, if it
should use the full model names or some simpler form of it, etc. I went
ahead and made the decision to do the following:
- Use the full model names in settings - ex: `gpt-4-0613`
- Default to `gpt-4-0613` when no setting is present
- Save the full model names in the conversation history files (this is
how it was prior) - ex: `gpt-4-0613`
- Display the shortened model names in the assistant - ex: `gpt-4`
- Not worry about adding an option to add custom models (can add in a
follow-up PR)
- Not query what models are available to the user via their api key (can
add in a follow-up PR)
Release Notes:
- Added a `default_open_ai_model` setting for the assistant (defaults to
`gpt-4-0613`).
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Increase the indent size on channels
Switch font UI mono
Release Notes:
- Switch the collaboration panel font to Zed's sans-mono (preview only)
- Switch the default dock side to the left (preview-only)
- Increase the indent size on the channels panel (preview-only)
This isn't quite an exact emulation, as instead of using one selection
that is magically in "column mode", we emulate it with a bunch of zed
multi-selections (one per line).
I think this is better, as it requires fewer changes to the codebase,
and lets you see the impact of any changes immediately on all lines.
Fixes: zed-industries/community#984
Update vim mode to have vim selection and editor selections match.
Before this we had to adjust between vim selections and real selections
when making changes; now we have to adjust when making selections.
Release Notes:
- vim: Ensure editor selection matches the vim selection
([#1796](https://github.com/zed-industries/community/issues/1796)).
- vim: Fix `s` in visual line mode
- vim: Add `o` and `shift-o` to toggle direction of visual selection
- vim: Fix `v` and `shift-v` to toggle back to normal mode
- vim: Fix block selections like `vi}` to contain correct whitespace
These primarily happen when first entering visual mode, but can also
be created with objects like `vi{`.
Along the way fix the way ranges like `vi{` are selected to be more
similar to nvim.
using zed more and more to develop zed itself I'm finding some small qol
features missing, this is one of them
I'm very used to open two or three splits, and sometimes I want to close
everything except for the active editor, but that wasn't supported, as
the `pane::CloseInactiveItems` action only closes inactive items on the
active pane
so I've implemented it really quick, although I'm not sure it's the
right way to do this
note: I really don't like the default keybinding I've set it to, I have
this action bound to `cmd-shift-w` on all editors, but in zed is taken,
so I chose something that's free but without thinking too much about it
Release Notes:
- Added action for closing inactive editors from all panes
@mikayla-maki for 👀
[This PR added in the ability to rename a file via
`enter`](https://github.com/zed-industries/zed/pull/2784). Previously,
`enter` was used to both open a file and confirm a rename, so this PR
changes the opening of a file to use `space`, which is what VS Code
uses. It also makes a bit more sense because now `enter` is just used to
start a rename and confirm the rename, vs being used for 2 different
actions.
N/A on the release notes, as I adjusted the release note in the
previously-tagged PR.
Release Notes:
- N/A
Refactors some of the vim bindings to make the vim.json file less
obtuse.
Release Notes:
- vim: add `;` and `,` to repeat last `{f,F,t,T}`
- vim: add zed-specific shortcuts for common IDE actions:
- - `g A` to find all references
- - `g .` to open the code actions menu.
- - `c d` for rename
This previously enabled things like `d g g` to work, but we can
fix that instead by not clearing out pending vim state on change.
Either way, it is unnecessary and causes some user-confusion
(zed-industries/community#176), so remove this code for now; and use
comments to organize the file a bit instead.
Primarily {h,j,k,l,left,right,up,down} for moving to a pane by
direction; but also {w,W,p} for going forward/back, and {v,s} for
splitting a pane vertically/horizontally, and {c,q} to close a pane.
There are a large number of ctrl-w commands that are not supported, and
which fall into three buckets:
* switch this pane with that one (VScode also has this, and it's a
requested feature)
* move to top/bottom/leftmost/rightmost
* counts on any of these
* jump to "definition/file-under-cursor/etc.etc." in a new pane.
This PR adds the next most requested editor feature.
TODO:
- [x] Figure out styles and icons for supported file types with
fixes https://github.com/zed-industries/community/issues/206
Release Notes:
- Added file icons
As part of this I added `assert_shared_state()` to the
NeovimBackedTestContext so that it is more like a drop-in replacement
for the VimTestContext.
The remaining part of zed-industries/community#682 is adding bracket
matching to plain text. It looks like the current logic requires there
to be a tree sitter language for the language in order to support
bracket matching. I didn't fix this in this PR because I was unsure
whether to try and work around that, or to try and add a plain text tree
sitter language.
Release Notes:
- vim: support `{` and `}` for paragraph motion
([#470](https://github.com/zed-industries/community/issues/470)).
- vim: fix `%` at the end of the line
([#682](https://github.com/zed-industries/community/issues/682)).
When you hit <escape> in the command palette, it first editor::Cancel
because the command palette is also a focused editor; this binding was
catching before the `menu::Cancel` that you probably want.
From looking at the uses of editor::Cancel it seems like the only way to
trigger this is with <escape> in an editor. Rather than trying to hook
into the existing editor cancel and add vim-specific behaviour, we'll
instead take responsibility for binding directly to <escape> when
necessary.
Fixes: zed-industries/community#1347
After #2641 we noticed that scrolling didn't take a count parameter, and
a few other issues with the way that we calculated the distance to
scroll.
Release Notes:
- Improved distance calculations for page-up/page-down
- vim: Allow counts to work with scrolling shortcuts.
Fixes: zed-industries/community#1690
I'm not sure this is the correct way to fix this...
* A simpler approach would be to just say `!showing_code_actions` in the
binding file (as `showing_completions` can only happen in insert mode -
and `VimControl` will be false). This seemed a little error prone if
more menus were added in the future.
* A more complicated approach would be to copy the way this is done from
the MouseContextMenu, which registers its own keyboard shortcuts, and as
such uses those when it's open. This seems "more correct", but is a
major refactoring for a very small reward.
Release Notes:
- vim: Fix code actions menu
([#1690](https://github.com/zed-industries/community/issues/1690))
After #2641 we noticed that scrolling didn't take a count parameter.
The PageDown/PageUp logic was also broken by an additional -1 (for both
vim mode and not).