01-26-2009 13:34
Hey folks. As of 1.22.5 (Release Candidate) I've noticed that a certain sequence of inputs in the script editor causes the cursor to make a VERY annoying extra movement. Thing is, people don't seem to be able to reproduce this in Windows or the Mac OS. I'm wondering if anyone else has experienced this, or could try reproducing. I THINK it still happens in 1.22.6, but I'll have to test again in the next couple days when I can get back to my normal computer.

JIRA URL: http://jira.secondlife.com/browse/VWR-11572

Here's some info pasted from it for your convenience:


Title
========

Script Editor: Arrow key (up) navigation jumps before open curly brace


Description
========

A helpful programming habit is to enter matching braces, parentheses, quotes, etc., and then go back and fill in the contents. When indentation-matched curly braces are used on control structures (states, functions, if, for, while, etc.) this may be done easily in the script editor using a ..., ENTER, {, ENTER, }, UP-ARROW, ENTER key sequence, which leaves the script in a state that looks like (@ shows where the cursor is):

CODE

if (...)
{
@
}


However, in 1.22.5, using the UP arrow key to navigate from just after the close curly brace (}) to just after the open curly brace above it ({) for some reason (USUALLY) causes the cursor to also move to the left one character, leaving it BEFORE the open brace.

I believe this is new behavior in 1.22.5; it did not occur in 1.22.4. It is a very annoying bug that hurts scripter productivity for those using this kind of editing practice.

Reproduction Steps
----

1.) Create a new script and edit it. Place the cursor after the end of the llSay() statement in the state_entry() handler and press ENTER a couple of times to start on a new line.

2.) Enter the text: "if (TRUE)", without a newline at the end.

3.) Now enter the following keystrokes: ENTER, {, ENTER, }, UP-ARROW.

4.) Observe the resulting placement of the I-cursor.

Expected Behavior
----

The following script should result, with a @ used to show where the cursor is located:

CODE

default
{
state_entry()
{
llSay(0, "Hello, Avatar!");

if (TRUE)
{@
}
}

touch_start(integer total_number)
{
llSay(0, "Touched.");
}
}


Observed Behavior
----

The cursor is placed BEFORE the brace, as shown here:

CODE

default
{
state_entry()
{
llSay(0, "Hello, Avatar!");

if (TRUE)
@{
}
}

touch_start(integer total_number)
{
llSay(0, "Touched.");
}
}



Environment
========
Second Life 1.22.5 (107013) Dec 31 2008 13:30:15 (Second Life Release Candidate)
Release Notes

CPU: AMD Athlon(tm) 64 Processor 4000+
Memory: 2012 MB
OS Version: Linux 2.6.27.9-73.fc9.x86_64 #1 SMP Tue Dec 16 14:54:03 EST 2008 x86_64
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce 7600 GT/PCI/SSE2
OpenGL Version: 2.1.2 NVIDIA 177.82

libcurl Version: libcurl/7.16.4 OpenSSL/0.9.7c zlib/1.2.3 c-ares/1.4.0
J2C Decoder Version: KDU
LLMozLib Version: [LLMediaImplLLMozLib] - 2.01.21045 (Mozilla GRE version 1.8.1.13_0000000000)