illyabusigin / CYRTextView

CYRTextView is a UITextView subclass that implements a variety of features that are relevant to a syntax or code text view.
MIT License
535 stars 71 forks source link

Important issue: isn't supported multi-line syntax blocks #23

Open zyavrik opened 10 years ago

zyavrik commented 10 years ago

Steps to reproduce:

  1. Add regexp pattern for multi-line construction (for example, /* ... */).
  2. Type /* line 1 line2 */

Actual result: Only line 2 will be highlighted.

Should be: Both lines should be highlighted.

Note: Highlighting is correct after keyboard hides.

zyavrik commented 10 years ago

Suggested fix:

-(void)processEditing {
    // performReplacementsForRange doesn't support multi-line blocks, so using update method
    //[self performReplacementsForRange:[self editedRange]];
    [self update];
    [super processEditing];
}

/*- (void)performReplacementsForRange:(NSRange)changedRange {
    NSRange extendedRange = NSUnionRange(changedRange, [[_attributedString string] lineRangeForRange:NSMakeRange(NSMaxRange(changedRange), 0)]);

    [self applyStylesToRange:extendedRange];
}*/
zyavrik commented 10 years ago

Suggested fix causes an issue with jumping cursor.