Skip to content

Commit

Permalink
chore(events): add bufnr to InsertEnter event
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Apr 15, 2019
1 parent 6efe803 commit 725070a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugin/coc.vim
Expand Up @@ -163,7 +163,7 @@ function! s:Enable()
autocmd TextChangedP * call s:Autocmd('TextChangedP', +expand('<abuf>'))
autocmd TextChangedI * call s:Autocmd('TextChangedI', +expand('<abuf>'))
autocmd InsertLeave * call s:Autocmd('InsertLeave', +expand('<abuf>'))
autocmd InsertEnter * call s:Autocmd('InsertEnter')
autocmd InsertEnter * call s:Autocmd('InsertEnter', +expand('<abuf>'))
autocmd BufHidden * call s:Autocmd('BufHidden', +expand('<abuf>'))
autocmd BufEnter * call s:Autocmd('BufEnter', +expand('<abuf>'))
autocmd TextChanged * call s:Autocmd('TextChanged', +expand('<abuf>'))
Expand Down
4 changes: 2 additions & 2 deletions src/events.ts
Expand Up @@ -7,10 +7,10 @@ const logger = require('./util/logger')('events')
export type Result = void | Promise<void>

export type BufEvents = 'TextChangedI' | 'BufHidden' | 'BufEnter' | 'TextChanged'
| 'BufWritePost' | 'CursorHold' | 'InsertLeave' | 'TermOpen' | 'TermClose'
| 'BufWritePost' | 'CursorHold' | 'InsertLeave' | 'TermOpen' | 'TermClose' | 'InsertEnter'
| 'BufCreate' | 'BufUnload' | 'BufWritePre' | 'CursorHoldI' | 'TextChangedP' | 'Enter'

export type EmptyEvents = 'InsertEnter' | 'FocusGained'
export type EmptyEvents = 'FocusGained'

export type TaskEvents = 'TaskExit' | 'TaskStderr' | 'TaskStdout'

Expand Down
4 changes: 2 additions & 2 deletions src/handler/index.ts
Expand Up @@ -168,8 +168,8 @@ export default class Handler {
events.on('BufUnload', async bufnr => {
this.clearHighlight(bufnr)
}, null, this.disposables)
events.on('InsertEnter', async () => {
this.clearHighlight(workspace.bufnr)
events.on('InsertEnter', async bufnr => {
this.clearHighlight(bufnr)
}, null, this.disposables)
events.on('CursorMoved', debounce((bufnr: number, cursor: [number, number]) => {
if (!this.preferences.previewAutoClose || !this.hoverPosition) return
Expand Down

0 comments on commit 725070a

Please sign in to comment.