Permalink
Browse files

updates.

  • Loading branch information...
1 parent 542c958 commit 4becf4bf0496529e3a51815a0ad5563fef4c0cc7 @ccgus committed Apr 26, 2012
@@ -102,18 +102,16 @@ - (float)minimumWidth {
- (NSTextView*)currentTextView {
- id wc = [(id)[VPBlogPlugin currentDocument] topWindowController];
+ id <VPPluginWindowController>wc = [[VPBlogPlugin currentDocument] mainWindowController];
return [wc textView];
}
- (id<VPData>)currentItem {
- id wc = [(id)[VPBlogPlugin currentDocument] topWindowController];
+ id <VPPluginWindowController>wc = [[VPBlogPlugin currentDocument] mainWindowController];
- id item = [wc item];
-
- return item;
+ return [wc visibleItem];
}
- (void)togglePublishPageAction:(id)sender {
@@ -198,16 +196,16 @@ - (void)insertBlockquoteAction:(id)sender {
if (r.length == 0) {
- [tv insertText:@"<blockquote><# #></blockquote>"];
+ [tv fmReplaceCharactersInRange:r withString:@"<blockquote><# #></blockquote>"];
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
[tv selectNextTextPlaceholder:sender];
return;
}
NSString *s = [[[tv textStorage] mutableString] substringWithRange:r];
- NSString *repace = [NSString stringWithFormat:@"<blockquote>%@</blockquote>", s];
- [tv insertText:repace];
+ NSString *replace = [NSString stringWithFormat:@"<blockquote>%@</blockquote>", s];
+ [tv fmReplaceCharactersInRange:r withString:replace];
}
- (void)pasteHREFAction:(id)sender {
@@ -221,17 +219,16 @@ - (void)pasteHREFAction:(id)sender {
NSRange r = [tv selectedRange];
if (r.length == 0) {
-
- [tv insertText:@"[<# link text #>](<# Earl #>)"];
+ [tv fmReplaceCharactersInRange:r withString:@"[<# link text #>](<# Earl #>)"];
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
[tv selectNextTextPlaceholder:sender];
return;
}
NSString *s = [[[tv textStorage] mutableString] substringWithRange:r];
- NSString *repace = [NSString stringWithFormat:@"[%@](<# Earl #>)", s];
- [tv insertText:repace];
+ NSString *replace = [NSString stringWithFormat:@"[%@](<# Earl #>)", s];
+ [tv fmReplaceCharactersInRange:r withString:replace];
r.length = 0;
[tv setSelectedRange:r]; // move back so we grab the right placeholder.
@@ -10,7 +10,6 @@
#import "JSTalk.h"
@interface NSObject (ThingsINeedToOpenUpInVPOrMakeBetter)
-- (id)topWindowController;
- (void)setMetaValue:(NSString*)value forKey:(NSString*)aKey;
- (id)store;
- (void)setAttributesForItem:(id)item;
Oops, something went wrong.

0 comments on commit 4becf4b

Please sign in to comment.