Commit Graph
25009 Commits
Author SHA1 Message Date
Kirill Bulatov c173345c86 Simplify inlay map data 2023-07-05 15:23:56 +03:00
Piotr Osiewicz 39a30ba7b3 fixup! Remove stacks from branch list header 2023-07-05 14:08:21 +02:00
Piotr OsiewiczandAntonio 6c6c87f026 Remove stacks from branch list header
Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 14:04:16 +02:00
Antonio Scandurra 7cc2ccdb39 Support assistant: quote selection on multibuffers (#2682)
Fixes
https://linear.app/zed-industries/issue/Z-2430/assistant-quote-selection-does-not-work-in-multi-buffer

Release Notes:

- Added support for invoking `assistant: quote selection` (`cmd->`) when
editing a multi-buffer.
2023-07-05 11:49:03 +02:00
Antonio Scandurra 0db9e702b8 Support assistant: quote selection on multibuffers 2023-07-05 11:41:24 +02:00
Antonio Scandurra 67575edb6f Restore focus to previously focused view when dismissing a modal (#2680)
Fixes
https://linear.app/zed-industries/issue/Z-2500/focus-is-moved-from-the-assistant-panel-when-opening-and-closing

Release Notes:

- Fixed a bug that caused modals (such as the command palette) to not
restore focus when dismissing them.
2023-07-05 11:37:45 +02:00
Antonio Scandurra 4b58f2b8dd Restore focus to previously focused view when dismissing a modal 2023-07-05 09:40:26 +02:00
Antonio Scandurra 194bf772be Add Modal::has_focus and introduce a ModalHandle trait object 2023-07-05 09:39:56 +02:00
Antonio Scandurra 1d1a52dea4 Introduce a WindowContext::focus method that implies the window id 2023-07-05 09:39:04 +02:00
Nate Butler 00e0cfc80a Update collaboration sounds, add sounds to screensharing 2023-07-04 16:18:42 -04:00
Kirill Bulatov 5fb68ae667 Accept null as a valid action, to disable a keystroke (#2678)
Deals with https://github.com/zed-industries/community/issues/772
Closes
https://linear.app/zed-industries/issue/Z-1518/allow-keybindings-to-be-removed

Now, configuration like 
```json5
[
    {
        "context": "Editor",
        "bindings": {
            "alt-v": null,
        }
    }
]
```

will make `alt+v` to print `√` instead of moving the caret one page up.

Release Notes:

- Added a way to disable keybindings with `null` value
2023-07-04 21:51:46 +03:00
KCaverly 58bbbefc75 updated vector_store to reindex on save after timed delay 2023-07-04 14:42:12 -04:00
Kirill BulatovandMikayla Maki 7b2aaa20d8 Accept null as a valid action, to disable a keystroke
co-authored-by: Mikayla Maki <mikayla@zed.dev>
2023-07-04 21:11:28 +03:00
Nate Butler 6104cee838 Rename color_scheme -> theme (#2677)
Just some theme tidying, renames some things to be more consistent with
our planned naming conventions going forward.

Release Notes:

- N/A (No public facing changes)
2023-07-04 11:56:30 -04:00
KCaverly 0355d0230d WIP: initial reindexing logic worked out 2023-07-04 11:46:09 -04:00
Piotr Osiewicz c4de04454f Remove PickerEvent::Dismiss emission from picker header 2023-07-04 16:30:17 +02:00
Piotr Osiewicz 833ed41fa8 Fix click behaviour of vcs/project dropdowns 2023-07-04 16:00:59 +02:00
Conrad Irwin 373c6bd9be vim: Further improve ~ handling
Now works with Visual{line} mode, collapses selections like nvim,
and doesn't fall off the end of the line.
2023-07-03 23:58:09 -06:00
Nate Butler 812b51e5d9 Remove unused ts aliases 2023-07-04 01:37:45 -04:00
Nate Butler 1ca9f64e30 color_scheme -> theme 2023-07-04 01:20:56 -04:00
Nate Butler 388b50161b Remove unused color_scheme field in the theme (#2676)
We removed the `theme_testbench` crate a while back - It seems like that
was the only thing using the `color_scheme` field in the exported theme.

Removing this from the theme removes something like 42k lines of
generated JSON every time we build the theme (2k lines / 28% of the
total lines per generated theme!)

Release Notes:

- N/A (No public facing changes)
2023-07-04 00:58:37 -04:00
Nate Butler 5d7f524850 Remove unused color_scheme field in the theme
I totally didn't mean to commit this right to main T_T
2023-07-04 00:44:12 -04:00
Nate Butler 3cba06098b Revert "Remove unused color_scheme field in the theme"
This reverts commit c10e08d014.
2023-07-04 00:41:13 -04:00
Nate Butler c10e08d014 Remove unused color_scheme field in the theme 2023-07-04 00:40:01 -04:00
Nate Butler fdd9af728b Use theme store to pass color_scheme directly to components (#2675)
This PR adds a theme store to allow components to directly access the
theme without requiring it to be passed down as props every time it is
used.

So before, you might need to do something like `text(theme, "variant",
"hovered")`, you could now just call `text("variant", "hovered")`.

This also means that style_trees don't need to be called with a theme
either:

```ts
export default function app(): any {
    const theme = useTheme()

    return {
        meta: {
            name: theme.name,
            is_light: theme.is_light,
        },
        command_palette: command_palette(),
        contact_notification: contact_notification(),
        // etc...
    }
}
```

We do this by creating a zustand store to store the theme, and allow it
to be accessed with `useThemeStore.getState().theme`.

```ts
import { create } from "zustand"
import { ColorScheme } from "./color_scheme"

type ThemeState = {
    theme: ColorScheme | undefined
    setTheme: (theme: ColorScheme) => void
}

export const useThemeStore = create<ThemeState>((set) => ({
    theme: undefined,
    setTheme: (theme) => set(() => ({ theme })),
}))

export const useTheme = (): ColorScheme => {
    const { theme } = useThemeStore.getState()

    if (!theme) throw new Error("Tried to use theme before it was loaded")

    return theme
}
```

Release Notes:

- N/A (No public facing changes)
2023-07-04 00:37:45 -04:00
Nate Butler 8d6f9c24df Update a few more components 2023-07-04 00:32:27 -04:00
Nate Butler dde77750c6 Use theme store to pass color_scheme directly to components 2023-07-04 00:13:04 -04:00
Conrad Irwin 97d1701e1c Remove editor::Cancel binding from vim
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
2023-07-03 15:26:39 -06:00
Mikayla Maki 40a79d8eb6 Add sound effects to calls (#2673)
This PR adds joined, leaving, mute, and unmute sound effects to Zed. 

Release Notes:

- Added joined, leaving, mute, and unmute sound effects (preview-only)
2023-07-03 13:55:48 -07:00
Mikayla Maki dbe2e418eb Guard against uninstantiated globals in tests 2023-07-03 13:48:17 -07:00
Mikayla Maki beb97e49c7 Add joined sound effect when new participants join the room 2023-07-03 13:36:03 -07:00
Mikayla Maki 0710451b93 Add first-pass sound support to Zed 2023-07-03 13:30:04 -07:00
Conrad Irwin 2025d37bb2 vim: Allow ^ as a motion
Fixes: zed-industries/community#856
2023-07-03 12:55:41 -06:00
Conrad Irwin 0feef10a21 vim: ctrl-c to exit visual mode
Fixes: zed-industries/community#1447
Contributes: zed-industries/community#1089
2023-07-03 12:52:33 -06:00
Piotr Osiewicz c8f902715c branch list: dismiss correct window on PickerEvent.
Query proper window
2023-07-03 19:22:43 +02:00
Kirill Bulatov 465eac88f7 Do not perform OnTypeFormating after pair brace insert (#2672)
Closes
https://linear.app/zed-industries/issue/Z-2358/ra-brace-auto-surround-causes-duplicate-end-char-with-selection

Release Notes:

- Fixed a bug when duplicate brace appeared after selected text got
surrounded with braces
2023-07-03 17:26:55 +03:00
Piotr Osiewicz a66ff10080 Merge branch 'main' into git-menu 2023-07-03 16:25:36 +02:00
Kirill BulatovandJulia Risley 8f34330c6d Do not perform OnTypeFormating after pair brace insert
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-03 17:21:44 +03:00
Piotr Osiewicz 665e95c55f Remove flex from underneath the pickers 2023-07-03 16:16:14 +02:00
Kirill Bulatov ad05e47e7b Do not add extra spaces to hints (#2671)
Closes
https://linear.app/zed-industries/issue/Z-2526/inlay-hints-in-typescript-types-have-extra-space-before#comment-ac88a101

Release Notes:

- N/A
2023-07-03 11:18:07 +03:00
Kirill Bulatov a66f2a8be9 Do not add extra spaces to hints 2023-07-03 11:17:12 +03:00
Conrad Irwin f11eaf983c Fix % when on the last character of the line
Contributes: zed-industries/community#682
2023-07-01 13:51:11 -06:00
Piotr Osiewicz 9580f67e6e Dismiss dropdowns on click out 2023-07-01 01:49:00 +02:00
Piotr Osiewicz dfe2ec31bf Render match count next to branch label 2023-07-01 01:38:36 +02:00
Mikayla Maki 99894d922c Add basic sound handling infrastructure 2023-06-30 16:10:49 -07:00
KCaverlyandmaxbrunsfeld 5c0ef44a23 moved semantic search model to dev and preview only.
moved db update tasks to long lived persistent task.

Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 18:41:19 -04:00
KCaverlyandmaxbrunsfeld 6c5bad6a13 updated file compare in the semantic indexing engine, to work off of modified system times as opposed to file hashes
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 16:53:23 -04:00
KCaverlyandmaxbrunsfeld 551809b8f1 updated vector store indexing to only use languages with an embedding.scm treesitter query
Co-authored-by: maxbrunsfeld <max@zed.dev>
2023-06-30 16:14:11 -04:00
Kirill Bulatov 45d9dd5f73 Remove excessive hint update queries (#2667)
Closes
https://linear.app/zed-industries/issue/Z-2513/panic-in-refresh-inlay-hints

* Filter out queries for outdated buffers just before hint tasks spawn:
  multicaret edits might emit standalone events simultaneously
* Only spawn inlay update tasks for visible buffers with corresponding
  language
* Do not spawn tasks for local projects' buffers without LSP servers

Release Notes:

- N/A
2023-06-30 22:15:36 +03:00
Kirill Bulatov 1a5f3c1991 Remove excessive hint update queries
* Filter out queries for outdated buffers just before hint tasks spawn:
  multicared edits might empit standalone events simultaneously
* Only spawn inlay update tasks for visible buffers with corresponding
  language
* Do not spawn tasks for local projects' buffers without LSP servers
2023-06-30 22:03:21 +03:00