mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Merge pull request #10846 from atom/ku-pending-tabs-option
Add core setting for pending tabs configuration
This commit is contained in:
@@ -1532,3 +1532,14 @@ describe "Workspace", ->
|
||||
|
||||
atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow()
|
||||
expect(atom.close).toHaveBeenCalled()
|
||||
|
||||
describe "when the core.allowPendingPaneItems option is falsey", ->
|
||||
it "does not open item with `pending: true` option as pending", ->
|
||||
editor = null
|
||||
atom.config.set('core.allowPendingPaneItems', false)
|
||||
|
||||
waitsForPromise ->
|
||||
atom.workspace.open('sample.js', pending: true).then (o) -> editor = o
|
||||
|
||||
runs ->
|
||||
expect(editor.isPending()).toBeFalsy()
|
||||
|
||||
@@ -108,6 +108,10 @@ module.exports =
|
||||
description: 'Automatically update Atom when a new release is available.'
|
||||
type: 'boolean'
|
||||
default: true
|
||||
allowPendingPaneItems:
|
||||
description: 'Allow items to be previewed without adding them to a pane permanently, such as when single clicking files in the tree view.'
|
||||
type: 'boolean'
|
||||
default: true
|
||||
|
||||
editor:
|
||||
type: 'object'
|
||||
|
||||
@@ -414,6 +414,9 @@ class Workspace extends Model
|
||||
split = options.split
|
||||
uri = @project.resolvePath(uri)
|
||||
|
||||
if not atom.config.get('core.allowPendingPaneItems')
|
||||
options.pending = false
|
||||
|
||||
# Avoid adding URLs as recent documents to work-around this Spotlight crash:
|
||||
# https://github.com/atom/atom/issues/10071
|
||||
if uri? and not url.parse(uri).protocol?
|
||||
|
||||
Reference in New Issue
Block a user