Thursday, October 2, 2014

Re: silent+redraw E749: Empty buffer

On Thursday, October 2, 2014 8:26:27 PM UTC-5, dza wrote:
> Hello.I have a simple combination of silent/redraw
>
> command! -nargs=1 Silent
> \ | exe 'silent !'.<q-args>
> \ | execute ':redraw!'
>
> If I put
> exe 'silent !'.<q-args> | exe ':redraw!'
>
> Manually it works fine.
>
> But if I run the command I created in an empty buffer I get:
>
> E749: Empty buffer.
>
> What is the explanation behind that ? Does silent/redraw require buffer input somehow ?
>

When I try sourcing the script as written, I get errors, because of the first '|' which is not only unnecessary but actually incorrect.

When I remove that character and try the command, on either an empty buffer or a file buffer, I see it working just fine without errors.

Note you can also just use redraw! instead of exe ":redraw!".

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: