AGS 3.1.1: Weird bug in script editor

Started by Crimson Wizard, Thu 08/01/2009 15:20:43

Previous topic - Next topic

Crimson Wizard

I met this bug in script editor only once and could not reproduce it no matter how long I tried.
Bug does not cause any crash nor annoyance though.

Error message I got:
QuoteError: Значение StartIndex не может быть меньше нуля.
Имя параметра: startIndex
Version: AGS 3.1.1.67

System.ArgumentOutOfRangeException: Значение StartIndex не может быть меньше нуля.
Имя параметра: startIndex
   в System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   в AGS.Editor.ScintillaWrapper.CheckFunctionForLocalVariables(Int32 currentPos, ScriptFunction func, String scriptExtract)
   в AGS.Editor.ScintillaWrapper.GetListOfLocalVariablesForCurrentPosition(Int32 currentPos)
   в AGS.Editor.ScintillaWrapper.FindLocalVariableWithName(Int32 startAtPos, String nameToFind)
   в AGS.Editor.ScintillaWrapper.GetFinalPartOfExpression(Int32 currentPos, ScriptStruct& memberOfStruct, Boolean functionsOnly)
   в AGS.Editor.ScintillaWrapper.ShowCalltip(Int32 openingBracketPos, Int32 parameterIndex, Boolean functionsOnly)
   в AGS.Editor.ScintillaWrapper.scintillaControl1_DwellStart(Object sender, DwellStartEventArgs e)
   в Scintilla.ScintillaControl.DispatchScintillaEvent(SCNotification notification)
   в Scintilla.ScintillaControl.WndProc(Message& m)
   в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

As you may notice, there are cyrillics there, perhaps because it uses some predefined system error text. I decided to leave it as is in sake of message authentity :), but in english that means following (approximate translation):
Quote
Error: Value of StartIndex cannot be less than zero.
Name of parameter: startIndex


Now, I did I get this error... it's interesting question. I was thinking of something and unintentionally dragging mouse over script text. When I selected all the text in editor window this bug happened. Since no crash occured I decided to check what could cause it and finally realized that this error message occurs when I place mouse cursor over function word in the first function definition in the script. It did not happen when I put cursor over function word anywhere else. When I cancelled selection I did earlier error was still happening each time I put cursor there.
After I closed script editor and opened it again, I could not reproduce this anymore.

Pumaman

Thanks for reporting this -- however, it is a known bug in 3.1.1. It happens after you delete a chunk of script, then hover the mouse over something.

It's fixed in the 3.1.2 beta and therefore will be fixed in the next version.

Khris

On that note, I was writing some code (in a module script) and had my finger resting on the right shift key while thinking about how to continue. After 8 seconds a windows message came up with some blah blah about turning up the key repeat delay and stuff, stealing focus from AGSEdit (3.1).

After that, the editor was sort of stuck in shift being pressed; clicking somewhere in the script made the editor mark all text from the original cursor position to the new one, and it was impossible to get things right again.
I had to quit and restart AGS, and of course screw around to get by the messed up editing to make the code compileable first :P

Pumaman

That's one of the standard Windows accessibility functions, and will happen to you in any text editor, not just AGS.

If the shift key seems to be stuck down, try pressing it and releasing it again, that usually does the trick.

Nickydude

I think it's called 'StickyKeys' and there is an option to have it not activate from within the pop-up that er.. pops up!. :)
Best Regards,
Nickydude
www.madladdesigns.co.uk

AGS Beginner's Guide - All you'll ever need!

Khris

Quote from: Pumaman on Thu 08/01/2009 20:14:13
That's one of the standard Windows accessibility functions, and will happen to you in any text editor, not just AGS.

If the shift key seems to be stuck down, try pressing it and releasing it again, that usually does the trick.


I've tried it again and after pressing shift for a couple of times, I indeed got back to the default behavior.
Trying it once more, pressing shift multiple times didn't help, but right-clicking during holding down shift did the trick.

Nickydude: No, sticky keys will active after 5 consecutive shift presses and is a different "accessibility function".

Nickydude

Best Regards,
Nickydude
www.madladdesigns.co.uk

AGS Beginner's Guide - All you'll ever need!

SMF spam blocked by CleanTalk