WIP
This commit is contained in:
parent
ba79a8ba94
commit
35f9996a4f
2 changed files with 17 additions and 2 deletions
|
@ -164,7 +164,7 @@
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"enter": "editor::Newline",
|
"enter": "editor::Newline",
|
||||||
"cmd-shift-enter": "editor::NewlineAbove",
|
"cmd-shift-enter": "editor::NewlineAbove",
|
||||||
"cmd-enter": "ai::Assist",
|
"cmd-enter": "editor::NewlineBelow",
|
||||||
"alt-z": "editor::ToggleSoftWrap",
|
"alt-z": "editor::ToggleSoftWrap",
|
||||||
"cmd-f": [
|
"cmd-f": [
|
||||||
"buffer_search::Deploy",
|
"buffer_search::Deploy",
|
||||||
|
@ -183,6 +183,12 @@
|
||||||
"alt-[": "copilot::PreviousSuggestion"
|
"alt-[": "copilot::PreviousSuggestion"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"context": "Editor && extension == zmd",
|
||||||
|
"bindings": {
|
||||||
|
"cmd-enter": "ai::Assist"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"context": "Editor && mode == auto_height",
|
"context": "Editor && mode == auto_height",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
|
|
|
@ -7231,7 +7231,7 @@ impl View for Editor {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
fn update_keymap_context(&self, keymap: &mut KeymapContext, _: &AppContext) {
|
fn update_keymap_context(&self, keymap: &mut KeymapContext, cx: &AppContext) {
|
||||||
Self::reset_to_default_keymap_context(keymap);
|
Self::reset_to_default_keymap_context(keymap);
|
||||||
let mode = match self.mode {
|
let mode = match self.mode {
|
||||||
EditorMode::SingleLine => "single_line",
|
EditorMode::SingleLine => "single_line",
|
||||||
|
@ -7250,6 +7250,15 @@ impl View for Editor {
|
||||||
for layer in self.keymap_context_layers.values() {
|
for layer in self.keymap_context_layers.values() {
|
||||||
keymap.extend(layer);
|
keymap.extend(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(extension) = self
|
||||||
|
.buffer
|
||||||
|
.read(cx)
|
||||||
|
.as_singleton()
|
||||||
|
.and_then(|buffer| buffer.read(cx).file()?.path().extension()?.to_str())
|
||||||
|
{
|
||||||
|
keymap.add_key("extension", extension.to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn text_for_range(&self, range_utf16: Range<usize>, cx: &AppContext) -> Option<String> {
|
fn text_for_range(&self, range_utf16: Range<usize>, cx: &AppContext) -> Option<String> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue