Skip to content

Commit

Permalink
Add frontend handling for move line
Browse files Browse the repository at this point in the history
  • Loading branch information
nangtrongvuon committed Nov 19, 2018
1 parent b0e23d9 commit cedf8c6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
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

0 comments on commit cedf8c6

Please sign in to comment.