Hi Neil, On 3/16/07, Neil Hodgson <[EMAIL PROTECTED]> wrote:
scite.MenuCommand(1200) will select the first buffer but there doesn't appear to be a good event to place this in. 1200 is IDM_BUFFER.
Following this up, it occurred to me that "-menucommand:1200", placed last on the command line, would do the trick, and indeed it does. I wonder if all the commands listed in SciTEDirector.html now work on the command line, contrary to what SciTEDoc.html says? Before discovering this, I tried Lua using your suggestion explicitly. My Lua startup file defines a function OnOpen(filename) to set some bookmarks, and I placed there a test for the name of the last file loaded (in the special case of my application, I know what this is in advance), followed by "scite.MenuCommand(1200)" as the last thing in the function. But this did not work. I thought perhaps SciTE did some further processing on the file before starting to listen for keyboard input, and so reset the focus to the last buffer. But changing the return of OnOpen from false to true made no difference either. In any case, this would not provide a general solution. In line with the general principle that as much of SciTE's behavior as possible should be manipulable with Lua, I propose the following: (1) SciTE should have a property named something like "SciTECommandLine", both gettable and settable (if possible), and exposed to Lua via scite.SciTECommandLine. This would enable the Lua startup script to get a first shot at the command line immediately after it's loaded. (Additionally, you could have an event "OnFinishingLoadingLua," but this might not be strictly necessary.) (2) There should be an event named something like "OnFinishingCommandLine" which is triggered after SciTE is done with the command line and before it starts listening for keyboard input, and exposed to Lua. This is the natural place to put something like scite.menucommand(1200). Thanks for your help and consideration, GF _______________________________________________ Scite-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scite-interest
