repl: Fix repl-over-selection not being Vim-line-wise aware (#15068)
Release Notes: - N/A
This commit is contained in:
parent
7644605f0f
commit
ba6c36f370
1 changed files with 4 additions and 2 deletions
|
@ -138,12 +138,14 @@ fn snippet(
|
||||||
editor: WeakView<Editor>,
|
editor: WeakView<Editor>,
|
||||||
cx: &mut WindowContext,
|
cx: &mut WindowContext,
|
||||||
) -> Option<(String, Arc<Language>, Range<Anchor>)> {
|
) -> Option<(String, Arc<Language>, Range<Anchor>)> {
|
||||||
|
let selection = editor
|
||||||
|
.update(cx, |editor, cx| editor.selections.newest_adjusted(cx))
|
||||||
|
.ok()?;
|
||||||
|
|
||||||
let editor = editor.upgrade()?;
|
let editor = editor.upgrade()?;
|
||||||
let editor = editor.read(cx);
|
let editor = editor.read(cx);
|
||||||
|
|
||||||
let buffer = editor.buffer().read(cx).snapshot(cx);
|
let buffer = editor.buffer().read(cx).snapshot(cx);
|
||||||
|
|
||||||
let selection = editor.selections.newest::<Point>(cx);
|
|
||||||
let multi_buffer_snapshot = editor.buffer().read(cx).snapshot(cx);
|
let multi_buffer_snapshot = editor.buffer().read(cx).snapshot(cx);
|
||||||
|
|
||||||
let range = if selection.is_empty() {
|
let range = if selection.is_empty() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue