mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Adds configuration option for large file warning threshold.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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?"
|
||||
|
||||
Reference in New Issue
Block a user