Re: [code] How to auto save?

From: Mitchell <>
Date: Wed, 24 Jun 2020 13:55:28 -0400 (EDT)

Hi James

On Tue, 23 Jun 2020, James Reynolds wrote:

> How do I get TA to save documents whenever I switch to a different tab, different application, or just on a timer?

Try something like this in your *~/.textadept/init.lua*:

   events.connect(events.BUFFER_BEFORE_SWITCH, function()
     if buffer.filename then buffer:save() end


   timeout(60, function() if buffer.filename then buffer:save() end end)

Textadept does not report when its window loses focus.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 24 Jun 2020 - 13:55:28 EDT

This archive was generated by hypermail 2.2.0 : Thu 25 Jun 2020 - 06:41:44 EDT