Friday, December 13, 2013

Re: getline(-1) returns 0

Hi mvxxc!

On Fr, 13 Dez 2013, mvxxc@gmx.de wrote:

> Can someone explain the following behavior?
>
> The command
>
> :echo getline(-1)
>
> returns zero instead of an empty string. The corresponding help page
> states the following.

I think, what you are seeing is some kind of error handling. When using
the getline() function and an unexpected condition happens (e.g. a
negative line number occurs), the function returns early, without
setting the return value to the empty string.

Best,
Christian
--
Was wir am nötigsten brauchen, ist ein Mensch, der uns zwingt, das zu
tun, das wir können.
-- Ralph Waldo Emerson

--
--
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/groups/opt_out.

No comments:

Post a Comment