Record start columns when writing to the clipboard from Zed
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use editor::{ClipboardSelection, Editor};
|
||||
use gpui::{ClipboardItem, MutableAppContext};
|
||||
use std::cmp;
|
||||
|
||||
pub fn copy_selections_content(editor: &mut Editor, linewise: bool, cx: &mut MutableAppContext) {
|
||||
let selections = editor.selections.all_adjusted(cx);
|
||||
@@ -17,6 +18,10 @@ pub fn copy_selections_content(editor: &mut Editor, linewise: bool, cx: &mut Mut
|
||||
clipboard_selections.push(ClipboardSelection {
|
||||
len: text.len() - initial_len,
|
||||
is_entire_line: linewise,
|
||||
first_line_indent: cmp::min(
|
||||
start.column,
|
||||
buffer.indent_size_for_line(start.row).len,
|
||||
),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user