secondlife / secondlife/viewer

Lexing / Selection-related bug in SLua editor

Open
#5,572 3 comments 0 reactions 1 assignee View on GitHub

@marchcat is already working on this.

Since Mar 30, 2026.

  • #5593 by @marchcat — merged
bug SLua stale team:viewer
Dominant language
C++
Stars
299
Forks
146
Avg merge
1d 9h
Merged PRs (30d)
88

Description

This appears to be related to highlighting. It is also influenced by the amount of code in the script and by the amount of comment text. However, commenting out all preceding code, or turning it all into a very long string, can make the problem vanish. The affected scripts compile and run without unexpected errors, but it becomes difficult to edit certain lines within the editor:

Steps to reproduce: In an SLua Enabled Sim, rez a new prim. Create a new script, open it, and replace the contents with the attached script.

Note that "LLEvents" in line 14 is highlighted in green.

Attempt to select the line.

Observe that only the word "function" is highlighted.

Copy the line and paste at the bottom of the script.

Observe that the whole line is pasted.

Place the cursor at the left edge of the line and move right one character at a time with the arrow keys.

Observe that the characters "s.touch_e" are skipped as a group.

Attempt to select or erase "_end".

Depending on your method, various failures will occur.

Press End to move to the end of the line.

Observe that the visible cursor is well past the end of the line, but that backspace deletes the last character.

Note that when the line no longer represents a proper event that the line becomes normally editable.

Comment out line 12.

Observe that "LLEvents" becomes blue and the line is normally editable.

Reenable line 12 and delete line 13.

Observe the same.

So far, I have only observed this with LLEvents.touch... All 3 are affected.

In-Editor WORKAROUND: When editing an affected line, change the first keyword by adding an extra character at the beginning, such as making "LLEvents" into "xLLEvents". Edit the line as needed, then remove the extra character.

https://secondlife.canny.io/admin/feedback/slua-alpha/p/bug-in-script-editor-second-life-project-lua-editor-261021525310258-64bit


This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim #5572 either in the PR description or in a PR's comment.

🪙 Also, everyone can tip any user commenting /tip 20 @canny[bot] (replace 20 with the amount, and @canny[bot] with the user to tip).

📖 If you want to learn more, check out our documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.