Skip to content
Snippets Groups Projects
Commit 8a063160 authored by George Nachman's avatar George Nachman
Browse files

Copy mode improvements:

- Make it clearer which cell the cursor is on by drawing a vertical line from the arrow point
- If there is a selection when you enter copy mode, begin by extending it.
parent 9314133b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -785,6 +785,16 @@ ITERM_WEAKLY_REFERENCEABLE
_screen.cursorY - 1 + _screen.numberOfScrollbackLines);
_copyModeState.numberOfLines = _screen.numberOfLines;
_copyModeState.textView = _textview;
if (_textview.selection.allSubSelections.count == 1) {
[_textview.window makeFirstResponder:_textview];
iTermSubSelection *sub = _textview.selection.allSubSelections.firstObject;
_copyModeState.start = sub.range.coordRange.start;
_copyModeState.coord = sub.range.coordRange.end;
_copyModeState.selecting = YES;
_copyModeState.start = sub.range.coordRange.start;
_copyModeState.coord = sub.range.coordRange.end;
}
} else {
if (_textview.selection.live) {
[_textview.selection endLiveSelection];
Loading
Loading
@@ -6781,7 +6791,8 @@ ITERM_WEAKLY_REFERENCEABLE
 
- (void)textViewDidSelectRangeForFindOnPage:(VT100GridCoordRange)range {
if (_copyMode) {
_copyModeState.coord = range.end;
_copyModeState.coord = range.start;
_copyModeState.start = range.end;
[self.textview setNeedsDisplay:YES];
}
}
Loading
Loading
Loading
Loading
@@ -16,10 +16,10 @@
@interface iTermCopyModeState : NSObject
 
@property (nonatomic) VT100GridCoord coord;
@property (nonatomic) VT100GridCoord start;
@property (nonatomic) int numberOfLines;
@property (nonatomic, strong) PTYTextView *textView;
@property (nonatomic) BOOL selecting;
@property (nonatomic, readonly) VT100GridCoord start;
@property (nonatomic) iTermSelectionMode mode;
 
- (BOOL)moveBackwardWord;
Loading
Loading
Loading
Loading
@@ -135,8 +135,12 @@
rect.size.height * heightFraction);
 
NSBezierPath *path = [[[NSBezierPath alloc] init] autorelease];
path = [[[NSBezierPath alloc] init] autorelease];
[path moveToPoint:NSMakePoint(NSMinX(cursorRect), NSMinY(cursorRect))];
[path lineToPoint:NSMakePoint(NSMidX(cursorRect), NSMaxY(cursorRect))];
[path lineToPoint:NSMakePoint(NSMidX(cursorRect) - 1, NSMaxY(cursorRect))];
[path lineToPoint:NSMakePoint(NSMidX(cursorRect) - 1, NSMaxY(rect))];
[path lineToPoint:NSMakePoint(NSMidX(cursorRect) + 1, NSMaxY(rect))];
[path lineToPoint:NSMakePoint(NSMidX(cursorRect) + 1, NSMaxY(cursorRect))];
[path lineToPoint:NSMakePoint(NSMaxX(cursorRect), NSMinY(cursorRect))];
[path lineToPoint:NSMakePoint(NSMinX(cursorRect), NSMinY(cursorRect))];
[[NSColor whiteColor] set];
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment