Open pgalkin opened 5 years ago
👋 Thanks for the bug report! I'll take a look at this later tonight and see what I find. In the mean time, I can't reproduce with these steps:
test.sml
file exists.vim test.sml
:w
to create the file:SMLReplStart
REPL buffer opens with these contents:
val _ = use "test.sml";
Standard ML of New Jersey v110.84 [built: Fri Sep 28 19:40:37 2018]
- [opening test.sml]
-
I only get use "SMLNJ"
when my cursor is in an already created REPL buffer and I run :SMLReplStart
. The various :SML...
commands are meant to be run from an SML file.
Interesting. I tried to disable all plugins except this one and the issue was still present. Then I copied your settings and it solved the issue, although it still does val _ = use "test.sml";
twice. I wonder what this magical option is that changes behavior in this way.
In any case it seems to be fragile and it would be good to find a way to perform this initial use
more reliably.
Hi, I'm also seeing the same issue with :SMLReplStart
.
I'm using the .vimrc
created from your vim-as-an-ide
workshop. The one I'm using is at https://github.com/pbashyal-nmdp/dotfiles/blob/master/vimrc
I'm using the following version of neovim:
$ nvim --version
NVIM v0.3.8
Build type: Release
LuaJIT 2.0.5
Incidentally, the key bindings don't work for me as well. It just goes into insert mode when I do \is
I am encountering the same issue when I use :SMLReplStart
. This is the output I see following the steps in https://github.com/jez/vim-better-sml/issues/12#issuecomment-451527362
val _ = use "SMLNJ";
Standard ML of New Jersey (64-bit) v110.99.1 [built: Mon Apr 12 18:45:14 2021]
- [use failed: SMLNJ' does not exist or is unreadable]
-
After that, using :SMLReplBuild
on the empty test.sml
buffer runs Repo correctly
val _ = use "test.sml";
- [opening test.sml]
-
what worked for me was
:set splitbelow
:set splitright
Forcing the new window to appear as B (to the bottom or the right) fixed it for me. I believe Repl is trying to open itself if its the main window (A)
Suppose I'm editing the file
test.sml
and decide to launch REPL. I call:SMLReplStart
and it works but does this:I think the problem is in bettersml#repl#ReplUse().
expand('%')
evaluates to"SMLNJ"
because it is the name of the opened buffer which contains the REPL. There has to be a way to find out the name of the buffer that invoked the REPL, so that we douse "test.sml";
. It should also happen only once, I don't know why it seems to require"SMLNJ"
twice.I'm using neovim 0.3.2 and don't have anything special in my init.vim. Healthcheck results: