Skip to content

Fix for Neovim's CursorMoved semantics#1213

Merged
trefis merged 1 commit intoocaml:masterfrom
ddickstein:patch-1
Dec 7, 2020
Merged

Fix for Neovim's CursorMoved semantics#1213
trefis merged 1 commit intoocaml:masterfrom
ddickstein:patch-1

Conversation

@ddickstein
Copy link
Copy Markdown
Contributor

Neovim's CursorMoved semantics differ from Vim's:

Vim: After the cursor was moved in Normal or Visual mode.
Neovim: After the cursor was moved in Normal or Visual mode or to another window.

Because we do exe l:cur . "wincmd w" after setting up the auto-commands, in Neovim they would fire immediately, causing the type history window to instantly close. This patch defers the auto-command setup until after we've run wincmd w.

Neovim's CursorMoved semantics differ from Vim's:

Vim: After the cursor was moved in Normal or Visual mode.
Neovim: After the cursor was moved in Normal or Visual mode *or to another window*.

Because we do `exe l:cur . "wincmd w"` after setting up the auto-commands, in Neovim they would fire immediately, causing the type history window to instantly close. This patch defers the auto-command setup until after we've run `wincmd w`.
@bfredl
Copy link
Copy Markdown

bfredl commented Dec 5, 2020

Be aware that this can happen in vim 8 as well. Neovim just chooses to be consistent.

@trefis
Copy link
Copy Markdown
Contributor

trefis commented Dec 7, 2020

Thanks!

@trefis trefis merged commit 3dd8eec into ocaml:master Dec 7, 2020
voodoos added a commit to voodoos/merlin that referenced this pull request Apr 13, 2021
Neovim's CursorMoved semantics differ from Vim's:

Vim: After the cursor was moved in Normal or Visual mode.
Neovim: After the cursor was moved in Normal or Visual mode *or to another window*.

Because we do `exe l:cur . "wincmd w"` after setting up the auto-commands, in Neovim they would fire immediately, causing the type history window to instantly close. This patch defers the auto-command setup until after we've run `wincmd w`.
voodoos added a commit to voodoos/merlin that referenced this pull request Apr 13, 2021
Neovim's CursorMoved semantics differ from Vim's:

Vim: After the cursor was moved in Normal or Visual mode.
Neovim: After the cursor was moved in Normal or Visual mode *or to another window*.

Because we do `exe l:cur . "wincmd w"` after setting up the auto-commands, in Neovim they would fire immediately, causing the type history window to instantly close. This patch defers the auto-command setup until after we've run `wincmd w`.
voodoos added a commit to voodoos/opam-repository that referenced this pull request Apr 13, 2021
CHANGES:

Tue Apr 12 11:44:22 AM CET 2021

  + merlin binary
    - external configuration reading:
      + use relative paths to communicate with Dune when possible. This solves
        issues related to symlinks on Unix and improve Windows support (ocaml/merlin#1271,
        fixes ocaml/merlin#1288)
      + make the `workdir` configuration value when using the
        `dune ocaml-merlin` configuration provider the same as when using
        `dot-merlin-reader` so that ppxes behaves in the same way as before
        (ocaml/merlin#1284, fixes ocaml/dune#4479, discussion in ocaml/merlin#1292)
    - destruct:  make the destruct command more resilient to ill-typed
      expressions and when called without nodes (ocaml/merlin#1304, fixes ocaml/merlin#1300)
    - Mppx: don't restore cookies after invocation. Ppx are invoked only once
      so there is no need to manage cookies. This small change should increase
      performance and should not change any other behavior (ocaml/merlin#1309)
    - windows:
      + system command variant: do not open a window console when
        launching a ppx (ocaml/merlin#1270, fixes ocaml/merlin#714)
      + fix Emacs hanging when starting Merlin (ocaml/merlin#1263)
      + fix path canonicalization (ocaml/merlin#1254)
    - fix same file documentation bug (ocaml/merlin#1265 by @ulugbekna, fixes ocaml/merlin#1261)
  + editor modes
    - emacs:
      + modernization of the elisp code and conformance with coding
        guidelines (ocaml/merlin#1247, ocaml/merlin#1310 by Steve Purcell )
      + use opam var where applicable (ocaml/merlin#1310)
      + fix "wrong number of argument" (ocaml/merlin#1250 by @atharvashukla, fixes ocaml/merlin#1234)
      + fix for Neovim's CursorMoved semantics (ocaml/merlin#1213 by @ddickstein)
    - vim & emacs : new client-side "merlin use package" commands, restoring
      previous behavior (ocaml/merlin#1272, fixes ocaml/merlin#1191)
  + test suite
    - cover the document fix (ocaml/merlin#1265, ocaml/merlin#1315)
@ddickstein ddickstein deleted the patch-1 branch January 22, 2022 22:48
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

Successfully merging this pull request may close these issues.

3 participants