Re: [code] [textadept] Checking for changed files on disk

From: Mitchell <m.att.foicica.com>
Date: Fri, 8 Nov 2013 08:38:21 -0500 (Eastern Standard Time)

Robert,

On Wed, 6 Nov 2013, Robert Gieseke wrote:

> [snip]
>
> I'd like to be able to use this and for example check if the file
> contents actually changed after switching branches and if not, silently
> reload the file.
>
> Basically, make update_modified_file look something like
>
> local function update_modified_file()
> if not buffer.filename then return end
> local mod_time = lfs.attributes(buffer.filename, 'modification')
> if not mod_time or not buffer.mod_time then return end
> if buffer.mod_time < mod_time then
> buffer.mod_time = mod_time
> events.emit(events.FILE_CHANGED)
> end
> end

I like this idea and will look into it. Thanks.

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 Fri 08 Nov 2013 - 08:38:21 EST

This archive was generated by hypermail 2.2.0 : Sat 09 Nov 2013 - 06:42:43 EST