Skip to content

Commit

Permalink
merge SVN r8075 (R 4.2.0 release)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-u committed Apr 23, 2022
1 parent e72fe08 commit 6594404
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
4 changes: 2 additions & 2 deletions InfoPlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/

/* GUI version as shown in infos e.g. 1.27-devel */
#define GUI_VER 1.78-devel
#define GUI_VER 1.78
/* R postfix used to denote release versions of GUI - set to R release version (e.g. 2.8.0) or to anything that will be shown in between R and GUI (e.g. - or for Mac) */
#define R_RELEASE for macOS
#define R_RELEASE 4.2.0

/* NOTE: unfortunately it is NOT possible to rely on MAC_OS_X_VERSION_MIN_REQUIRED,
because Xcode's Info.plist processing does NOT include flags that are passed to
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NEWS for R.app GUI for Mac OS X

-- Release Version 1.78 (8075) - supplied with R 4.2.0 --

Last-update: 2022-04-18
* When a package is installed "At User Level" using the Package
Installer and library doesn't exist then the user library is
Expand Down
31 changes: 18 additions & 13 deletions NoodleLineNumberView.m
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,16 @@ - (void)drawHashMarksAndLabelsInRect:(NSRect)aRect

}

- (NSUInteger) positionAtLine: (NSUInteger) line {
NSArray *lines = [self lineIndices];
if (line < [lines count]) {
NSUInteger pos = [NSArrayObjectAtIndex(lines, line) unsignedIntegerValue];
if (pos) pos--;
return pos;
}
return [[clientView string] length];
}

- (void)mouseDown:(NSEvent *)theEvent
{

Expand All @@ -490,24 +500,19 @@ - (void)mouseDown:(NSEvent *)theEvent
line = [self lineNumberForLocation:p.y];

// Check if click was inside folding marker
if(isFoldingEnabled && ((NSWidth([self bounds]) - RULER_MARGIN)+3) - p.x >= 0 && ((NSWidth([self bounds]) - RULER_MARGIN)-3) - p.x < 7) {

if (line != NSNotFound && isFoldingEnabled &&
((NSWidth([self bounds]) - RULER_MARGIN)+3) - p.x >= 0 && ((NSWidth([self bounds]) - RULER_MARGIN)-3) - p.x < 7) {
if (line < 1) line = 1;
NSUInteger caretPosition = 0;
NSArray *lines = [self lineIndices];
NSInteger index = [NSArrayObjectAtIndex(lines, line-1) unsignedIntegerValue];

// Check for folding markers
NSRange r;
NSUInteger selectionEnd = 0;
if (line < [lines count]) {
selectionEnd = [NSArrayObjectAtIndex(lines, line) unsignedIntegerValue] - 1;
} else {
selectionEnd = [[clientView string] length];
}
NSUInteger selectionEnd = [self positionAtLine: line];

if(index < 0 || (selectionEnd - index) >= [[clientView string] length]) {
if(index < 0 || (selectionEnd - index) >= [[clientView string] length])
return;
}

r = NSMakeRange(index, selectionEnd - index);

Expand All @@ -519,8 +524,7 @@ - (void)mouseDown:(NSEvent *)theEvent
}

if(foldItem < 2) {
caretPosition = [NSArrayObjectAtIndex([self lineIndices], line) unsignedIntegerValue];
if(caretPosition > 0) caretPosition--;
caretPosition = [self positionAtLine: line];
} else {
caretPosition = index;
}
Expand Down Expand Up @@ -680,7 +684,8 @@ - (void)mouseDragged:(NSEvent *)theEvent
startLine = line;
endLine = dragSelectionStartLine;
}

if (startLine < 1) startLine = 1;
if (startLine > [lines count]) return;
selectionStart = [NSArrayObjectAtIndex(lines, (startLine - 1)) unsignedIntegerValue];
if (endLine < [lines count]) {
selectionEnd = [NSArrayObjectAtIndex(lines, endLine) unsignedIntegerValue];
Expand Down
2 changes: 1 addition & 1 deletion RController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* writing to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA.
*
* $Id: RController.h 7916 2021-01-25 03:35:33Z urbaneks $
* $Id: RController.h 8064 2022-04-02 23:14:19Z urbaneks $
*/

#import "RGUI.h"
Expand Down
2 changes: 1 addition & 1 deletion RController.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* writing to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA.
*
* $Id: RController.m 7970 2021-05-08 23:45:49Z urbaneks $
* $Id: RController.m 8064 2022-04-02 23:14:19Z urbaneks $
*/


Expand Down
1 change: 1 addition & 0 deletions RScriptEditorGlyphGenerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ - (void)generateGlyphsForGlyphStorage:(id <NSGlyphStorage>)glyphStorage desiredN

- (void)insertGlyphs:(const NSGlyph *)glyphs length:(NSUInteger)length forStartingGlyphAtIndex:(NSUInteger)glyphIndex characterIndex:(NSUInteger)charIndex
{
if (!_destination) return;
NSGlyph localBuffer[64]; /* stack-local buffer to avoid allocations */
NSGlyph *buffer = NULL;
NSInteger folded = [theTextStorage foldedAtIndex: charIndex];
Expand Down

0 comments on commit 6594404

Please sign in to comment.