c409059
Revert "Remove unused `color_scheme` field in the theme"
Click to expand commit body
This reverts commit 5a1476a1e58c43e64d051e5af9786d8edaa85088.
Nate Butler
created
5a1476a
Remove unused `color_scheme` field in the theme
Nate Butler
created
0b4c5db
Use theme store to pass `color_scheme` directly to components (#2675)
Click to expand commit body
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)
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
14eab4e
branch list: dismiss correct window on PickerEvent.
Click to expand commit body
Query proper window
Piotr Osiewicz
created
6c01aea
Do not perform OnTypeFormating after pair brace insert (#2672)
Click to expand commit body
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
18a5a47
moved semantic search model to dev and preview only.
Click to expand commit body
moved db update tasks to long lived persistent task.
Co-authored-by: maxbrunsfeld <max@zed.dev>
KCaverly
and
maxbrunsfeld
created
3408b98
updated file compare in the semantic indexing engine, to work off of modified system times as opposed to file hashes
Click to expand commit body
Co-authored-by: maxbrunsfeld <max@zed.dev>
KCaverly
and
maxbrunsfeld
created
36907bb
updated vector store indexing to only use languages with an embedding.scm treesitter query
Click to expand commit body
Co-authored-by: maxbrunsfeld <max@zed.dev>
KCaverly
and
maxbrunsfeld
created
e017d62
Remove excessive hint update queries (#2667)
Click to expand commit body
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
* 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
Kirill Bulatov
created
f83514c
Fix regression in handling git FS events (#2670)
Click to expand commit body
As part of an optimization in
https://github.com/zed-industries/zed/pull/2663, I changed the way that
the worktree ignores FS events within unloaded directories. But this
accidentally prevented us from detecting some events that occur inside
of `.git` directories.
In this PR, I've made further tweaks to which FS events we can ignore.
We now explicitly opt *in* to scanning `.git` (shallowly) directories
(even though they are ignored). Note that we still don't recursively
scan the git directory (including all of the files inside `objects`
etc). This seems like the correct amount of work to do, and from my
testing (and our unit tests that use the real FS and real git
repositories), it seems to work correctly.
Release Notes:
- Fixed a bug where Zed would not detect some git repository changes
(preview only).
6042cf9
Fix bug preventing the assist command from working in certain keymaps (#2669)
Click to expand commit body
Fixes: https://github.com/zed-industries/community/issues/1712
The keymaps were adding in a `"cmd-enter": "editor::NewlineBelow",`
entry in the context of `Editor`, and this was clobbering the assist
command in the assistant panel context. Zed now defines this command in
the default keymap under the context of `"context": "Editor && mode ==
full"`. All I needed to basically do was remove that command from the
keymaps. I also removed the `"cmd-shift-enter": "editor::NewlineAbove"
from the `Editor` context in those keymaps as wel, as it is also defined
in the default keymap.
Release Notes:
- Fix bug preventing the `assistant: assist` command from working in
certain keymaps
Joseph T. Lyons
created
4a654f5
Fix bug preventing the assist command from working in certain keymaps
Joseph T. Lyons
created
0db0876
implemented file deletes on project indexing
KCaverly
created
a9c1395
WIP: Add the ability to make new directories by adding slashes to a file name (#2638)
Click to expand commit body
This PR adds a new way to make files / directories in the project panel,
by writing a path instead of a file.
TODO:
- [x] Solve a race condition that sometimes causes the newly created
file to not be selected / expanded correctly.
- [x] Change file refreshes to be minimal
Release Notes:
- Adds the ability to create new folders in the create-file action
([743](https://github.com/zed-industries/community/issues/743))