Delete CEConsoleTextView class

This commit is contained in:
1024jp 2016-04-25 21:12:49 +09:00
parent d87e506669
commit 24baaac66c
4 changed files with 39 additions and 38 deletions

View File

@ -12,6 +12,7 @@ Change Log
- Improve outline definitions to support the class syntax sugar introduced in ECMAScript 6.
- Better coloring for “get” and “set”.
### Fixes
- Fix an issue where application could crash on opening empty file.

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10116"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="CEConsolePanelController">
@ -29,7 +29,7 @@
<rect key="frame" x="0.0" y="0.0" width="360" height="199"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView editable="NO" importsGraphics="NO" richText="NO" findStyle="bar" incrementalSearchingEnabled="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="8" customClass="CEConsoleTextView">
<textView editable="NO" importsGraphics="NO" richText="NO" findStyle="bar" incrementalSearchingEnabled="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="8">
<rect key="frame" x="0.0" y="0.0" width="360" height="199"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>

View File

@ -9,7 +9,7 @@
------------------------------------------------------------------------------
© 2014-2015 1024jp
© 2014-2016 1024jp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -33,10 +33,3 @@
- (void)appendMessage:(nonnull NSString *)message title:(nullable NSString *)title;
@end
@interface CEConsoleTextView : NSTextView
@end

View File

@ -9,7 +9,7 @@
------------------------------------------------------------------------------
© 2014-2015 1024jp
© 2014-2016 1024jp
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -133,37 +133,44 @@ const CGFloat kFontSize = 11;
#pragma mark -
/// Map find actions to NSTextFinder, since find action key bindings are configured for CETextFinder.
@implementation CEConsolePanelController (TextFinderSupport)
@implementation CEConsoleTextView
#pragma mark Action Messages
// ------------------------------------------------------
/// catch shortcut input
- (BOOL)performKeyEquivalent:(nonnull NSEvent *)theEvent
/// bridge find action to NSTextFinder
- (IBAction)showFindPanel:(nullable id)sender
// ------------------------------------------------------
{
// Since the Find menu is overridden by OgreKit framework, we need catch shortcut input manually for find actions.
NSTextFinder *textFinder = [(CEConsolePanelController *)[[self window] windowController] textFinder];
if ([[theEvent characters] isEqualToString:@"f"]) {
[textFinder performAction:NSTextFinderActionShowFindInterface];
return YES;
} else if ([[theEvent characters] isEqualToString:@"g"] && [theEvent modifierFlags] & NSShiftKeyMask) {
[textFinder performAction:NSTextFinderActionPreviousMatch];
return YES;
} else if ([[theEvent characters] isEqualToString:@"g"]) {
[textFinder performAction:NSTextFinderActionNextMatch];
return YES;
} else if ([[theEvent characters] isEqualToString:@"e"]) {
[textFinder performAction:NSTextFinderActionSetSearchString];
return YES;
}
return NO;
[[self textFinder] performAction:NSTextFinderActionShowFindInterface];
}
// ------------------------------------------------------
/// bridge find action to NSTextFinder
- (IBAction)findNext:(nullable id)sender
// ------------------------------------------------------
{
[[self textFinder] performAction:NSTextFinderActionNextMatch];
}
// ------------------------------------------------------
/// bridge find action to NSTextFinder
- (IBAction)findPrevious:(nullable id)sender
// ------------------------------------------------------
{
[[self textFinder] performAction:NSTextFinderActionPreviousMatch];
}
// ------------------------------------------------------
/// bridge find action to NSTextFinder
- (IBAction)useSelectionForFind:(nullable id)sender
// ------------------------------------------------------
{
[[self textFinder] performAction:NSTextFinderActionSetSearchString];
}
@end