vim-easymotion icon indicating copy to clipboard operation
vim-easymotion copied to clipboard

EasyMotion#is_active gives wrong result

Open chemzqm opened this issue 7 years ago • 1 comments

I have this in my node code:

    setInterval(async () => {
      let active = await this.nvim.call('EasyMotion#is_active')
      logger.debug('active:', active)
    }, 300)
18-10-04T17:27:11.865 DEBUG (pid:58844) [workspace] - active: 0
2018-10-04T17:27:11.865 DEBUG (pid:58844) [workspace] - active: 0
2018-10-04T17:27:11.865 DEBUG (pid:58844) [workspace] - active: 0
2018-10-04T17:27:11.865 DEBUG (pid:58844) [workspace] - active: 0
2018-10-04T17:27:11.899 DEBUG (pid:58844) [events] - Autocmd: CursorMoved [ 1 ]
2018-10-04T17:27:11.899 DEBUG (pid:58844) [events] - Autocmd: TextChanged [ 1 ]
2018-10-04T17:27:11.902 DEBUG (pid:58844) [workspace] - active: 1
2018-10-04T17:27:11.902 DEBUG (pid:58844) [workspace] - active: 1
2018-10-04T17:27:12.203 DEBUG (pid:58844) [workspace] - active: 1

The active would be 0 when start selecting jump position, and 1 after a position selected. Don't know if this is intended, but current behavior makes it it impossible for other plugin to skip emit buffer change event when the buffer change was caused by easymotion.

chemzqm avatar Oct 04 '18 09:10 chemzqm

This would be resolved if there's a global variable indicate that easymotion is changing the buffer or not, the call of EasyMotion#is_active could be slow since it would source the vim file.

chemzqm avatar Oct 07 '18 20:10 chemzqm