Merge pull request #12439 from remexre/master

Adds configuration option for large file warning threshold.
This commit is contained in:
Wliu
2016-08-18 17:32:36 -04:00
committed by GitHub
3 changed files with 33 additions and 14 deletions

View File

@@ -122,6 +122,10 @@ module.exports =
{value: 'no', description: 'Do not send any telemetry data'}
{value: 'undecided', description: 'Undecided (Atom will ask again next time it is launched)'}
]
warnOnLargeFileLimit:
description: 'Warn before opening files larger than this number of megabytes.'
type: 'number'
default: 20
editor:
type: 'object'
properties:

View File

@@ -550,7 +550,7 @@ class Workspace extends Model
fileSize = fs.getSizeSync(filePath)
largeFileMode = fileSize >= 2 * 1048576 # 2MB
if fileSize >= 20 * 1048576 # 20MB
if fileSize >= @config.get('core.warnOnLargeFileLimit') * 1048576 # 20MB by default
choice = @applicationDelegate.confirm
message: 'Atom will be unresponsive during the loading of very large files.'
detailedMessage: "Do you still want to load this file?"