Re: [code] How to auto save?

From: Mitchell <m.att.foicica.com>
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
   end)

or

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

Textadept does not report when its window loses focus.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
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