Skip to content

Commit

Permalink
• added Code Folding of { ... } multi-line blocks in R Script Editor;…
Browse files Browse the repository at this point in the history
… see gutter and/or Menu > Format > Code Folding > ...

git-svn-id: https://svn.r-project.org/R-packages/trunk/Mac-GUI@6238 694ef91d-65df-0310-b7bb-92e67a308ead
  • Loading branch information
Hans-Jörg Bibiko committed Aug 24, 2012
1 parent 08a9a62 commit de9817f
Show file tree
Hide file tree
Showing 36 changed files with 107,075 additions and 103,383 deletions.
5,283 changes: 2,479 additions & 2,804 deletions English.lproj/EditorPrefPane.xib

Large diffs are not rendered by default.

33,704 changes: 16,919 additions & 16,785 deletions English.lproj/MainMenu.xib

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions FoldingSignTextAttachmentCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView characterIn
[[col colorWithAlphaComponent:0.6f] setFill];
[path fill];
[path stroke];
[col setFill];

p = NSMakeRect(cellFrame.origin.x+4.0f+5.0f, y+h/2-1.0f, 3.0f, 3.0f);
NSRectFill(p);
p.origin.x+=5.0f;
NSRectFill(p);
p.origin.x+=5.0f;
NSRectFill(p);

// [col setFill];
// p = NSMakeRect(cellFrame.origin.x+4.0f+5.0f, y+h/2-1.0f, 3.0f, 3.0f);
// NSRectFill(p);
// p.origin.x+=5.0f;
// NSRectFill(p);
// p.origin.x+=5.0f;
// NSRectFill(p);

}

- (BOOL)wantsToTrackMouseForEvent:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView atCharacterIndex:(NSUInteger)charIndex
Expand All @@ -94,9 +95,7 @@ - (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *
{

if ([(RScriptEditorTextView *)controlView respondsToSelector:@selector(unfoldLinesContainingCharacterAtIndex:)]) {
[[(RScriptEditorTextView *)controlView undoManager] disableUndoRegistration];
BOOL success = [(RScriptEditorTextView *)controlView unfoldLinesContainingCharacterAtIndex:charIndex];
[[(RScriptEditorTextView *)controlView undoManager] enableUndoRegistration];
return success;
}

Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
NEWS for R.app GUI for Mac OS X

Last-update: 2012-08-24 [HJBB]
* Added Code Folding of { ... } multi-line blocks
in R Script Editor; see gutter and/or
Menu > Format > Code Folding > ...

Last-update: 2012-08-11 [HJBB]
* Fixed bug for not working code completion if in the
completion scope strings wrapped by '' are involved
Expand Down
13 changes: 13 additions & 0 deletions NoodleLineNumberView.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
//

#import <Cocoa/Cocoa.h>
#import "RScriptEditorTextStorage.h"

static inline id NSArrayObjectAtIndex(NSArray *self, NSUInteger i)
{
Expand Down Expand Up @@ -58,6 +59,16 @@ static inline id NSArrayObjectAtIndex(NSArray *self, NSUInteger i)
CGFloat maxWidthOfGlyph8;
CGFloat currentRuleThickness;
NSDictionary *textAttributes;
NSColor *normalBackgroundColor;
NSColor *foldedBackgroundColor;
NSPoint mouseHoveringAtPoint;
NSImage *top;
NSImage *topHoover;
NSImage *bottom;
NSImage *bottomHoover;
NSImage *folded;
NSImage *foldedHoover;
BOOL lineWrapping;

// Add support for selection by clicking/dragging
NSUInteger dragSelectionStartLine;
Expand All @@ -75,6 +86,7 @@ static inline id NSArrayObjectAtIndex(NSArray *self, NSUInteger i)
NSLayoutManager *layoutManager;
NSTextContainer *container;
NSTextView *clientView;
RScriptEditorTextStorage *cvTextStorage;

}

Expand All @@ -85,6 +97,7 @@ static inline id NSArrayObjectAtIndex(NSArray *self, NSUInteger i)
- (void)setFont:(NSFont*)aFont;
- (NSColor*)textColor;
- (void)setTextColor:(NSColor*)color;
- (void)setLineWrappingMode:(BOOL)mode;

- (id)initWithScrollView:(NSScrollView *)aScrollView;
- (NSUInteger)lineNumberForLocation:(CGFloat)location;
Expand Down
Loading

0 comments on commit de9817f

Please sign in to comment.