Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend handling for move line #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Sources/XiEditor/EditViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,14 @@ class EditViewController: NSViewController, EditViewDataSource, FindDelegate, Sc
document.sendRpcAsync("clear_recording", params: ["recording_name": "DEFAULT"])
}

@objc func moveLineUp(_ sender: AnyObject?) {
document.sendRpcAsync("move_line_up", params: [])
}

@objc func moveLineDown(_ sender: AnyObject?) {
document.sendRpcAsync("move_line_down", params: [])
}

fileprivate func cutCopy(_ method: String) {
if let result = document?.sendRpc(method, params: []) {
switch result {
Expand Down
13 changes: 13 additions & 0 deletions Sources/XiEditor/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,19 @@ Gw
<action selector="unindent:" target="7er-QZ-amI" id="83I-gO-x7f"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="uSe-8D-WGb"/>
<menuItem title="Move Line Up" keyEquivalent="" id="qQT-vY-sws" userLabel="Indent">
<modifierMask key="keyEquivalentModifierMask" shift="YES" option="YES"/>
<connections>
<action selector="moveLineUp:" target="7er-QZ-amI" id="Hjo-Mq-IUk"/>
</connections>
</menuItem>
<menuItem title="Move Line Down" keyEquivalent="" id="ebt-v7-xTi" userLabel="Indent">
<modifierMask key="keyEquivalentModifierMask" shift="YES" option="YES"/>
<connections>
<action selector="moveLineDown:" target="7er-QZ-amI" id="byE-V5-pSw"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
Expand Down