Sublime Forum

'close' vs 'close_file'

#1

What are the differences between close and close_file?

From the unofficial documentation:

close
Closes the active view.

close_file
Closes the active view and, under certain circumsances, the whole application. XXX Sounds kinda wrong.

I could not determine under which circumstances the whole application would close and I could not locate the source of the commands.

0 Likes

#2

In my simple test, I get a different conclusion.

If there is no opened file,

  • window.run_command('close') closes the window. (if this is the last window, then the app will be closed)
  • window.run_command('close_file') does nothing.

If there is a opened file, they looks like having the same behavior.

2 Likes

#3

Thanks a bunch, that clears it.

0 Likes