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

Avoid looking up a negative index when you have a tail find going (i.e., the...

Avoid looking up a negative index when you have a tail find going (i.e., the find panel is open) and you clear the buffer and it becomes empty (i.e., there's nothing before the cursor such as a prompt at the time you do cmd-k). Issue 6271
parent 1954f360
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -912,7 +912,7 @@ static int RawNumLines(LineBuffer* buffer, int width) {
// trailing empty lines. They all have the same position because they
// are empty. We need to back up by the number of empty lines and then
// use position.yOffset to disambiguate.
result.y = [self numLinesWithWidth:width] - 1 - [blocks.lastObject numberOfTrailingEmptyLines];
result.y = MAX(0, [self numLinesWithWidth:width] - 1 - [blocks.lastObject numberOfTrailingEmptyLines]);
ScreenCharArray *lastLine = [self wrappedLineAtIndex:result.y
width:width
continuation:NULL];
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