mirror of
https://github.com/MacDownApp/macdown.git
synced 2026-06-16 12:44:38 +00:00
Remove redundant indentation on last line
Previously, if the selection includes the trailing newline, the line
*after* the selection will be indented, which is not correct.
Introduced in 61e4a73.
This commit is contained in:
@@ -387,6 +387,11 @@ static NSString * const kMPBlockquoteLinePattern = @"^((?:\\> ?)+).*$";
|
||||
totalShift += paddingLength;
|
||||
[modLines addObject:[padding stringByAppendingString:line]];
|
||||
}];
|
||||
if ([modLines.lastObject isEqualToString:padding])
|
||||
{
|
||||
[modLines removeLastObject];
|
||||
[modLines addObject:@""];
|
||||
}
|
||||
NSString *processed = [modLines componentsJoinedByString:@"\n"];
|
||||
[self insertText:processed replacementRange:lineRange];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user