Merge PR #9607 with a small change

This commit is contained in:
Nathan Sobo
2015-11-20 10:41:22 -07:00
4 changed files with 26 additions and 12 deletions

View File

@@ -21,7 +21,6 @@ module.exports =
followSymlinks:
type: 'boolean'
default: true
title: 'Follow symlinks'
description: 'Follow symbolic links when searching files and when opening files with the fuzzy finder.'
disabledPackages:
type: 'array'
@@ -54,7 +53,12 @@ module.exports =
destroyEmptyPanes:
type: 'boolean'
default: true
description: 'When the last item of a pane is removed, remove that pane as well.'
title: 'Remove Empty Panes'
description: 'When the last tab of a pane is closed, remove that pane as well.'
closeEmptyWindows:
type: 'boolean'
default: true
description: 'When a window with no open tabs or panes is given the \'Close Tab\' command, close that window.'
fileEncoding:
description: 'Default character set encoding to use when reading and writing files.'
type: 'string'

View File

@@ -55,7 +55,7 @@ module.exports = ({commandRegistry, commandInstaller, config}) ->
'window:log-deprecation-warnings': -> Grim.logDeprecations()
'window:toggle-auto-indent': -> config.set("editor.autoIndent", not config.get("editor.autoIndent"))
'pane:reopen-closed-item': -> @getModel().reopenItem()
'core:close': -> @getModel().destroyActivePaneItemOrEmptyPane()
'core:close': -> @getModel().closeActivePaneItemOrEmptyPaneOrWindow()
'core:save': -> @getModel().saveActivePaneItem()
'core:save-as': -> @getModel().saveActivePaneItemAs()

View File

@@ -681,9 +681,15 @@ class Workspace extends Model
destroyActivePane: ->
@getActivePane()?.destroy()
# Destroy the active pane item or the active pane if it is empty.
destroyActivePaneItemOrEmptyPane: ->
if @getActivePaneItem()? then @destroyActivePaneItem() else @destroyActivePane()
# Close the active pane item, or the active pane if it is empty,
# or the current window if there is only the empty root pane.
closeActivePaneItemOrEmptyPaneOrWindow: ->
if @getActivePaneItem()?
@destroyActivePaneItem()
else if @getPanes().length > 1
@destroyActivePane()
else if @config.get('core.closeEmptyWindows')
atom.close()
# Increase the editor font size by 1px.
increaseFontSize: ->