From b8296ee001f645a89f38b83a017a36f78a9385c1 Mon Sep 17 00:00:00 2001 From: Maxim Krivchikov Date: Sat, 13 Dec 2014 10:01:28 +0300 Subject: [PATCH] [RFC] Defer vim-state.coffee loading I was wondering is it acceptable to defer vim-state.coffee loading until the first text editor is created? On my machine with this change vim-mode loading time goes from ~100ms down to ~15ms. On the other hand, this change will slow down first text editor opening a bit. Change was proposed by @lee-dohm in atom/atom#2654 --- lib/vim-mode.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vim-mode.coffee b/lib/vim-mode.coffee index 344a0fcf..f6fe3c7f 100644 --- a/lib/vim-mode.coffee +++ b/lib/vim-mode.coffee @@ -1,7 +1,7 @@ {Disposable, CompositeDisposable} = require 'event-kit' StatusBarManager = require './status-bar-manager' GlobalVimState = require './global-vim-state' -VimState = require './vim-state' +VimState = null module.exports = config: @@ -20,6 +20,7 @@ module.exports = @disposables.add statusBarManager.initialize() @disposables.add atom.workspace.observeTextEditors (editor) => return if editor.mini + VimState ?= require './vim-state' element = atom.views.getView(editor)