Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
aa55a82
Mark strings and rename plugin
holtwick Dec 8, 2012
a6cd258
Pattern for strings seems to work
holtwick Dec 8, 2012
9da1e3c
Popover pops
holtwick Dec 9, 2012
183dad3
Refactoring
holtwick Dec 9, 2012
854e0cf
Huge refactoring
holtwick Dec 9, 2012
621d656
Unescape works
holtwick Dec 9, 2012
43fecec
Done, works as expected
holtwick Dec 9, 2012
2f66f5a
Readded the credits to Ole Zorn, removed them before just to have sho…
holtwick Dec 9, 2012
f1b478d
Readme
holtwick Dec 9, 2012
c52494f
Merge branch 'string'
holtwick Dec 9, 2012
0df1b21
Rename project; public release
holtwick Dec 9, 2012
ed385fb
Fixed Readme; removed NSLog
holtwick Dec 9, 2012
43a5d56
Plugin can now be turned off in Edit menu; some fixes; smaller popover;
holtwick Dec 9, 2012
d77df69
Escaping fixed; shows length of sting in button; some UI changes; ref…
holtwick Dec 10, 2012
7496262
Leave text field with ESC or ENTER; updates string while typing; length
holtwick Dec 10, 2012
79bcbe6
Updated preview image
holtwick Dec 10, 2012
3f28ad0
Adjusted colors
holtwick Dec 10, 2012
09aceca
Improved Colors
Dec 10, 2012
9dc3661
Added multiline support
Dec 10, 2012
3f67ce1
Very minor fixes
holtwick Dec 10, 2012
9fa2698
Unescaping did not always work, added a test suite to consolidate the
holtwick Dec 11, 2012
3c878ca
Highlight regular strings like "...", not only @"..."
holtwick Dec 26, 2012
bee573f
Menu entry to open popover; fixed bug when changing selection of string
holtwick Dec 26, 2012
7728738
Updated README with details for keyboard shortcuts
holtwick Dec 26, 2012
25d673e
Updated README and illustration
holtwick Dec 27, 2012
d43ee10
Xcode 5 compatible?
holtwick Jul 27, 2013
c70fad6
Compatible with Xcode5 again and fixed one bug related to escaping the
holtwick Sep 27, 2013
45a4946
Upgraded project to Xcode5 and fixed multiple object release that cause
holtwick Sep 27, 2013
46b5cb0
Added GIF animation
holtwick Dec 2, 2013
3e16c8b
Removed Flattr button
holtwick Dec 2, 2013
55397a2
Xcode 5.1 Compatibility
holtwick Mar 17, 2014
8e1af97
Mention Alcatraz, Xcode 5.1 Compatibility note
holtwick Mar 17, 2014
4e168f4
Xcode 6 compatibility
holtwick Jul 21, 2014
a29a271
Fix menu label
kajinka13 Aug 2, 2014
b55911e
Added Xcode 6 GM UUID
cojoj Sep 11, 2014
8d949f7
Merge pull request #6 from kajinka13/master
holtwick Sep 13, 2014
c70e94a
Merge pull request #7 from cojoj/xcode-6-gm
holtwick Sep 13, 2014
d446250
make the frame and the button a bit nicer
schriftgestalt Jan 27, 2015
af77d31
only show the frame when selection is inside the quotes
schriftgestalt Jan 27, 2015
d7b80ea
Merge pull request #8 from schriftgestalt/master
holtwick Feb 16, 2015
4957434
fix issue:Popover closes while editing #5
iBenjamin Feb 27, 2015
f0d6ec0
Merge pull request #9 from iBenjamin/master
holtwick Mar 7, 2015
c60649a
Better contrasts for length button
holtwick Mar 7, 2015
6509f26
Fix Xcode 6.2 compatibility
holtwick Mar 19, 2015
f7f7dcb
Add Xcode 6.3 release compatibility.
bartoszj Apr 9, 2015
a4c1d06
Merge pull request #11 from bartoszj/master
holtwick Apr 9, 2015
4336695
Update Info.plist
Tomnaz May 21, 2015
92c2481
Merge pull request #13 from tomnaz/master
holtwick May 21, 2015
88fec43
Xcode 7 compatibility
holtwick Jun 26, 2015
b317bd8
Xcode 6.4 and 7.0 compatible
holtwick Jul 2, 2015
69681ea
Add Xcode 7.0 release (7A220) compatibility
willchen0506 Sep 17, 2015
a6d7bcd
Merge pull request #14 from willchen0506/master
holtwick Sep 17, 2015
77eef54
OCTest warnings
holtwick Sep 17, 2015
672a323
Compatible with Xcode 7.1 beta; removed unit tests; some doc changes
holtwick Sep 17, 2015
0256834
Added Xcode Version 7.1 release(7B91b) compatibility.
Oct 25, 2015
beb606d
Merge pull request #16 from langyufei/master
holtwick Oct 26, 2015
14c78ce
Xcode 7.2 compatibility
holtwick Dec 9, 2015
64fc27c
Adding Xcode 7.3 support
holtwick Mar 22, 2016
a067254
Merge branch 'release/xcode73'
holtwick Mar 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Classes/HOPopoverViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// HOStringSense by Dirk Holtwick 2012, holtwick.it
// Based on OMColorSense by by Ole Zorn, 2012
// Licensed under BSD style license
//

