forked from CodeEditApp/CodeEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditorCommands.swift
More file actions
33 lines (28 loc) · 884 Bytes
/
EditorCommands.swift
File metadata and controls
33 lines (28 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// EditorCommands.swift
// CodeEdit
//
// Created by Bogdan Belogurov on 21/05/2025.
//
import SwiftUI
import CodeEditKit
struct EditorCommands: Commands {
@UpdatingWindowController var windowController: CodeEditWindowController?
private var editor: Editor? {
windowController?.workspace?.editorManager?.activeEditor
}
var body: some Commands {
CommandMenu("Editor") {
Menu("Structure") {
Button("Move line up") {
editor?.selectedTab?.rangeTranslator?.moveLinesUp()
}
.keyboardShortcut("[", modifiers: [.command, .option])
Button("Move line down") {
editor?.selectedTab?.rangeTranslator?.moveLinesDown()
}
.keyboardShortcut("]", modifiers: [.command, .option])
}
}
}
}