Lag on text input on MacOS [Laz issue, partially solved]

Solved bugs are moved into this topic...
tonydunn
Posts: 15
Joined: 02.07.2021 15:10

Lag on text input on MacOS [Laz issue, partially solved]

Post by tonydunn »

I am experiencing significant lag on entering text in an HTML file on both of two Macs, one an elderly 2010 iMac and the other a 2013 MacBook Air. The scenario is:

Session created saved and opened using 'Session' plugin. Session has four files, namely an index.html, a Markdown file, and two plain text files, all of which are very small in size (3.7k, 0.2k, 0.3k, and 3k). The HTML file lives in a local directory which is sync'd to the MEGA service, the Markdown in a local directory sync'd with Dropbox, and the two plain text files in different directories, both sync'd with MEGA.

Typing in any file *except* the HTML is normal performance, but in the HTML file there is a very noticeable lag between my typing and what appears on-screen in the file. I can type, look down at the keyboard, look up again, and the text is still being drawn to the screen, character by character.

I suspected my user.json, so stripped it back to just one line, the path to the Python Library ("pylib__mac"), re-started Cuda, but the problem is still there, so might it be something in the default.json?

With an identical user.json and pretty much the same plugins on Linux, I do not have the lag issue at all, it is as quick as ever.

Interestingly, if I open any *single* HTML file for editing, there is no lag. The issue seems (and I'm guessing here remember) to be when I am using a Session, and one of the files in that Session is an HTML file.

Finally, not sure if it is significant, but Macs are using Python 3.9.6, my Linuc kit 3.7.3.

Suggestions welcomed :)

Tony
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

I am puzzled. May you try options?

1. renderer_offsets__mac ('false' must be faster but some chars may overlap each other)
2. ui_buffered__mac (not sure which is better)
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

>Interestingly, if I open any *single* HTML file for editing, there is no lag. The issue seems (and I'm guessing here remember) to be when I am using a Session, and one of the files in that Session is an HTML file.

That sounds strange, so issue is not permanent, I am puzzled..
tonydunn
Posts: 15
Joined: 02.07.2021 15:10

Post by tonydunn »

I tried variations on renderer_offsets__mac set to false/true, and ui_buffered__mac, but neither of them seemed to help, the lag was still very obvious. I tried starting with just the plain text/Markdown files, and editing was fine, nice and quick, but as soon as I added any HTML file and tried to edit it, the slowdown started, until it was pretty much no use. It seemed the more text I added (say 15-20 lines), the worse the lag became.

Created a barebones HTML file from template to see if my files might have been the problem, but no, just as bad as soon as I started to type.

I had a lot of plugins installed, so completely deleted my existing installation, installed latest Cuda 1.37.0.0, and ran with just one line in my user.json, namely:

"pylib__mac" : "/Library/Frameworks/Python.framework/Versions/3.9/lib/libpython3.9.dylib"

Now I have a new and additional problem, in that my cursor has become invisible when I create an HTML file from a template! I can see what line I am on from the line numbers, but not the cursor. If I start to type, the text appears, but the cursor remains invisible to me. If I open an existing HTML file, the cursor is there no problem.

If I change my user.json file now by adding even a commented-out blank line, and save, then return to the HTML file I created from template, the cursor is now visible.

Any more information I can provide, please let me know. A lot of my work with text is HTML, and this is really stopping me getting the most out of CudaText :(

Thanks
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

sorry, seems some Lazarus issues exist which prevent the normal work. I must repeat issue myself (old Macbook 2008) first. sorry.
Shovel
Posts: 141
Joined: 31.12.2019 10:16

Post by Shovel »

@tonydunn I'm curious, is lag present if you switch html-file's lexer to None, then restart CudaText?
tonydunn
Posts: 15
Joined: 02.07.2021 15:10

Post by tonydunn »

Error and/or crash editing hTML file
Error and/or crash editing hTML file
@Shovel - I changed the lexer from HTML to none and the lag disappeared immediately. I then changed the lexer to 'C' and the lag returned, probably even worse than with the HTML lexer, but certainly horrible to use.

Not sure if it is relevant but when using the HTML lexer with the HTML file, the <body> and </body> tags keep highlighting on and off as I type? Not with every character, just sometimes, but I can't see any pattern in it.

Finally, I was getting errors/crashes yesterday when working on an HTML file. I could repeat this, and the only thing that changed was the list index value. I've added a screenshot to this post, for what it is worth.

Thanks
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

>the <body> and </body> tags keep highlighting on and off as I type?

This is 'dynamic highlighting',
https://wiki.freepascal.org/CudaText#Ho ... ML_tags.3F

default config:
Enable caret-depending highlightings.
- e.g. Pascal highlightes "begin"/"end" with green when caret is inside block
- HTML/XML highlightes opening/closing tags when caret is inside tag

Thanks for screenshot, this may help to reproduce that.
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

Also, what is Console panel text, you have '1' error in console because screenshot shows '1' in blue.
uvviewsoft
Posts: 392
Joined: 01.12.2020 13:46

Post by uvviewsoft »

sucess! I reproduced the crash!
in the same HTML context. to temporary fix that-- turn off option "bracket_highlight".
Post Reply