#import <Cocoa/Cocoa.h>

@interface HOPopoverViewController : NSViewController <NSTextFieldDelegate> {
NSTextField *_textField;
}

@property (weak, nonatomic) id delegate;

@end
54 changes: 54 additions & 0 deletions Classes/HOPopoverViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// HOStringSense by Dirk Holtwick 2012, holtwick.it
// Based on OMColorSense by by Ole Zorn, 2012
// Licensed under BSD style license
//

#import "HOPopoverViewController.h"

@implementation HOPopoverViewController

- (NSView *)view {
if(!_textField) {
_textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 200)];
_textField.focusRingType = NSFocusRingTypeNone;
_textField.bordered = NO;
_textField.backgroundColor = [NSColor colorWithCalibratedWhite:0.974 alpha:1.000];
_textField.textColor = [NSColor colorWithCalibratedWhite:0.107 alpha:1.000];
_textField.delegate = self;
}
return _textField;
}

- (void)dealloc {
_delegate = nil;
}

- (void)controlTextDidChange:(NSNotification *)obj {
// NSLog(@"Test: %@", [_textField stringValue]);
if([_delegate respondsToSelector:@selector(stringDidChange:)]) {
[_delegate performSelector:@selector(stringDidChange:) withObject:nil];
}
}

- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)commandSelector {
// NSLog(@"Textview Command: %@", NSStringFromSelector(commandSelector));
if(commandSelector == @selector(cancelOperation:)) {
if([_delegate respondsToSelector:@selector(dismissPopover)]) {
[_delegate performSelector:@selector(dismissPopover)];
}
return YES;
}

if (commandSelector == @selector(insertNewline:)) {
// new line action:
// always insert a line-break character and don’t cause the receiver
// to end editing
[textView insertNewlineIgnoringFieldEditor:self];
return YES;
}

return NO;
}

@end
13 changes: 13 additions & 0 deletions Classes/HOStringFrameView.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// HOStringSense by Dirk Holtwick 2012, holtwick.it
// Based on OMColorSense by by Ole Zorn, 2012
// Licensed under BSD style license
//

#import <Cocoa/Cocoa.h>

@interface HOStringFrameView : NSView

@property (nonatomic, strong) NSColor *color;

@end
25 changes: 25 additions & 0 deletions Classes/HOStringFrameView.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// HOStringSense by Dirk Holtwick 2012, holtwick.it
// Based on OMColorSense by by Ole Zorn, 2012
// Licensed under BSD style license
//

#import "HOStringFrameView.h"

@implementation HOStringFrameView

- (void)drawRect:(NSRect)dirtyRect {
[self.color setStroke];
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(self.bounds, 0.5, 0.5) xRadius:3.0 yRadius:3.0];
[path stroke];
}

- (void)setColor:(NSColor *)color {
if (color != _color) {
_color = color;
[self setNeedsDisplay:YES];
}
}


@end
32 changes: 32 additions & 0 deletions Classes/HOStringHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// HOStringSense by Dirk Holtwick 2012, holtwick.it
// Based on OMColorSense by by Ole Zorn, 2012
// Licensed under BSD style license
//

#import <Foundation/Foundation.h>
#import <AppKit/AppKit.h>

@class HOStringFrameView, HOStringInfoButton, HOPopoverViewController;

@interface HOStringHelper : NSObject <NSPopoverDelegate> {
HOPopoverViewController *_stringPopoverViewController;
NSPopover *_stringPopover;
NSRegularExpression *_stringRegex;
}

@property (nonatomic, strong) HOStringInfoButton *stringButton;
@property (nonatomic, strong) HOStringFrameView *stringFrameView;
@property (nonatomic, strong) NSTextView *textView;
@property (nonatomic, assign) NSRange selectedStringRange;
@property (nonatomic, copy) NSString *selectedStringContent;

- (void)dismissPopover;
- (void)activateColorHighlighting;
- (void)deactivateColorHighlighting;
- (NSString *)stringInText:(NSString *)text selectedRange:(NSRange)selectedRange matchedRange:(NSRangePointer)matchedRange;

- (NSString *)escapeString:(NSString *)string;
- (NSString *)unescapeString:(NSString *)string;

@end
Loading