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

bug: The highlighting is inconsistent between vscode and nvim #1630

Open
3 tasks done
xiyaowong opened this issue Nov 17, 2023 · 2 comments
Open
3 tasks done

bug: The highlighting is inconsistent between vscode and nvim #1630

xiyaowong opened this issue Nov 17, 2023 · 2 comments
Labels
bug Something isn't working category: sync synchronization between vscode and nvim (text, windows, etc) category: visual related to highlights, selections, etc

Comments

@xiyaowong
Copy link
Collaborator

xiyaowong commented Nov 17, 2023

Did you check docs and existing issues?

  • I have read all the vscode-neovim docs
  • I have searched the existing issues of vscode-neovim
  • I can reproduce the issue with an empty init.vim/init.lua and no other vscode extensions (when applicable)

Neovim version (nvim -v)

0.9.4

Operating system/version

window 11

Describe the bug

I have noticed this issue while using flash.nvim.

VSCode vs NeoVim

Pressing "l" jumps to position "r", while pressing "r" jumps to position "l".

Steps To Reproduce

Install flash.nvim

  1. Open file
    
    
    world0
    world1
    world2
    world3
    world3
    world4
    world5
    world6
    world7
    world8
    world9
    worlda
    
  2. type gg0/world

Expected Behavior

Highlighting is consistent with nvim.

@xiyaowong xiyaowong added the bug Something isn't working label Nov 17, 2023
@xiyaowong xiyaowong changed the title bug: The highlighting is inconsistent between Neovim and nvim. bug: The highlighting is inconsistent between vscode and nvim Nov 17, 2023
@xiyaowong
Copy link
Collaborator Author

Debugging found that the grid_line event contained incorrect data. It seems to be a problem with nvim?

image

test patch

--- a/src/highlight_manager.ts
+++ b/src/highlight_manager.ts
@@ -70,6 +70,13 @@ export class HighlightManager implements Disposable {
                         }
                         const lineText = editor.document.lineAt(highlightLine).text;
                         let vimCol = col + gridOffset.character;
+                        console.log(
+                            highlightLine,
+                            lineText,
+                            cells.reduce((p, n) => {
+                                return p + n[0].repeat(n[2] ?? 1);
+                            }, ""),
+                        );
 
                         // remove cells from statuscolumn
                         if (vimCol < 20) {

@justinmk
Copy link
Collaborator

seems to be a problem with nvim?

try latest Nvim development version

@justinmk justinmk added category: visual related to highlights, selections, etc category: sync synchronization between vscode and nvim (text, windows, etc) labels Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: sync synchronization between vscode and nvim (text, windows, etc) category: visual related to highlights, selections, etc
Projects
None yet
Development

No branches or pull requests

2 participants