Manuel Ortega wrote:

> I'm seeing some screen rendering problems with the new execute()
> function.
> 
> To reproduce:
> 
> vim -u NONE -N somenonemptyfile
> :echo execute("!ls")
> 
> I expect: the same thing that "redir=>h | !ls |redir END | echo h"
> shows, i.e., ":!ls", except without a HIT ENTER prompt.
> 
> I see: ":!ls" and a HIT ENTER prompt, followed by (if I indeed hit
> enter) a garbled screen that is only fixable by ":redraw!"
> 
> Note that I'm much more concerned about the garbled screen than the HIT
> ENTER (though I don't see why that's there when using execute()). And
> "ls" is just an example; I know full well that if I really wanted the
> dir contents this is the wrong way to do it.
> 
> The docs say that execute() is the equivalent of "cmd" sandwiched by a
> manual redir operation.  But the cmd "!ls" sandwiched by a redir
> operation doesn't result in a garbled screen.
> 
> I observe this in both the console version and MacVim.

Keep in mind that by default execute() works silently.  But an external
command will still output text.  This is the same as with redir:

        redir => output
        silent !ls
        redir END
        echo output

This also messes up the screen.  This is explained at ":help :silent"
I'll add a hint at the help for execute().  Especially that for an
external command system() should be used.

-- 
hundred-and-one symptoms of being an internet addict:
258. When you want to see your girlfriend, you surf to her homepage.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui