RegexHighlightView
RegexHighlightView copied to clipboard
Editing has problems with longer source files
hello thanks for regexhighlightview!
i've found that editing works fine in the demo, but not for longer, real-world source code files. editing seems to be off to the cursor position by one or two lines.
the problem can be reproduced even in the demo app, just replace the short sample source code with a longer one, e.g.
http://pastebin.com/Wbz1DGzG
sorry to be impatient, but this is the only issue blocking an otherwise finished app. even just a suggestion where the bug might come from would help me.
Hello core-code,
sorry for my late reply. I have seen your message already and I am aware of the issue(s). I plan to redesign parts of the component in my spare time. The component was designed for displaying source code in first place, thefore I have never cared of editing larger files. I have located two issues there:
- As you can see in
RegexHighlightView.m
in theRegexHighlightViewDelegate
protocol, the UITextView gets updated on every change and/or scroll action completely. This causes the performance problems. In my redesign I will have to modify the code, so only the changedrange
gets evaluated and highlighted while typing. At the moment the whole markup gets re-calculated on every paint. - Secondly the original text view text (in black) is displayed behind the highligthed source code. This leads to the slightly offcentered characters. I will change this aswell.
Unfortulately I am curretly in my exams. Therefore I have no time to investigate into the issue any further currently. I will take care about the issue latest end of January, if I can't pull any code since then.
Thanks for waiting & regards, Kristian
thanks very much for your explanation. if i'm able to get it working better i'll post a patch ;-)
if i'm able to get it working better i'll post a patch
i had a look at fixing the issue or even just disabling the syntax highlighting on editing, but was not successful.
I will take care about the issue latest end of January
sorry to be a pest, but is a fix still planned? if not i'll try to move to another syntax highlighter