beacon.nvim icon indicating copy to clipboard operation
beacon.nvim copied to clipboard

Beacon does not play nice with 'nvim -d' (diffing).

Open bluz71 opened this issue 3 years ago • 3 comments

Steps to reproduce:

  • Create two files (a and b) and change b slightly (say add an extra line), make sure a and b have at least 20 lines, more the better

  • With Beacon disabled do nvim -d a b (all good, notice that folding is being done correctly)

  • With Beacon enabled do nvim -d a b (folding is no longer happening, and too much highlighting).

Screenshots:

Working (Beacon disabled):

Diff_Working

Failing (Beacon enabled):

Diff_Failing

Since I use Neovim for git diffing this is a showstopping issue preventing me from adopting Beacon. However, I would love to use Beacon since it, from my testing, is a nice productivity improvement.

Hopefully it is an easy fix. Heck, I would be fine if Beacon was entirely disabled in diff-mode, but enabled in normal editing mode.

Thanks.

bluz71 avatar Jul 08 '20 05:07 bluz71

Thanks for feedback :) I'll look into it.

DanilaMihailov avatar Jul 09 '20 12:07 DanilaMihailov

I used this as a hacky workaround if it helps anyone else.

if !&diff
  Plug 'danilamihailov/beacon.nvim'
endif

dpendolino avatar Dec 06 '20 20:12 dpendolino

I used this as a hacky workaround if it helps anyone else.

if !&diff
  Plug 'danilamihailov/beacon.nvim'
endif

There is another method which still loads the plugin. My beacon settings are

let g:beacon_enable = 0
autocmd VimEnter * if !&diff | let g:beacon_enable = 1 | endif
nmap <silent> <space> :Beacon<CR>

The beacon is disabled at the start of nvim and gets enabled at the VimEnter event if nvim was not started in diff-mode. Note that command :Beacon still works even in diff-mode.

lyokha avatar Oct 14 '22 10:10 lyokha