Skip to content

Commit

Permalink
Fix #214 Services not working in SubEthaEdit
Browse files Browse the repository at this point in the history
Turns out the services system calls write to pasteboard with an unsopported deprecated pasteboard type. *sigh*
  • Loading branch information
monkeydom committed Nov 13, 2021
1 parent b8a17a3 commit 0a6fd7a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Autosaves and restores unsaved untitled windows now on quit to be less intrusive

#### Bug fixes and maintenance:
* Fixed an issue where the services menu did not get the contents of the selection
* Fixed issues with scripting and document ids
* Fixed issue on macOS 12 where the com.apple.quarantine attribute was set on saving executable scripts, making them not exectuable anymore

Expand Down
4 changes: 3 additions & 1 deletion SubEthaEdit-Mac/Source/SEETextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,9 @@ - (NSArray *)writablePasteboardTypes {
}

- (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard type:(NSString *)type {
if ([type isEqualToString:NSPasteboardTypeString]) {
if ([type isEqualToString:NSPasteboardTypeString] ||
[[super writablePasteboardTypes] containsObject:type]) // this second line looks odd, but as it turns out freaking services calls this with the deprecated type and the superclass also uses the deprecated NSStringPboardType
{
NSRange selectedRange = [self selectedRange];
if (selectedRange.length == 0) return NO;

Expand Down

0 comments on commit 0a6fd7a

Please sign in to comment.