Skip to content

Commit 900723f

Browse files
committed
Add frontend handling for move line
1 parent 3512b71 commit 900723f

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

XiEditor/EditViewController.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,14 @@ class EditViewController: NSViewController, EditViewDataSource, FindDelegate, Sc
440440
document.sendRpcAsync("outdent", params: [])
441441
}
442442

443+
@objc func moveLineUp(_ sender: AnyObject?) {
444+
document.sendRpcAsync("move_line_up", params: [])
445+
}
446+
447+
@objc func moveLineDown(_ sender: AnyObject?) {
448+
document.sendRpcAsync("move_line_down", params: [])
449+
}
450+
443451
fileprivate func cutCopy(_ method: String) {
444452
if let result = document?.sendRpc(method, params: []) {
445453
switch result {

XiEditor/Main.storyboard

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
66
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
77
<capability name="stacking Non-gravity area distributions on NSStackView" minToolsVersion="7.0" minSystemVersion="10.11"/>
88
</dependencies>
@@ -214,7 +214,7 @@ Gw
214214
<rect key="frame" x="408" y="0.0" width="176" height="22"/>
215215
<subviews>
216216
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="usm-aH-bgF">
217-
<rect key="frame" x="-1" y="1" width="57" height="20"/>
217+
<rect key="frame" x="-1" y="1" width="56" height="20"/>
218218
<segmentedCell key="cell" borderStyle="border" alignment="left" style="roundRect" trackingMode="momentary" id="53c-PL-hc5">
219219
<font key="font" metaFont="cellTitle"/>
220220
<segments>
@@ -227,7 +227,7 @@ Gw
227227
</connections>
228228
</segmentedControl>
229229
<button verticalHuggingPriority="750" tag="9" translatesAutoresizingMaskIntoConstraints="NO" id="OLd-3g-GU4" userLabel="Find All Button">
230-
<rect key="frame" x="61" y="1" width="56" height="19"/>
230+
<rect key="frame" x="60" y="1" width="56" height="19"/>
231231
<buttonCell key="cell" type="roundRect" title="Find All" bezelStyle="roundedRect" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="wFY-L9-Tvu">
232232
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
233233
<font key="font" metaFont="cellTitle"/>
@@ -237,7 +237,7 @@ Gw
237237
</connections>
238238
</button>
239239
<button verticalHuggingPriority="750" tag="11" translatesAutoresizingMaskIntoConstraints="NO" id="5rw-0w-Suw">
240-
<rect key="frame" x="123" y="1" width="53" height="19"/>
240+
<rect key="frame" x="122" y="1" width="54" height="19"/>
241241
<buttonCell key="cell" type="roundRect" title="Done" bezelStyle="roundedRect" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="FOD-1e-hKW">
242242
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
243243
<font key="font" metaFont="cellTitle"/>
@@ -533,6 +533,19 @@ Gw
533533
</connections>
534534
</menuItem>
535535
<menuItem isSeparatorItem="YES" id="HU9-QD-3rl"/>
536+
<menuItem title="Move Line Up" keyEquivalent="" id="RLx-eh-Dve" userLabel="Move Line Up">
537+
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
538+
<connections>
539+
<action selector="moveLineUp:" target="7er-QZ-amI" id="DfR-xs-esy"/>
540+
</connections>
541+
</menuItem>
542+
<menuItem title="Move Line Down" keyEquivalent="" id="AuB-DE-f4W">
543+
<modifierMask key="keyEquivalentModifierMask" option="YES"/>
544+
<connections>
545+
<action selector="moveLineDown:" target="7er-QZ-amI" id="l3R-s9-H0m"/>
546+
</connections>
547+
</menuItem>
548+
<menuItem isSeparatorItem="YES" id="tV1-Yv-95y"/>
536549
<menuItem title="Cut" keyEquivalent="x" id="Alj-56-nPN">
537550
<connections>
538551
<action selector="cut:" target="7er-QZ-amI" id="aKl-vW-7DZ"/>

0 commit comments

Comments
 (0)