Am 20.02.2010 07:30, schrieb KKde:
Hi folks,
I'm seeing a strange behaviour of normal comand.
Let's say I have the below function.
function! NormalNTest()
let saveCursor = getpos('.')
"call setpos([0, 1, 1, 0 ] )
normal gg
call setpos('.', saveCursor)
echohl Special | echon "hi" |echohl None
echon ' vim_use'
endfunc
now I defined a map like
map ,vi :call NormalNTest()<CR>
Let say I opened some text file and run map ,vi. It displays "hi
vim_use". Now I move the cursor in my text file using any motion
commands. Let's say, I moved forward to the next page then I ran
map ,vi. It doesn't display the output :( . Again if I ran map ,vi at
the same location it will show.
When the output isn't displayed the screen slightly flickers. If I
replace the normal gg statement with call setpos([0, 1, 1, 0 ] ) then
it works fine without any problems.
Why with normal gg it isn't working as expected?
Regards,
Kkde
When you move around in the buffer, the command-line area may be cleared.
Try prepending the first :echo command with a
:redraw
--
Andy
Don't worry, unlike :redraw!, :redraw doesn't flicker.
--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php