Commit Graph

959 Commits

Author SHA1 Message Date
Piotr Osiewicz
39e0e26d1d
Line numbers short mode (#10354)
Followup to #10327 
It can be enabled with the following setting:

"line_indicator_format": "short"

No release note, as the original change didn't go out to Preview yet.

/cc @bartekpacia @0x2CA

Release Notes:

- N/A
2024-04-10 12:08:07 +02:00
Nathan Sobo
414058379b
Switch to the system UI font on macOS (#10317)
To reference the system font, use the special ".SystemUIFont" family
name.

/cc @PixelJanitor 

Release Notes:

- Switched to the system UI  font for user interface elements on macOS.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2024-04-09 07:44:57 -06:00
Andrew Lygin
935e0d547e
Improve Find/Replace shortcuts (#10297)
This PR changes ways the Find/Replace functionality in the
Buffer/Project Search is accessible via shortcuts. It makes those panels
work the same way as in VS Code and Sublime Text.

The details are described in the issue: [Make Find/Replace easier to
use](https://github.com/zed-industries/zed/issues/9142)

There's a difficulty with the Linux keybindings:

VS Code uses on MacOS (this PR replicates it):

| Action | Buffer Search | Project Search |
| --- | --- | --- |
| Find | `cmd-f` | `cmd-shift-f` |
| Replace | `cmd-alt-f` | `cmd-shift-h` |

VS Code uses on Linux (this PR replicates all but one):

| Action | Buffer Search | Project Search |
| --- | --- | --- |
| Find | `ctrl-f` | `ctrl-shift-f` |
| Replace | `ctrl-h`  | `ctrl-shift-h` |

The problem is that `ctrl-h` is already taken by the `editor::Backspace`
action in Zed on Linux.

There's two options here:

1. Change keybinding for `editor::Backspace` on Linux to something else,
and use `ctrl-h` for the "replace in buffer" action.
2. Use some other keybinding on Linux in Zed. This PR introduces
`ctrl-r` for this purpose, though I'm not sure it's the best choice.

What do you think?

fixes #9142

Release Notes:

- Improved access to "Find/Replace in Buffer" and "Find/Replace in
Files" via shortcuts (#9142).

Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.

- N/A
2024-04-08 22:07:59 -07:00
Marshall Bowers
7c5bc3c26f
Add the ability for extensions to provide language settings (#10296)
This PR adds the ability for extensions to provide certain language
settings via the language `config.toml`.

These settings are then merged in with the rest of the settings when the
language is loaded from the extension.

The language settings that are available are:

- `tab_size`
- `hard_tabs`
- `soft_wrap`

Additionally, for bundled languages we moved these settings out of the
`settings/default.json` and into their respective `config.toml`s .

For languages currently provided by extensions, we are leaving the
values in the `settings/default.json` temporarily until all released
versions of Zed are able to load these settings from the extension.

---

Along the way we ended up refactoring the `Settings::load` method
slightly, introducing a new `SettingsSources` struct to better convey
where the settings are being loaded from.

This makes it easier to load settings from specific locations/sets of
locations in an explicit way.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-04-08 19:17:12 -04:00
Conrad Irwin
f327118e06
vim: Allow search with operators & visual mode (#10226)
Fixes: #4346

Release Notes:

- vim: Add search motions (`/,?,n,N,*,#`) in visual modes and as targets
for operators like `d`,`c`,`y`
([#4346](https://github.com/zed-industries/zed/issues/4346)).
2024-04-08 15:20:14 -06:00
Hans
44aed4a0cb
Add surrounds support for vim (#9400)
For #4965

There are still some minor issues: 
1. When change the surround and delete the surround, we should also
decide whether there are spaces inside after deleting/replacing
according to whether it is open parentheses, and replace them
accordingly, but at present, delete and change, haven't done this
adaptation for current pr, I'm not sure if I can fit it in the back or
if it needs to be fitted together.
2. In the selection mode, pressing s plus brackets should also trigger
the Add Surrounds function, but this MR has not adapted the selection
mode for the time being, I think we need to support different add
behaviors for the three selection modes.(Currently in select mode, s is
used for Substitute)
3. For the current change surrounds, if the user does not find the
bracket that needs to be matched after entering cs, but it is a valid
bracket, and will wait for the second input before failing, the better
practice here should be to return to normal mode if the first bracket is
not found
4. I reused BracketPair in language, but two of its properties weren't
used in this mr, so I'm not sure if I should create a new struct with
only start and end, which would have less code

I'm not sure which ones need to be changed in the first issue, and which
ones can be revised in the future, and it seems that they can be solved

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-04-08 11:41:06 -06:00
Mike Sun
bcdae9fefa
Add settings to hide/show navigation history buttons (#10240)
This is another variant for this [original
PR](https://github.com/zed-industries/zed/pull/10091) to add settings to
show/hide navigation history buttons that puts the settings under a new
section called `tab_bar`:

```
  "tab_bar": {
    // Whether or not to show the navigation history buttons.
    "show_nav_history_buttons": true
  }
```

<img width="314" alt="Screenshot 2024-04-02 at 3 00 53 PM"
src="https://github.com/zed-industries/zed/assets/1253505/23c4fa19-5a63-4160-b3b7-1b5e976c36bf">
<img width="329" alt="Screenshot 2024-04-02 at 3 01 03 PM"
src="https://github.com/zed-industries/zed/assets/1253505/64c2ebd2-9311-4589-a4e8-bd149c6c4ece">
2024-04-08 10:46:36 -04:00
Piotr Osiewicz
7aef447f47
chore: Remove tasks.md (#10273)
The file has been moved over to zed.dev repo and resurrected some time
ago.

Release Notes:

- N/A
2024-04-08 16:21:24 +02:00
Andrew Dunbar
c64c2758c0
Fix reference to soft_wrap option in comment (#10239)
Brought this up briefly in Discord:
https://discord.com/channels/869392257814519848/873293828805771284/1226224505760776192

Release Notes:

- Fixed an incorrect reference to the `soft_wrap` setting in the default
settings documentation.
2024-04-06 15:46:06 -04:00
Mikayla Maki
3aa242e076
Disable format on save for C and C++ (#10141)
We want Zed to be opinionated and low-configuration. Your code editor
should get out of the way, and just do the right thing.

However, some ecosystems aren't opinionated enough for us to
automatically detect the right way to format your code, so let's turn it
off.

Release Notes:

- Disabled `format_on_save` by default in C and C++.
2024-04-05 19:25:53 -07:00
joaquin30
bf9b443b4a
vim: Support gn command and remap gn to gl (#9982)
Release Notes:

- Resolves #4273

@algora-pbc /claim #4273

This is a work-in-progress. The process for `gn` command is:

- maintain updated vim.workspace_state.search.initial_query
- modify editor.select_next_state with
vim.workspace_state.search.initial_query
- use editor.select_next()
- merge selections
- set editor.select_next_state to previous state

To make this possible, several private members and editor structures are
made public. `gN` is not yet implemented and the cursor still does not
jump to the next selection in the first use.

Maybe there is an better way to do this?

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-04-05 20:23:37 -06:00
Drazen
cedbfac844
Fix typo (#10183)
Release Notes:

- N/A
2024-04-05 01:07:19 +02:00
Conrad Irwin
73d8a43c81
vim: Allow : in empty panes and screen shares (#10171)
Release Notes:

- vim: Fixed `:` when no files are open
2024-04-04 14:24:49 -06:00
Andrew Lygin
57a1b9b2cd
tab_switcher: Add tab close buttons (#9968)
Support for closing tabs from Tab Switcher:

- Close button color matches the indicator color to preserve the
information that the buffer is dirty (as in SublimeText).
- `ctrl-backspace` closes the currently selected item.


https://github.com/zed-industries/zed/assets/2101250/8ea33911-2f62-4199-826d-c17556db8e9a

Release Notes:

- N/A
2024-04-03 17:28:51 +02:00
Mikayla Maki
1da2441e7b
Fix assorted linux issues (#10061)
- Fix a bug where modifiers would be dispatched before they changed
- Add a secondary modifier
- Improve keybindings

Release Notes:

- N/A
2024-04-01 17:22:59 -07:00
Stephen Belanger
30fad09dac
Use hard tabs for Makefiles (#9978)
If you use soft tabs by default, editing Makefiles will be broken as
they require tab indentation to parse correctly.

Release Notes;

- Changed default settings for `Makefile`s to use hard tabs.
2024-04-01 12:47:08 -04:00
Marshall Bowers
954c772e29
Use ignored color from theme for items ignored by Git (#10038)
This PR updates the color of the label used for Git-aware items to use
the `ignored` color from the theme when the item is ignored by Git.

The built-in themes have had their `ignored` color updated to match
`text.disabled`, as the existing `ignored` color did not sufficiently
differentiate from non-ignored items.

Fixes #9976.

Release Notes:

- Updated items in the project panel to use the `ignored` color from the
theme when they are ignored by Git
([#9976](https://github.com/zed-industries/zed/issues/9976)).
2024-04-01 11:34:49 -04:00
Joseph T. Lyons
8dc3d719bb
Add default keybinding for ToggleGitBlame (#9972) 2024-03-29 16:56:14 -04:00
Piotr Osiewicz
cff9ad19f8
Add spawning of tasks without saving them in the task stack (#9951)
These tasks are not considered for reruns with `task::Rerun`. 
This PR tears a bunch of stuff up around tasks:
- `menu::SecondaryConfirm` for tasks is gonna spawn a task without
storing it in history instead of being occupied by oneshot tasks. This
is done so that cmd-clicking on the menu item actually does something
meaningful.
- `menu::UseSelectedQuery` got moved into picker, as tasks are it's only
user (and it doesn't really make sense as a menu action).

TODO:
- [x] add release note
- [x] Actually implement the core of this feature, which is spawning a
task without saving it in history, lol.

Fixes #9804 
Release Notes:

- Added "fire-and-forget" task spawning; `menu::SecondaryConfirm` in
tasks modal now spawns a task without registering it as the last spawned
task for the purposes of `task::Rerun`. By default you can spawn a task
in this fashion with cmd+enter or by holding cmd and clicking on a task
entry in a list. Spawning oneshots has been rebound to `option-enter`
(under a `picker::ConfirmInput` name). Fixes #9804 (breaking change)
- Moved `menu::UseSelectedQuery` action to `picker` namespace (breaking
change).
2024-03-29 18:41:14 +01:00
Daniel Zhu
f5823f9942
Split DuplicateLine into DuplicateLineUp and DuplicateLineDown (#9715)
Fixes #9601

Release Notes:
- `DuplicateLine` is now split into `DuplicateLineUp` and
`DuplicateLineDown`
2024-03-28 12:52:08 +02:00
Andrew Lygin
894b39a918
Add tab switcher (#7987)
The Tab Switcher implementation (#7653):
- `ctrl-tab` opens the Tab Switcher and moves selection to the
previously selcted tab. It also cycles selection forward.
- `ctrl-shift-tab` opens the Tab Switcher and moves selection to the
last tab in the list. It also cycles selection backward.
- Tab is selected and the Tab Switcher is closed on the shortcut
modifier key (`ctrl` by default) release.
- List items are in reverse activation history order.
- The list reacts to the item changes in background (new tab, tab
closed, tab title changed etc.)

Intentionally not in scope of this PR:
- File icons
- Close buttons

I will come back to these features. I think they need to be implemented
in separate PRs, and be synchronized with changes in how tabs are
rendered, to reuse the code as it's done in the current implementation.
The Tab Switcher looks usable even without them.

Known Issues:

Tab Switcher doesn't react to mouse click on a list item. It's not a tab
switcher specific problem, it looks like ctrl-clicks are not handled the
same way in Zed as cmd-clicks. For instance, menu items can be activated
with cmd-click, but don't react to ctrl-click. Since the Tab Switcher's
default keybinding is `ctrl-tab`, the user can only click an item with
`ctrl` pushed down, thus preventing `on_click()` from firing.

fixes #7653, #7321

Release Notes:

- Added Tab Switcher which is accessible via `ctrl-tab` and
`ctrl-shift-tab` (#7653) (#7321)

Related issues:

- Unblocks #7356, I hope 😄

How it looks and works (it's only `ctrl-tab`'s and `ctrl-shift-tab`'s,
no `enter`'s or mouse clicks):


https://github.com/zed-industries/zed/assets/2101250/4ad4ec6a-5314-481b-8b35-7ac85e43eb92

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-27 11:15:08 -07:00
Mikayla Maki
8583c3bd94
Add go to implementation shortcut (#9837)
This adds a keybinding for an existing action. Notably, our bindings for
`Go To Type Definition` and `Go To Implementation` are swapped from
VSCode. We use `cmd` and `shift`, they use `shift` and `cmd`.

Release Notes:

- Added a keybinding for `editor::GoToImplementation`
2024-03-26 17:04:55 -07:00
Mikayla Maki
40f60ebe2d
Fix the linux keymap (#9829)
Earlier versions where a simple find-replace of `cmd` => `ctrl`. In this
PR, I've gone over every keybinding individually and checked them.

Release Notes:

- Removed the `ShowContextMenu` action, it's only usage was in the
collab panel and it's been rebound to `SecondaryConfirm`
2024-03-26 16:10:09 -07:00
Antonio Scandurra
fb6cff89d7
Introduce InlineCompletionProvider (#9777)
This pull request introduces a new `InlineCompletionProvider` trait,
which enables making `Editor` copilot-agnostic and lets us push all the
copilot functionality into the `copilot_ui` module. Long-term, I would
like to merge `copilot` and `copilot_ui`, but right now `project`
depends on `copilot`, which makes this impossible.

The reason for adding this new trait is so that we can experiment with
other inline completion providers and swap them at runtime using config
settings.

Please, note also that we renamed some of the existing copilot actions
to be more agnostic (see release notes below). We still kept the old
actions bound for backwards-compatibility, but we should probably remove
them at some later version.

Also, as a drive-by, we added new methods to the `Global` trait that let
you read or mutate a global directly, e.g.:

```rs
MyGlobal::update(cx, |global, cx| {
});
```

Release Notes:

- Renamed the `copilot::Suggest` action to
`editor::ShowInlineCompletion`
- Renamed the `copilot::NextSuggestion` action to
`editor::NextInlineCompletion`
- Renamed the `copilot::PreviousSuggestion` action to
`editor::PreviousInlineCompletion`
- Renamed the `editor::AcceptPartialCopilotSuggestion` action to
`editor::AcceptPartialInlineCompletion`

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-03-26 13:28:06 +01:00
Andrew Lygin
1b4c82dc2c
Fix next/prev shortcuts handling in the File Finder (#9785)
This PR fixes the unexpected File Finder behaviour described in
https://github.com/zed-industries/zed/pull/8782#issuecomment-2018551041

Any change of the modifier keys except for the release of the initial
modifier keys now prevents opening the selected file.

Release Notes:

- N/A
2024-03-25 14:06:37 -07:00
Ko
6776688987
Fix Prisma indentation size (#9753)
This PR fixes #9567 

Release Notes:

- Changed default indentation for Prisma files to 2 spaces
([#9567](https://github.com/zed-industries/zed/issues/9567)).
2024-03-25 08:39:49 -04:00
Marshall Bowers
c6d479715d
Add setting to allow disabling the Assistant (#9706)
This PR adds a new `assistant.enabled` setting that controls whether the
Zed Assistant is enabled.

Some users have requested the ability to disable the AI-related features
in Zed if they don't use them. Changing `assistant.enabled` to `false`
will hide the Assistant icon in the status bar (taking priority over the
`assistant.button` setting) as well as filter out the `assistant:`
actions.

The Assistant is enabled by default.

Release Notes:

- Added an `assistant.enabled` setting to control whether the Assistant
is enabled.
2024-03-22 11:55:29 -04:00
apricotbucket28
95b2f4caf2
linux: fix word move/select shortcuts (#9673)
`alt+left/right` are never used on Linux.
The Linux keymap still has some other issues, but these shortcuts in
particular are really common when editing text.

Release Notes:

- N/A
2024-03-21 15:28:39 -07:00
Andrew Lygin
5602c48136
Action release handlers (#8782)
This PR adds support for handling action releases &mdash; events that
are fired when the user releases all the modifier keys that were part of
an action-triggering shortcut.

If the user holds modifiers and invokes several actions sequentially via
shortcuts (same or different), only the last action is "released" when
its modifier keys released.

~The following methods were added to `Div`:~
- ~`capture_action_release()`~
- ~`on_action_release()`~
- ~`on_boxed_action_release()`~

~They work similarly to `capture_action()`, `on_action()` and
`on_boxed_action()`.~

See the implementation details in [this
comment](https://github.com/zed-industries/zed/pull/8782#issuecomment-2009154646).

Release Notes:

- Added a fast-switch mode to the file finder: hit `p` or `shift-p`
while holding down `cmd` to select a file immediately. (#8258).

Related Issues:

- Implements #8757 
- Implements #8258
- Part of #7653 

Co-authored-by: @ConradIrwin
2024-03-20 18:43:31 -06:00
Tim Masliuchenko
7855b9e9a8
Allow to handle autoclosed characters differently (#8666)
Adds the `always_treat_brackets_as_autoclosed` setting to control how
the autoclosed characters are handled.

The setting is off by default, meaning the behaviour stays the same
(following how VSCode handles autoclosed characters).
When set to `true`, the autoclosed characters are always skipped over
and auto-removed no matter how they were inserted (following how Sublime
Text/Xcode handle this).


https://github.com/zed-industries/zed/assets/471335/304cd04a-59fe-450f-9c65-cc31b781b0db


https://github.com/zed-industries/zed/assets/471335/0f5b09c2-260f-48d4-8528-23f122dee45f

Release Notes:

- Added the setting `always_treat_brackets_as_autoclosed` (default:
`false`) to always treat brackets as "auto-closed" brackets, i.e.
deleting the pair when deleting start/end, etc.
([#7146](https://github.com/zed-industries/zed/issues/7146)).

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-20 09:35:42 +01:00
Remco Smits
3dadfe4787
Channel chat: Add edit message (#9035)
**Summary**:
- Removed reply message from message_menu
- Made render_popover_buttons a bit more reusable
- Fixed issue that you can't close the reply/edit preview when you are
not focusing the message editor
- Notify only the new people that were mentioned inside the edited
message

**Follow up**
- Fix that we update the notification message for the people that we
mentioned already
- Fix that we remove the notification when a message gets deleted.
  - Fix last acknowledge message id is in correct now

**Todo**:
- [x] Add tests
- [x] Change new added bindings to the `Editor::Cancel` event.

Release Notes:

- Added editing of chat messages
([#6707](https://github.com/zed-industries/zed/issues/6707)).

<img width="239" alt="Screenshot 2024-03-09 at 11 55 23"
src="https://github.com/zed-industries/zed/assets/62463826/b0949f0d-0f8b-43e1-ac20-4c6d40ac41e1">
<img width="240" alt="Screenshot 2024-03-13 at 13 34 23"
src="https://github.com/zed-industries/zed/assets/62463826/d0636da2-c5aa-4fed-858e-4bebe5695ba7">

---------

Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-19 19:49:04 -06:00
Nathan Sobo
8ae5a3b61a
Allow AI interactions to be proxied through Zed's server so you don't need an API key (#7367)
Co-authored-by: Antonio <antonio@zed.dev>

Resurrected this from some assistant work I did in Spring of 2023.
- [x] Resurrect streaming responses
- [x] Use streaming responses to enable AI via Zed's servers by default
(but preserve API key option for now)
- [x] Simplify protobuf
- [x] Proxy to OpenAI on zed.dev
- [x] Proxy to Gemini on zed.dev
- [x] Improve UX for switching between openAI and google models
- We current disallow cycling when setting a custom model, but we need a
better solution to keep OpenAI models available while testing the google
ones
- [x] Show remaining tokens correctly for Google models
- [x] Remove semantic index
- [x] Delete `ai` crate
- [x] Cloud front so we can ban abuse
- [x] Rate-limiting
- [x] Fix panic when using inline assistant
- [x] Double check the upgraded `AssistantSettings` are
backwards-compatible
- [x] Add hosted LLM interaction behind a `language-models` feature
flag.

Release Notes:

- We are temporarily removing the semantic index in order to redesign it
from scratch.

---------

Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Max <max@zed.dev>
2024-03-19 19:22:26 +01:00
Mayfield
7c0a0e21ab
Add keyboard shortcut to suppress prompt while deleting files/dirs (#9452)
Completes #7228.
Adds back Backspace as the main delete key binding and makes Linux
bindings consistent with macOS

Release Notes:
- ⌘-Delete/⌘-Backspace will now suppress deletion confirmation prompts
in project panel
([#7228](https://github.com/zed-industries/zed/issues/7228)).
2024-03-18 11:43:43 -07:00
Derek Briggs
be4e19b834
Update to UI and Framework Icons (#9468)
This is an update to 82 Zed UI and file_icons to improve icon legibility
and align contributed file_icons to the general icon system styling.
From review it appears they're 2px larger in width and height but gpui
render scaling is at play. The original icons were designed at 14x14 to
be viewed at that size, but the ui_font_size now controls this so
they've been updated to the default of 16x16 for optimum fidelity.

![CleanShot 2024-03-17 at 16 20
13@2x](https://github.com/zed-industries/zed/assets/1648941/4151c631-78e6-43a8-914f-37b00f43e130)

Release Notes:

- Updated various UI and file icons for consistency.
2024-03-18 10:59:19 -04:00
Vitor Ramos
99d4f8c78c
Linux: remove duplicate key bind to "ctrl-shift-p" preventing the command palette from showing up (#9455)
Linux: remove duplicate key bind to "ctrl-shift-p" preventing the
command palette from showing up

Release Notes:
- N/A
2024-03-17 16:05:37 +02:00
Kirill Bulatov
dcdd1ece1c
Small improvements of the task terminal spawn behavior (#9399)
* Add a `reveal: always|never` field in task definitions from tasks.json
, allowing to customize task terminal behavior on spawn
* Ensure reveal: always reveals the terminal even if the old task is
already running


Release Notes:

- Added a `reveal: always|never` (`always` is a default) field in task
definitions from tasks.json , allowing to customize task terminal
behavior on spawn

---------

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
2024-03-15 18:32:59 +02:00
Evren Sen
de1db8b6be
Rework/redesign message replies (#9049)
Hello! This PR proposes a redesigned replying system in Zeds chat panel,
inspired by chat applications like [Slack](https://slack.com) and
[Discord](https://discord.com). Feedback and suggestions are welcome! 😄

### TODOs

- [x] Handle replies to removed messages
- [x] Add replied user's profile picture to reply indicator
- [x] Highlight the message that's been selected for replying

--------

### Current Status


https://github.com/zed-industries/zed/assets/146845123/4ed2c2d7-a586-48bd-973c-0d3f033e2c6b

--------

Release Notes:

- Redesigned message replies in the chat panel

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-03-14 20:45:53 -06:00
Max
71aaefc5b2
Add multi_cursor_modifier setting (#9014)
this PR allows users to use `cmd` instead of `alt` as the
`multi_cursor_modifier` for creating multiple cursors/selections

closes #4339

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-14 20:33:54 -06:00
Hans
e836a979a2
vim: Add Multi Replace mode in Vim (#8469)
For #4440, I've only added support for normal, if it's visual mode,
would we like this to delete the current selection row and enter insert
mode?

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-14 20:31:53 -06:00
Conrad Irwin
bffde43c12
Improve vim undo (#9317)
The important change here is to ensure that undo never lands you in
visual mode; but we also take care to restore the selection the same way
vim does (visual line goes to beginning of line, visual block to the top
left, etc.).

To help make this behaviour feel right we also group any deletions that
started insert mode with the first text inserted.

Fixes: #7521

Release Notes:

- vim: Improved undo. It will now restore you to normal mode in the same
position as vim, and group deletions caused by `c` or `s` with the
concomitant insert.
([#7521](https://github.com/zed-industries/zed/issues/7521)).
2024-03-13 23:12:12 -06:00
Max Brunsfeld
724c19a223
Add a setting for custom associations between languages and files (#9290)
Closes #5178

Release Notes:

- Added a `file_types` setting that can be used to associate languages
with file names and file extensions. For example, to interpret all `.c`
files as C++, and files called `MyLockFile` as TOML, add the following
to `settings.json`:

    ```json
    {
      "file_types": {
        "C++": ["c"],
        "TOML": ["MyLockFile"]
      }
    }
    ```

As with most zed settings, this can be configured on a per-directory
basis by including a local `.zed/settings.json` file in that directory.

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-03-13 10:23:30 -07:00
Marshall Bowers
89c67fb1ab
Fix typos in default settings.json (#9239)
This PR fixes some typos in the comments within the default
`settings.json` file.

Fixes #4257.

Release Notes:

- Fixed some incorrect comments in the default `settings.json` file
([#4257](https://github.com/zed-industries/zed/issues/4257)).
2024-03-12 15:30:52 -04:00
Kainoa Kanter
ece0fb532d
Rosé Pine: Change #f5c177 to #f6c177 (#9232)
As discussed in #themes-and-ui

Release Notes:

- N/A
2024-03-12 09:35:34 -07:00
Kirill Bulatov
3be1402a3d
Fix the double click and update the default settings (#9214) 2024-03-12 12:15:55 +02:00
Kirill Bulatov
02dcdd0228
Open excerpt on double click in multibuffer by default. (#9196)
Closes https://github.com/zed-industries/zed/issues/5275

Double click with `alt` modifier pressed will do the regular word
selection.

Adds a setting to disable this behavior and instead select a word, as in
the regular buffer.

```
// What to do when multibuffer is double clicked in some of its excerpts
// (parts of singleton buffers).
// May take 2 values:
//  1. Behave as a regular buffer and select the whole word.
//         "double_click_in_multibuffer": "select"
//  2. Open the excerpt clicked as a new buffer in the new tab (default).
//         "double_click_in_multibuffer": "open",
// For the case of "open", regular selection behavior can be achieved by holding `alt` when double clicking.
"double_click_in_multibuffer": "open",
```


Release Notes:

- Made multibuffer to open excerpts in new tabs on double click by
default (changing settings or keeping alt restores the word selection
behavior). ([5275](https://github.com/zed-industries/zed/issues/5275))
2024-03-11 22:06:06 +02:00
Kirill Bulatov
347178039c
Add editor::RevertSelectedHunks to revert git diff hunks in the editor (#9068)
https://github.com/zed-industries/zed/assets/2690773/653b5658-e3f3-4aee-9a9d-0f2153b4141b

Release Notes:

- Added `editor::RevertSelectedHunks` (`cmd-alt-z` by default) for
reverting git hunks from the editor
2024-03-09 01:37:24 +02:00
Evren Sen
1756c1fc1e
Improve UI of popover buttons when hovering over chat messages (#9041)
### Before


https://github.com/zed-industries/zed/assets/146845123/4a16c1ce-a671-4e39-abc9-3a0cb25bc0cd

### After


https://github.com/zed-industries/zed/assets/146845123/cfab3d00-246e-427d-9c40-8ee520a0a186




Release Notes:
- Improved the UI of popover buttons when hovering over chat messages.
2024-03-08 12:46:51 -07:00
Piotr Osiewicz
fa5dfe19f8 Fix default tasks.json definition 2024-03-08 15:28:42 +01:00
Rom Grk
f67abd2943
vim: smartcase find option (#9033)
Release Notes:

- Added option `use_smartcase_find` to the vim-mode
2024-03-07 19:44:20 -07:00
Rom Grk
d247086b21
vim: subword motions (#8725)
Add subword motions to vim, inspired by
[nvim-spider](https://github.com/chrisgrieser/nvim-spider),
[CamelCaseMotion](https://github.com/bkad/CamelCaseMotion).


Release Notes:

- Added subword motions to vim
2024-03-07 19:36:12 -07:00