X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/24c7594d62d8d7fbbcdb64b11ce4adc5d8e6991a..e356a1171afc6a08a6dc1e75cea242a76b8dd2e1:/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)