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

Inconsistent result of popup window between Vim and Neovim #274

Closed
lambdalisue opened this issue Nov 11, 2024 · 0 comments · Fixed by #275
Closed

Inconsistent result of popup window between Vim and Neovim #274

lambdalisue opened this issue Nov 11, 2024 · 0 comments · Fixed by #275
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@lambdalisue
Copy link
Member

lambdalisue commented Nov 11, 2024

Describe the bug

It seems popup.open place floating window on Neovim in wrong place.

It seems Vim's col/row starts from 1 but Neovim starts from 0. We should consider the col/row starts from 1 in both case (I'm not sure. We need to make sure this before fix.)

Provide a minimal vimrc with less than 50 lines to reproduce

set nonumber
set signcolumn=no

" Optional
set showtabline=0

call denops#request('whateverdenopsplugin', 'popup', [])
import type { Entrypoint } from "jsr:@denops/std@^7.0.0";
import * as popup from "jsr:@denops/std@^7.0.0/popup";

export const main: Entrypoint = (denops) => {
  denops.dispatcher = {
    async popup() {
      await popup.open(denops, {
        relative: "editor",
        width: 3,
        height: 3,
        col: 5,
        row: 5,
        highlight: {
          normal: "IncSearch",
        },
      });

      await popup.open(denops, {
        relative: "editor",
        width: 3,
        height: 3,
        col: 10,
        row: 5,
        border: "single",
        highlight: {
          normal: "IncSearch",
        },
      });
    },
  };
};

How to reproduce the problem from Vim startup

:source test.vim

Expected behavior

Both Vim and Neovim place window in same location.

Actual behavior

It seems Neovim put floating window in invalid location.

Screenshots (if need)

Your environment

  • OS: uname -a (macOS/Linux) or ver (Windows)
  • Deno version: deno --version
  • Vim/Neovim version: vim --version or nvim --version
  • Denops version: git log -1 (run in the denops.vim repository)

Additional context

CleanShot 2024-11-12 at 00 51 49

CleanShot 2024-11-12 at 00 56 42

CleanShot 2024-11-12 at 00 51 22

CleanShot 2024-11-12 at 00 57 16

Files

12345678901234567890123456789
2        1         2
3
4
5
6
7
8
9
10
11
12
13
14
15
@lambdalisue lambdalisue added the bug Something isn't working label Nov 11, 2024
@lambdalisue lambdalisue added the good first issue Good for newcomers label Nov 11, 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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant