Impresario Beaumont Posted August 3, 2023 Share Posted August 3, 2023 As I write a script, the ending curly brace normally positions itself correctly, as in: if (a == b) { some code} at some unpredictable point, however, it stops doing that, leaving the curly brace, as in if (a == b) { some code } and I have to manually move it back. Is this a bug or am I doing something to cause this behaviour? Link to comment Share on other sites More sharing options...
Love Zhaoying Posted August 3, 2023 Share Posted August 3, 2023 (edited) What code editor are you using? *Edit* Auto-indentation isn't that great in the viewer editor. Guess I became used to it..? Edited August 3, 2023 by Love Zhaoying Link to comment Share on other sites More sharing options...
Impresario Beaumont Posted August 3, 2023 Author Share Posted August 3, 2023 I'm using the editor in the viewer. I gather that's a bug then? Link to comment Share on other sites More sharing options...
Frionil Fang Posted August 3, 2023 Share Posted August 3, 2023 The viewer script editor is prone to losing track of the indentation level for some reason I've never pinpointed, so it's certainly a bug but hard to reproduce on demand. Erasing the leading spaces on a wrongly-indented line should drop it to the previous indentation level directly, so it's mostly a mild nuisance. You can also use tab/shift+tab with a block of text selected to change the entire selection's indentation level. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 3, 2023 Share Posted August 3, 2023 Yeah, that has annoyed me for sixteen years now. I have become accustomed to tabbing manually when I am using the editor in the viewer. When I use Sublime Text, of course, it's not an issue. I know there are people who don't get worried about such things since the compiler doesn't care, but indentation helps me keep track of scopes in a script. Besides, a script should be attractive too. 1 Link to comment Share on other sites More sharing options...
Love Zhaoying Posted August 4, 2023 Share Posted August 4, 2023 My fingers automatically select the text area, delete the extra tabs and carry on..! Ironically, I use old-style brace positioning anyway: if (TRUE) { // I'm old so open-brace goes here! stuff(); } Link to comment Share on other sites More sharing options...
Impresario Beaumont Posted August 4, 2023 Author Share Posted August 4, 2023 I gather that there are other editors available. Is that a good option? which ones? Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 4, 2023 Share Posted August 4, 2023 There's a reasonably good list in the LSL wiki at https://wiki.secondlife.com/wiki/LSL_Alternate_Editors , and if you search through the archives of this forum you'll see that someone asks about editors about once every six months or so. There's no shortage of favorites. I happen to like Sublime Text, although I am just as likely to do my scripting live inworld with the editor in the viewer. The ones that most scripters use are kept up to date pretty regularly as LL adds new functions, so which one you choose is really a matter of personal preference. 2 Link to comment Share on other sites More sharing options...
KT Kingsley Posted August 5, 2023 Share Posted August 5, 2023 I think auto-unindentation stops working following a line of text that wraps-around. 1 Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted August 5, 2023 Share Posted August 5, 2023 The other way I've seen LSL editor indentation glitch out is that sometimes when I try to indent with the tab key, it will paste a portion of the clipboard... or something else, I'm not entirely sure. Been meaning to try and nail down what is actually happening for a proper bug report. Link to comment Share on other sites More sharing options...
Rolig Loon Posted August 5, 2023 Share Posted August 5, 2023 1 minute ago, Fenix Eldritch said: The other way I've seen LSL editor indentation glitch out is that sometimes when I try to indent with the tab key, it will paste a portion of the clipboard... or something else, I'm not entirely sure. Yeah, that one has been with us for ages too. It's annoying but fortunately not frequent enough to be more than a nuisance. Link to comment Share on other sites More sharing options...
Quistess Alpha Posted August 5, 2023 Share Posted August 5, 2023 49 minutes ago, Fenix Eldritch said: it will paste a portion of the clipboard... or something else, I'm not entirely sure. That happens when a tooltip is visible. for example, if you type 'listen' and then hover the mouse over it, then tab will paste: listen(integer Channel, string Name, key ID, string Text) it's mildly annoying that it duplicates some of the text ("listen" gets pasted even though you just typed it) and yes, very easy to do accidentally, but it's also useful in limited circumstances. 4 Link to comment Share on other sites More sharing options...
Qie Niangao Posted August 5, 2023 Share Posted August 5, 2023 4 hours ago, Quistess Alpha said: That happens when a tooltip is visible. for example, if you type 'listen' and then hover the mouse over it, then tab will paste: listen(integer Channel, string Name, key ID, string Text) it's mildly annoying that it duplicates some of the text ("listen" gets pasted even though you just typed it) and yes, very easy to do accidentally, but it's also useful in limited circumstances. Actually, that's pretty cool and I never knew it did that. I'd quibble about its symbol capitalization, but it's more useful than not. I don't think that's the bug at hand, though. Instead I see it occasionally insert something like "Comment: blah blah blah" at the cursor location when I hit the tab key. A Ctrl-Z undoes the damage and another tab does what I intended in the first place. (Or maybe that's another different bug.) Link to comment Share on other sites More sharing options...
Quistess Alpha Posted August 5, 2023 Share Posted August 5, 2023 (edited) 30 minutes ago, Qie Niangao said: I don't think that's the bug at hand, though. Instead I see it occasionally insert something like "Comment: blah blah blah" at the cursor location when I hit the tab key. Same "helpful" feature: If your pointer is hovering over a comment (and the tooltip is displayed) . . . /* move text-cursor to next line while mouse-hovering over this line, then press tab: */ Comment (multi-line) // move cursor to next line while tooltip on this line is visible, then tab: Comment (single-line) "Move cursor to next line while hovering over this etc. etc.:" String literal listen listen(integer Channel, string Name, key ID, string Text) llListen integer llListen(integer Channel, string SpeakersName, key SpeakersID, string Text); Edited August 5, 2023 by Quistess Alpha 2 Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted August 5, 2023 Share Posted August 5, 2023 (edited) 4 hours ago, Quistess Alpha said: That happens when a tooltip is visible. Oh... OH! I see what's happening now: that appears to trigger when any tooltip is up. What gets injected at the cursor appears to be the first line(?) of whatever is in the tooltip. So if for example, my mouse is hovering over a string and I press tab, I'll get "String literal" inserted at the cursor. Just ran through a quick list of various things and it seems pretty consistent now. default Type: , Value: state state <target> state_entry state_entry() integer 32 bit integer value. float 32 bit floating point value. vector A vector is a data type that contains a set of three float values. rotation The rotation type is one of several ways to represent an orientation in 3D. quaternion The quaternion type is a left over from way back when LSL was created. It was later renamed to <rotation> to make it more user friendly, but it appears someone forgot to remove it ;-) list A collection of other data types. key A 128 bit unique identifier (UUID). string Text data. "string" String literal // Comment (single-line) /* */ Comment (multi-line) if if / else block else if / else block while while loop do do / while loop for for loop return Leave current event or function. jump jump statement ZERO_VECTOR Type: vector, Value: <0.0, 0.0, 0.0> So I guess the moral of the story is to watch where you park your mouse when pressing tab while writing code in the viewer. If a tooltip is rendering, you'll scoop up some of its text. On the fence as to whether I should write up a bug report... as it kinda doesn't seem intentional in my opinion.... Edited August 5, 2023 by Fenix Eldritch 3 Link to comment Share on other sites More sharing options...
Quistess Alpha Posted August 5, 2023 Share Posted August 5, 2023 (edited) 15 minutes ago, Fenix Eldritch said: that appears to trigger when any tooltip is up. . . . Yes, even if that tooltip isn't part of the scripting interface. hovering over an object named "Object" with world->hover tips->"show hover tips"(ctrl-shift-t) enabled can paste "Object" into the script window, if the script window is active. (if you click outside the script window, the text-cursor disappears and tab does not paste text.) Buttons on the bottom row, and some things at the top of the viewer also produce hover-texts with paste-able content. As a helpful point to a potential bug report, pressing tab in a notecard editing window does not paste hover-tip text. Edited August 5, 2023 by Quistess Alpha 2 Link to comment Share on other sites More sharing options...
Fenix Eldritch Posted August 5, 2023 Share Posted August 5, 2023 Yeah that's wild. I think I will at least report that and let LL figure it out. Thanks for shedding light on this mystery - it had perplexed me for a long, long time. 3 Link to comment Share on other sites More sharing options...
KT Kingsley Posted August 19, 2023 Share Posted August 19, 2023 For what it's worth, the braces issue has been fixed in the latest Friestorm. Link to comment Share on other sites More sharing options...
Phate Shepherd Posted August 21, 2023 Share Posted August 21, 2023 (edited) On 8/19/2023 at 7:27 AM, KT Kingsley said: For what it's worth, the braces issue has been fixed in the latest Friestorm. Wait.... first we get the option to remove alphas from image uploads that don't need them, and now we get a fix for brace indention? Someone is actually fixing stuff from "r/MildyInfuriating"? Edited August 21, 2023 by Phate Shepherd Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now