aboutsummaryrefslogtreecommitdiff
path: root/atom/packages/vim-mode/lib/vim-mode.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'atom/packages/vim-mode/lib/vim-mode.coffee')
-rw-r--r--atom/packages/vim-mode/lib/vim-mode.coffee11
1 files changed, 10 insertions, 1 deletions
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)