Is there a way to refresh the current file after running a command?

I’ve created a Command that does some post processing of the current file. It calls a batch file, which in turn calls other command line applications.

The post processing step works, and the output is displayed as I expect it to be (in the Command Output window), but the file is not automatically reloaded.

Is there a way to get the current file to update after the command has been executed?

I think what you want is:


You can also enable file change detection; Preferences > Editor: Confirm Dialogs: Detect when files are changed…

That would require user intervention to reload the file though when Komodo alerts you. With @nathanr’s method you should be able to do it automatically in your Command.

  • Carey

Are you referring to a Macro rather than a command? I can’t see anywhere I can add in that line of code :confused:

Assuming you do mean that, I’ve converted it to a macro but it still doesn’t work. I’ve tried adding alerts before and after cmd_refreshStatus and they both trigger, indicating there is no issue with the call to cmd_refreshStatus.

Here’s my code in case it helps

if (komodo.view)
    // Focus the current file

    // Save the file before calling autopep8

    // Execute the python autopep8 module and refresh the current file
        '%(python3) -m autopep8 -i -v --ignore-local-config --max-line-length 100 \"%F\"',
            return function()
                // Focus the current file again
                // Refresh the current file

Looks like this command does what you’re looking for:


That does mean you have to have the desired file active in the editor by the way.


  • Carey

That’s the one! Thanks Carey!