`:source` command does not skip `if 0`

24 views
Skip to first unread message

wsd...@outlook.com

unread,
Mar 22, 2024, 6:59:30 AM3/22/24
to vim_dev
Hello, I just found a issue with vim.7.4.1689, and this also happened in 8.0.0027.


the vimrc file is:

```
filetype off
set rtp+=build/vader
set rtp+=.
set rtp+=after
set noswapfile
filetype plugin indent on
syntax enable
set nocompatible
```

and the test.vim is:

```
  if 0
     lua spacevim_dict = 1
  else
    echo 'skip lua test'
  endif
```

run command: `vim -Nu vimrc test.vim` and `:so %`. I get error like:

```
处理 C:\Users\wsdjeg\Desktop\test.vim 时发生错误:
第    3 行:
E370: 无法加载库 lua53.dll
Lua library cannot be loaded.
```

Christian Brabandt

unread,
Mar 22, 2024, 7:08:29 AM3/22/24
to vim...@googlegroups.com
I cannot reproduce with latest version. gvim 8.0.0027 is from 2016, I
guess it has been fixed in the meantime.

Thanks,
Christian
--
Don't ever slam a door; you might want to go back.

Eric Wong

unread,
Mar 22, 2024, 7:37:31 AM3/22/24
to vim_dev
Yeah, I also can not reproduce it in latest version, but for some reason I need to use vim74 or vim8 in old windows PC. is there any workaround ti skip this error?


--------------

Eric Wong

>

>

>>

>>

>> the vimrc file is:

>>

>> ```

>>

>> filetype off

>> set rtp+=build/vader

>> set rtp+=.

>> set rtp+=after

>> set noswapfile

>> filetype plugin indent on

>> syntax enable

>> set nocompatible

>>

>> ```

>>

>> and the test.vim is:

>>

>> ```

>>

>>   if 0

>>      lua spacevim_dict = 1

>>   else

>>     echo 'skip lua test'

>>   endif

>>

>> ```

>>

>>

>> ```

>> 第    3 行:

>> E370: 无法加载库 lua53.dll

>> ```

>

>

>Thanks,

>Christian

>--

>

>--

>--

>You received this message from the "vim_dev" maillist.

>Do not top-post! Type your reply below the text you are replying to.

>For more information, visit http://www.vim.org/maillist.php

>

>---

>You received this message because you are subscribed to the Google Groups "vim_dev" group.

>To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.

>To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/Zf1mqIJhk45wutdM%40256bit.org.


Christian Brabandt

unread,
Mar 22, 2024, 7:54:36 AM3/22/24
to vim...@googlegroups.com

On Fr, 22 Mär 2024, Eric Wong wrote:

> Yeah, I also can not reproduce it in latest version, but for some
> reason I need to use vim74 or vim8 in old windows PC. is there any
> workaround ti skip this error?
>
> Eric Wong

Try to wrap it into an exe call:
```
if 0
exe ":lua spacevi_dict=1"
endif
```

Or add an explicit finish before the lua line:
```
if !has('lua') " or whatever condition
finish
endif
lua spacevi_dict=1
```

Thanks,
Christian
--
"Wish not to seem, but to be, the best."
-- Aeschylus

Eric Wong

unread,
Mar 22, 2024, 8:19:58 AM3/22/24
to vim_dev
Ok, thank you, it works well for me.


--------------

Eric Wong

Reply all
Reply to author
Forward
0 new messages