trigger command just prior to save

18 views
Skip to first unread message

Chris Van Vranken

unread,
Sep 23, 2016, 8:26:50 PM9/23/16
to Light Table Discussion
I am trying to trigger a command to format text before saving,  but when I use the on-save behavior it seems to occur after the save since it shows that the file is dirty again.  Is there way a way to make this happen prior to saving the file?

This is the behavior I tried:
[:editor.elm :lt.objs.editor.file/on-save :elm-format-buffer]

Chris Van Vranken

unread,
Sep 23, 2016, 9:33:28 PM9/23/16
to Light Table Discussion
I just found that this works: [:editor.elm "ctrl-s" :save :elm-format :elm.lint] though I don't understand why.

Scott Bauer

unread,
Sep 23, 2016, 9:42:33 PM9/23/16
to Light Table Discussion
Glad to hear you were able to resolve the issue. I noticed this earlier but did not have a chance to respond... this Stack Overflow question that is rather similar.
Reply all
Reply to author
Forward
0 new messages