Skip to content

Inconsistent result of popup window between Vim and Neovim #274

Closed
@lambdalisue

Description

@lambdalisue

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions