Skip to content

Fix error in :WikiPageRename#169

Merged
lervag merged 1 commit intolervag:masterfrom
digital-carver:rename_bufnr_fix
Jul 9, 2021
Merged

Fix error in :WikiPageRename#169
lervag merged 1 commit intolervag:masterfrom
digital-carver:rename_bufnr_fix

Conversation

@digital-carver
Copy link
Copy Markdown
Contributor

Trying to run :WikiPageRename asks the confirmation prompt and then the new name, but errors out after that:


Error detected while processing function wiki#page#rename_ask[11]..wiki#page#rename:
line   64:
E119: Not enough arguments for function: bufnr
E15: Invalid expression: bufnr()
Press ENTER or type command to continue

I believe the problem is the empty call to bufnr() at lines 102 and 118 of autoload/wiki/page.vim. Changing those to bufnr('') (like in scratch.vim) fixes the issue.

Trying to run `:WikiPageRename` asks the confirmation prompt and then the new name, but errors out after that: 
```

Error detected while processing function wiki#page#rename_ask[11]..wiki#page#rename:
line   64:
E119: Not enough arguments for function: bufnr
E15: Invalid expression: bufnr()
Press ENTER or type command to continue

```

I believe the problem is the empty call to `bufnr()` at lines 102 and 118 of ` autoload/wiki/page.vim `. Changing those to `bufnr('')` (like in scratch.vim) fixes the issue.
@lervag
Copy link
Copy Markdown
Owner

lervag commented Jul 9, 2021

I'm curious; which version of Vim are you on? On my end, this fix is not necessary. I use Vim 8.2 and neovim 0.5.

@lervag lervag merged commit 871e55e into lervag:master Jul 9, 2021
@lervag
Copy link
Copy Markdown
Owner

lervag commented Jul 9, 2021

I'm merging as I don't see a reason why not, but I'm still curious :)

@digital-carver
Copy link
Copy Markdown
Contributor Author

I'm curious; which version of Vim are you on? On my end, this fix is not necessary. I use Vim 8.2 and neovim 0.5.

Ah, I did not realize it was a version-dependent issue. I was on Vim 8.0.1568, which seems to be the latest version in my distro's official repository. I've found a different repo with more recent updates though, and am updating to Vim 8.2 right now. Thanks for indulging your curiosity and prompting this update. :)

@lervag
Copy link
Copy Markdown
Owner

lervag commented Jul 10, 2021

I guess there's been a change to the bufnr() function since Vim 8.0, then. And no problem; I usually recommend people to try and use the latest versions of Vim (or neovim). Updates are usually improvements.

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.

2 participants