klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 295 forks source link

Harlowe long passages are sluggish and random text scrolls #746

Closed xeoncat closed 3 years ago

xeoncat commented 3 years ago

In Harlowe, the longer a passage is, the slower the highlighting is, taking up to a second to display the correct word highlighting.

And also,

changing the mouse cursor to a different position may change the scroll of the text to a seemingly random position, making it impossible to select text on the first click.

klembot commented 3 years ago

Sorry, please open any issues related to the Harlowe story format on that repo: https://foss.heptapod.net/games/harlowe/-/issues

HiEv commented 3 years ago

This isn't a Harlowe problem, this is a Twine editor problem. The editor is in charge of word highlighting and I've seen the scroll position bug with large amounts of text when using SugarCube as well.

To reproduce the second problem, simply paste a large chunk of "lorem ipsum" text into an editor window and then you won't be able to position the cursor at the end of the text. (Resizing the whole Twine window fixes the problem.)

klembot commented 3 years ago

Please re-open an issue on the large text issue, but as far as I can see, there is nothing actionable about the Harlowe question. My understanding is that Harlowe creates a CodeMirror syntax mode, but I don't know anything about how it works.

klembot commented 3 years ago

Relevant code: https://github.com/klembot/twinejs/blob/2.3-maintenance/src/editors/passage/index.js

greyelf commented 3 years ago

Harlowe's Passage Editor (CodeMirror) related JavaScript can be found in this folder of the Harlowe Heptapod repository, and associated CSS is found here.