Skip to content

Commit 47f0b9a

Browse files
committed
1 parent f6da182 commit 47f0b9a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

FSNotes.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4733,7 +4733,7 @@
47334733
CODE_SIGN_IDENTITY = "Developer ID Application";
47344734
CODE_SIGN_STYLE = Manual;
47354735
COMBINE_HIDPI_IMAGES = YES;
4736-
CURRENT_PROJECT_VERSION = 481;
4736+
CURRENT_PROJECT_VERSION = 482;
47374737
DEVELOPMENT_TEAM = 866P6MTE92;
47384738
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
47394739
ENABLE_NS_ASSERTIONS = NO;
@@ -4767,7 +4767,7 @@
47674767
CODE_SIGN_IDENTITY = "Apple Development";
47684768
CODE_SIGN_STYLE = Automatic;
47694769
COMBINE_HIDPI_IMAGES = YES;
4770-
CURRENT_PROJECT_VERSION = 481;
4770+
CURRENT_PROJECT_VERSION = 482;
47714771
DEPLOYMENT_LOCATION = NO;
47724772
DEVELOPMENT_TEAM = 866P6MTE92;
47734773
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;

FSNotes/View/EditTextView.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,24 @@ class EditTextView: NSTextView, NSTextFinderClient {
603603
super.paste(sender)
604604
}
605605

606+
override func cut(_ sender: Any?) {
607+
guard nil != EditTextView.note else {
608+
super.cut(sender)
609+
return
610+
}
611+
612+
if self.selectedRange.length == 0, let paragraphRange = self.getParagraphRange(), let paragraph = attributedSubstring(forProposedRange: paragraphRange, actualRange: nil) {
613+
let pasteboard = NSPasteboard.general
614+
pasteboard.declareTypes([NSPasteboard.PasteboardType.string], owner: nil)
615+
pasteboard.setString(paragraph.string.trim().removeLastNewLine(), forType: NSPasteboard.PasteboardType.string)
616+
617+
insertText(String(), replacementRange: paragraphRange)
618+
return
619+
}
620+
621+
super.cut(sender)
622+
}
623+
606624
public func saveImages() {
607625
guard let storage = textStorage else { return }
608626

0 commit comments

Comments
 (0)