mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix line broke even in mid-word (fix #551)
This commit is contained in:
parent
86a256a25e
commit
ee41e1e724
@ -7,6 +7,15 @@ develop
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where wordwrap broke mid-word when a line is indented.
|
||||
|
||||
|
||||
|
||||
2.5.2 (123)
|
||||
--------------------------
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where invisible characters could not be hide.
|
||||
- Fix an issue where application could crash if the “Replace All” button was clicked continuous.
|
||||
- Fix an issue where application crashed on closing default window size setting window.
|
||||
|
@ -125,13 +125,11 @@
|
||||
|
||||
// check if the character is the first non-whitespace character after indent
|
||||
NSString *string = [[self attributedString] string];
|
||||
while (charIndex > 0) {
|
||||
unichar character = [string characterAtIndex:charIndex];
|
||||
for (NSInteger index = charIndex - 1; index >= 0; index--) {
|
||||
unichar character = [string characterAtIndex:index];
|
||||
|
||||
if (character == '\n') { return NO; } // the line ended
|
||||
if (character != ' ' && character != '\t') { return NO; } // hit to non-indent character
|
||||
|
||||
charIndex--;
|
||||
if (character == '\n') { return NO; } // the line ended before hitting indent chars
|
||||
if (character != ' ' && character != '\t') { return YES; } // hit to non-indent character
|
||||
}
|
||||
|
||||
return NO;
|
||||
|
Loading…
Reference in New Issue
Block a user