Home Download Buy Blog Forum Support

Bug? Auto-Save on focus re-gained (not focus-lost)

Bug? Auto-Save on focus re-gained (not focus-lost)

Postby BaNkIck on Tue Jul 10, 2012 9:23 am

Hi everyone,

I think this is a bug. I'm currently using Sublime Text 2 Build 2216 on Mac OS X. It's saving a modified file every time it gets the focus back. Say, I'm editing some file, now I switch to another file on another tab and get back to the previous file. Boom! The file gets automatically saved.

I checked my "save_on_focus_lost" and it is set to false. I even copied that parameter to my User settings to force this option but nothing changed. However, this is not the same. Having this parameter enabled, makes Sublime to save the file on "focus lost", not "focus re-gained".

Please note that this is happening since some versions ago, although I don't remember which exactly, sorry.

This is also happening if focusing on another application and returning to Sublime, or even pressing super+shift+p (to access quick panel) and closing it. In summary, the file gets saved everytime it re-gains focus; no matter the reason that made it loose the focus.

EDIT: Some typos.
BaNkIck
 
Posts: 1
Joined: Tue Jul 10, 2012 9:08 am

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby densming on Wed Aug 08, 2012 7:00 pm

I just noticed this also. It's unexpected behavior. Is this something that will be addressed in a future update?
densming
 
Posts: 3
Joined: Wed Aug 08, 2012 6:59 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby densming on Sat Aug 11, 2012 7:38 pm

I've been playing with this issue some more and it appears like the auto-save is based on file type. What I mean is, for text files (i.e., filenames ending in ".txt") ST2 does NOT auto-save on focus. However, other types of files (like Python ".py" files or even files with no extension) it does auto-save. Is there anyway to tweak this on a per-file-type basis?
densming
 
Posts: 3
Joined: Wed Aug 08, 2012 6:59 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby johnpeele on Mon Sep 17, 2012 2:59 pm

Is there any way someone can look into this issue please? Changing the save_on_focus_lost setting has no effect. I have my browser set to reload pages when local files are saved during web development, and this bug is causing me some major headaches. Thanks!!
johnpeele
 
Posts: 2
Joined: Mon Sep 17, 2012 2:56 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby johnpeele on Mon Sep 17, 2012 3:32 pm

Hey guys, I found what the issue was for me... The Git package. In the Git package settings, there is a setting:

// save before running commands
"save_first": true

Changing that setting to "false" took care of the "save on focus re-gained" issue I was having. Hope this helps!
johnpeele
 
Posts: 2
Joined: Mon Sep 17, 2012 2:56 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby capnfabs on Tue Sep 18, 2012 12:31 pm

Thanks! Just noticed the exact same thing on my config, your post was definitely helpful :)
capnfabs
 
Posts: 2
Joined: Mon Jul 16, 2012 5:52 am

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby bbuck on Wed Sep 19, 2012 5:35 pm

Thanks for the post, great find with the Git issue, I was getting quite annoyed.
bbuck
 
Posts: 1
Joined: Wed Sep 19, 2012 5:35 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby safright on Fri Sep 21, 2012 8:55 am

johnpeele wrote:Hey guys, I found what the issue was for me... The Git package. In the Git package settings, there is a setting:

// save before running commands
"save_first": true

Changing that setting to "false" took care of the "save on focus re-gained" issue I was having. Hope this helps!

really helped, thnx)
safright
 
Posts: 2
Joined: Tue Sep 11, 2012 8:01 pm

Re: Bug? Auto-Save on focus re-gained (not focus-lost)

Postby densming on Wed Nov 14, 2012 4:29 pm

johnpeele wrote:Hey guys, I found what the issue was for me... The Git package.


Awesome! Thanks for the reply. It turns out that I don't have the Git package installed, but I do have Modific. That has a similar setting that was causing the auto-save.:

// set to false to disable automatic saving
"autosave": true,

setting this to false fixed the problem for me!
densming
 
Posts: 3
Joined: Wed Aug 08, 2012 6:59 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 15 guests