question on setting statusbar

From: Scott Weisman <sweis....at.gmail.com>
Date: Wed, 8 Dec 2010 12:37:23 -0800 (PST)

I have a function to set the statusbar to the filename, and append a
"*" when the file has been modified:

function set_statusbar()
    local buffer = buffer
    if buffer.filename then
        text = buffer.filename
        if buffer.dirty == true then
            text = text .. "*"
        end
        gui.statusbar_text = text
    else
        gui.statusbar_text = 'UNTITLED'
    end
end

events.connect('update_ui', set_statusbar, 1)

This works great until I save a modified file. Until I move the cursor
or do something similar, the "*" remains. I tried adding this:

events.connect('file_after_save', set_statusbar)

But this didn't have any effect. Without a cursor more, or something
like it, the "*" stayed. What can I do to have the statusbar updated
after a file save?
Received on Wed 08 Dec 2010 - 15:37:23 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:55:46 EST