RegexHighlightView icon indicating copy to clipboard operation
RegexHighlightView copied to clipboard

Editing has problems with longer source files

Open core-code opened this issue 12 years ago • 4 comments

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

core-code avatar Nov 19 '12 09:11 core-code

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.

core-code avatar Dec 12 '12 12:12 core-code

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:

  1. As you can see in RegexHighlightView.m in the RegexHighlightViewDelegate 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 changed range gets evaluated and highlighted while typing. At the moment the whole markup gets re-calculated on every paint.
  2. 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

kristian avatar Dec 12 '12 19:12 kristian

thanks very much for your explanation. if i'm able to get it working better i'll post a patch ;-)

core-code avatar Dec 12 '12 23:12 core-code

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

core-code avatar Mar 27 '13 12:03 core-code