Re: Inconsistent behavior at end of .vim script
On Thursday, October 13, 2016 at 10:38:34 AM UTC-7, Frank Shute wrote: > Hi Graham, > > What you might want to do is use echom rather than plain echo. > > The former sticks it's output into the message buffer and you can then > read it with: > > :mes > > HTH. > snip > > Frank Thank you Frank, that does indeed do the job, but even better, it got me to read :h :echom, which led to 'echo-redraw', to force any pending redraw before issuing an :echo. This is preferable as it gets the definition alone, without all the other messages. You can't take anything for granted in vim, I never thought to look in the help for :echo, what could possibly be more straightforward. -- -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Inconsistent behavior at end of .vim script
Hi Graham, What you might want to do is use echom rather than plain echo. The former sticks it's output into the message buffer and you can then read it with: :mes HTH. On 12 October 2016 at 17:53, Graham Lawrence wrote: > I have written a .vim script that does one of a number of possibilites to > the word at the cursor. If this word is alphabetic the script retrieves a > definition for its root word into @m, which it echoes as its last command. > Run under :debug the script does exactly as expected, but run independently > it returns either nothing (apparently), or 3 messages at the foot of the > screen, being > > "file-name" \d\+L, \d\+C > the definition found, or that none was found > Press ENTER or type command to continue > > the last item being in slightly greenish type, and if one does then press > Enter, all 3 messages promptly disappear. So I assume what is happening > when nothing shows is that the script itself, or the system, in some way > presses Enter automatically. > > The behavior is consistent: the word 'styles' always returns the 3 line > display with the definition for 'style'; the word 'peduncles' always > apparently returns nothing, though the definition for 'peduncle' is duly > present in @m. > > I tried starting the script with ':redraw|set lz', but to no effect > > Is there any method that will prevent the screen being redrawn, or, better, > redraw the screen and then do 'echo @m'? > > > -- > Graham Lawrence > > -- > -- > 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+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Frank -- -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Inconsistent behavior at end of .vim script
I have written a .vim script that does one of a number of possibilites to the word at the cursor. If this word is alphabetic the script retrieves a definition for its root word into @m, which it echoes as its last command. Run under :debug the script does exactly as expected, but run independently it returns either nothing (apparently), or 3 messages at the foot of the screen, being "file-name" \d\+L, \d\+C the definition found, or that none was found Press ENTER or type command to continue the last item being in slightly greenish type, and if one does then press Enter, all 3 messages promptly disappear. So I assume what is happening when nothing shows is that the script itself, or the system, in some way presses Enter automatically. The behavior is consistent: the word 'styles' always returns the 3 line display with the definition for 'style'; the word 'peduncles' always apparently returns nothing, though the definition for 'peduncle' is duly present in @m. I tried starting the script with ':redraw|set lz', but to no effect Is there any method that will prevent the screen being redrawn, or, better, redraw the screen and then do 'echo @m'? -- Graham Lawrence -- -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.