before the great git rework
This commit is contained in:
@@ -8,8 +8,6 @@ extension WorkspaceModel {
|
||||
|
||||
func overlayChanged(from old: Overlay, to new: Overlay) {
|
||||
switch old {
|
||||
case .note:
|
||||
if let note { track { await note.save() } }
|
||||
case .diff:
|
||||
editor?.closeDiff()
|
||||
default:
|
||||
@@ -103,7 +101,7 @@ extension WorkspaceModel {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Editor and the note
|
||||
// MARK: Editor
|
||||
|
||||
func passSelection(_ info: TextSelectionInfo?) {
|
||||
guard let editor, let path = editor.activePath else { return }
|
||||
@@ -115,14 +113,6 @@ extension WorkspaceModel {
|
||||
}
|
||||
}
|
||||
|
||||
/// ⌘P with the note open: the whole note goes to the agent, and the note closes so the text is seen landing.
|
||||
func passNote() {
|
||||
guard let note, let text = note.passableText else { return }
|
||||
terminal.insertIntoAgent(text: text)
|
||||
overlay.dismiss()
|
||||
toasts.show("Note passed to agent", detail: NoteStore.fileName)
|
||||
}
|
||||
|
||||
func editorSelectionFirstLine() -> String {
|
||||
guard let editor, let path = editor.activePath, let selection = editor.selection, selection.path == path else { return "" }
|
||||
let lines = editor.text(for: path).split(separator: "\n", omittingEmptySubsequences: false)
|
||||
|
||||
Reference in New Issue
Block a user