Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make #vimwiki#make_random_chars compatible to Vim 8.1 #83

Closed
wants to merge 1 commit into from

Conversation

bwildenhain
Copy link
Contributor

Adapted vimwiki.vim to work without srand (i.e. version prior to 8.1.2342).

Fixes #81

@NMme
Copy link

NMme commented Nov 13, 2020

Hi, conditioning the version is a good start, but copy-pasting the nvim make_random_chars() into it causes many errors as luaeval() etc. is not compatible with normal vim. So this code still produces errors for normal vim-version (<802).
I think there needs to be a completely new function only utilizing alternative possibilites to create random chars,
e.g. this example.

Further I found there is a disclaimer in the docu already, noting that make_random_char() requires vim version 8.1.2342
However whenever vimwiki.vim is called (e.g normal zettel-creation) without even using this mode the function still gets defined and generates a lot of error prompts.
Maybe the whole make_random_char() functionality should just be made dependable on the version to not confuse users with these error prompts.

@bwildenhain
Copy link
Contributor Author

bwildenhain commented Nov 14, 2020

Hi, conditioning the version is a good start, but copy-pasting the nvim make_random_chars() into it causes many errors as luaeval() etc. is not compatible with normal vim. So this code still produces errors for normal vim-version (<802).

I didn't simply copy-paste the nvim-code, but adapted it slightly, so it works in vim compiled with lua-support without any errors (packages vim-nox or vim-gtk3 in Debian), but of course, it would be better to have code which is compatible with lua-less vim.

@NMme
Copy link

NMme commented Nov 14, 2020

I see, thank you for clarifying!

@bwildenhain
Copy link
Contributor Author

I created PR #84 without depending on lua.

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.

make_random_chars-function not working with current Vim-Version from the official Ubuntu (20.04) package repo
2 participants