Skip to content

Commit 93aa28c

Browse files
committed
Revert "fix ocaml#553"
This reverts commit 7efcb22. The problem reported in ocaml#553 is not reproducible when this commit is reverted, so it's likely that the underlying Neovim bug that caused it has been resolved. The fix introduces a problem where the window is scrolled (ocaml#1221), so this commit reverts it.
1 parent 3efbdc2 commit 93aa28c

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ git version
1010
- handle `=` syntax in compiler flags (#1409)
1111
+ editor modes
1212
- update quick setup instructions for emacs (#1380, @ScriptDevil)
13+
- fix an issue in Neovim where the current line jumps to the top of the
14+
window on repeated calls to `MerlinTypeOf` (#1433 by @ddickstein, fixes
15+
#1221)
1316
+ test suite
1417
- make `merlin-wrapper` create a default `.merlin` file only when there is
1518
no `dune-project` to let tests use `dune ocaml-merlin` reader. (#1425)

vim/merlin/autoload/merlin.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function! s:ShowTypeEnclosing(type)
237237

238238
let g:merlin_latest_type = a:type['type']
239239

240-
if g:merlin_type_history_height <= 0 || (!has("nvim") && (v:version <= 703 || !has("patch-7.4.424")))
240+
if g:merlin_type_history_height <= 0 || v:version <= 703 || !has("patch-7.4.424")
241241
echo a:type['type'] . a:type['tail_info']
242242
return
243243
endif

vim/merlin/autoload/merlin_type.vim

+1-10
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@ function! s:RecordType(type)
6464

6565
" vimscript can't append to a buffer without a refresh (?!)
6666
MerlinPy << EOF
67-
68-
# Vim cursor is a global state that will leak.
69-
# Nvim will complain the cursor is outside of buffer (using cursor from
70-
# current buffer in the type buffer).
71-
# So put it to origin and restore it later.
72-
cw = vim.current.window
73-
cursor = cw.cursor
74-
cw.cursor = (1,0)
75-
7667
idx = int(vim.eval("g:merlin_type_history"))
7768
typ = vim.eval("a:type")
7869
buf = None
@@ -95,7 +86,7 @@ else:
9586

9687
# Note that this leaves a blank line at the beginning of the buffer, but
9788
# it is apparently the desired behavior.
98-
cw.cursor = cursor
89+
9990
EOF
10091

10192
call winrestview(l:view)

0 commit comments

Comments
 (0)