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

Fix a bug where the newline policy kiTermTextExtractorNullPolicyFromLastToEnd...

Fix a bug where the newline policy kiTermTextExtractorNullPolicyFromLastToEnd would include a leading newline after removing text prior to a null. This caused URL actions to detect a region that began one cell early. That null policy is only used in URL action detection.

Issue 5929
parent 54a0c989
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1269,6 +1269,7 @@ const NSInteger kLongMaximumWordLength = 100000;
right = width;
}
// If there is no text after this, insert a hard line break.
BOOL shouldAppendNewline = YES;
if (pad) {
for (int i = 0; i < numPreceedingNulls; i++) {
VT100GridCoord coord =
Loading
Loading
@@ -1280,6 +1281,7 @@ const NSInteger kLongMaximumWordLength = 100000;
case kiTermTextExtractorNullPolicyFromLastToEnd:
[result deleteCharactersInRange:NSMakeRange(0, [result length])];
[coords removeAllObjects];
shouldAppendNewline = NO;
break;
case kiTermTextExtractorNullPolicyFromStartToFirst:
return YES;
Loading
Loading
@@ -1293,6 +1295,7 @@ const NSInteger kLongMaximumWordLength = 100000;
}
}
if (code == EOL_HARD &&
shouldAppendNewline &&
(includeLastNewline || line < windowedRange.coordRange.end.y)) {
if (trimSelectionTrailingSpaces) {
NSInteger lengthBeforeTrimming = [result length];
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