Jump to content

[SOLVED] SciTE - session erased when open a script?


Recommended Posts

Posted (edited)

Hello.

If (while SciTE is NOT running) I run SciTE by double-clicking an .AU3 script to edit it then the previous SciTE session is ERASED.

Is there any way I can make SciTE load the previous session when it is run by double-clicking a script?  (adding the file I just double-clicked of course).

Edited by lee321987
Mark the question as [SOLVED].
Link to post
Share on other sites
  • Developers

Use the separate SciTE4AutoIt3 installer and this issue will be resolved (is configurable) ;) 

#restore last session when selecting Open file from Explorer -  Only available in SciTE4AutoIt3 version
save.session.advanced=1

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
On 5/14/2021 at 10:19 PM, Jos said:

save.session.advanced=1

Shut the front door!

I have been using AutoIt for 14 odd years and initially was frustrated at losing my sessions until I learned to never click on an .au3 file.

I am perplexed that this mysterious hidden feature is remmed out by default when intuitively this is the behaviour one would expect from an editor.

Fourteen years too late but this may help me in the future. Thanks for asking @lee321987 and Jos for answering.

Phil Seakins

Link to post
Share on other sites

Yeah I've been using AutoIt for probably 12-13 years.

I made habit of just leaving SciTE running most of the time, and for those times where I thought it was running but it wasn't, I wrote a script to backup the previous .session file (the file is not written until you close SciTE), close SciTE, and copy the backup file over the current.

I'm really grateful to hear about this setting!

I too think it should be default behavior.

Link to post
Share on other sites
  • Developers
3 hours ago, lee321987 said:

I too think it should be default behavior.

You guys are probably right but that should only happen when check.if.already.open=1 as else each SciTE session would restore all files. 
This function has been in there since the early days but I moved it into the internal SciTE Source in 2018:

Quote

8-7-2018
*** Merged the SciTE v 4.1.0 by Neil Hodgson with our own version of SciTE. (Jos)
    This is a major change from the previous version so ensure you update all files including LUA or else you will get errors!
    - SciLexer au3: Fixed issues with nested CommentBlocks not always showing the correct color.
    - SciLexer au3: Change any line starting with # and no recognised keyword to be shown with the Pre-Processor in stead of default.
    - Changed Shortcut for AU3INFO to Ctrl+Shift+F6.
    - Moved the session restore logic for (save.session.advanced=1)into SciTE in stead of LoadSession.lua as that was clearing the recent files list of the last session
      when opening a file by double cliking it. This is fixed with this change.
      Default remains 0 so when a file is double clicked the last session isn't restored unless you add this to SciTEuser.properties:
      "save.session.advanced=1"

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

I am not sure I understand. It appears that check.if.already.open=1 apparently prevented Scite from restoring all files which of course is the opposite of what you would want.

Anyway, it doesn't really matter to me, as I learned to never click on an .au3. Thanks for commenting Jos. At least these features are  configurable which is what makes AutoIt so great. You want to do something - AutoIt can make it happen.

Phil Seakins

Link to post
Share on other sites
  • Developers
2 hours ago, pseakins said:

I am not sure I understand. It appears that check.if.already.open=1 apparently prevented Scite from restoring all files which of course is the opposite of what you would want.

Understood and that is "fixed" with the function I added to SciTE with this parameter. ... but when check.if.already.open=0, one expects that SciTE will open a new SciTE instance for each double-clicked file and I would think you don't want to restore the complete session first when using save.session.advanced=1....right?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
On 5/18/2021 at 5:04 PM, Jos said:

you don't want to restore the complete session first when using save.session.advanced=1....right?

I do. I have about twenty tabs open in the editor. I want them all to remain when I open the editor otherwise I may forget I was working on them.

Enabling save.session.advanced=1 now protects me from accidently losing them.

I am happy the way things are. I open the editor via the Quick Launch panel because I fiddled around with the colour scheme resulting in having the cursor disappear. Via help from this forum I tailored @eManF's SciTE Caret Changer(Color and Width) app which I need to execute at the same time in order to make the cursor visible. I like a dark blue background.

 

 

Phil Seakins

Link to post
Share on other sites
  • Developers
6 hours ago, pseakins said:

I do. I have about twenty tabs open in the editor.

I guess you didn't completely read/understand the question as the mentioned option opens a separate instance of SciTE for each file! ;) 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites
  • lee321987 changed the title to [SOLVED] SciTE - session erased when open a script?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...