X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/24c7594d62d8d7fbbcdb64b11ce4adc5d8e6991a..3d3e182ac0c5c2f91a90771b79b5c221102f9635:/atom/packages/vim-mode/lib/vim-mode.coffee diff --git a/atom/packages/vim-mode/lib/vim-mode.coffee b/atom/packages/vim-mode/lib/vim-mode.coffee index 660fba0..b8ef936 100644 --- a/atom/packages/vim-mode/lib/vim-mode.coffee +++ b/atom/packages/vim-mode/lib/vim-mode.coffee @@ -16,7 +16,7 @@ module.exports = @vimStatesByEditor = new WeakMap @disposables.add atom.workspace.observeTextEditors (editor) => - return if editor.isMini() or @vimStatesByEditor.get(editor) + return if editor.isMini() or @getEditorState(editor) vimState = new VimState( atom.views.getView(editor), @@ -28,6 +28,8 @@ module.exports = @vimStatesByEditor.set(editor, vimState) vimState.onDidDestroy => @vimStates.delete(vimState) + @disposables.add atom.workspace.onDidChangeActivePaneItem @updateToPaneItem.bind(this) + @disposables.add new Disposable => @vimStates.forEach (vimState) -> vimState.destroy() @@ -46,6 +48,13 @@ module.exports = @disposables.add new Disposable => @statusBarManager.detach() + updateToPaneItem: (item) -> + vimState = @getEditorState(item) if item? + if vimState? + vimState.updateStatusBar() + else + @statusBarManager.hide() + provideVimMode: -> getGlobalState: @getGlobalState.bind(this) getEditorState: @getEditorState.bind(this)