Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diffunitsyntax plugin on vim-signify #415

Open
rickhowe opened this issue Oct 23, 2024 · 0 comments
Open

diffunitsyntax plugin on vim-signify #415

rickhowe opened this issue Oct 23, 2024 · 0 comments

Comments

@rickhowe
Copy link

Hi,

I have recently posted a diffunitsyntax plugin which highlights word or character based diff units in diff format.

I tried to check if the plugin works on vim-signify. In vim, it works fine with :SignifyHunkDiff command like this:
vim91

But in nvim, it does not:
nvim102

I found, in sy#util#popup_create(), that the lines are populated and then the &syntax option is set with 'diff' in vim. But in nvim, the order is reversed. When my plugin is triggered, the buffer is still empty. That is why no diff unit is highlighted in nvim.

Could I ask you to change the order like this?

--- util.vim	Tue Sep 17 11:10:44 2024
+++ util0.vim	Wed Oct 23 11:12:09 2024
@@ -164,8 +164,8 @@
   if exists('*nvim_open_win')
     call sy#util#popup_close()
     let buf = nvim_create_buf(0, 1)
-    call nvim_buf_set_option(buf, 'syntax', 'diff')
     call nvim_buf_set_lines(buf, 0, -1, 0, map(a:hunkdiff, 'v:val[0].padding.v:val[1:]'))
+    call nvim_buf_set_option(buf, 'syntax', 'diff')
     let s:popup_window = nvim_open_win(buf, v:false, {
           \ 'relative': 'win',
           \ 'row': winline,

As a side note, my another plugin, diffchar.vim, works fine on vimdiff invoked by :SignifyDiff command:
sdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant