Wednesday, December 9, 2015

Re: programmatically determine blockwise visual mode

Christian Brabandt wrote:

> On Mo, 07 Dez 2015, Nikolay Aleksandrovich Pavlov wrote:
>
> > I have mistaken `visualmode()` output with `getregtype()` output. This
> > suggestion could be a solution if `visualmode()` returned the same
> > answer as `getregtype()`.
> >=20
> > I am wondering thus whether it make sense to have `visualmode(0, 1)`
> > output for block visual mode the same thing as `getregtype()` for
> > blockwise registers, but with possible `$` after the number. Modifying
> > `col()` to return some seeming arbitrary very big number looks weird.
>
> Like this?
>
> I am not sure, how useful it is to have the width without also having
> the height, but I made it return the visual width unless '$' has been
> used.

I find this confusing, because now it's not the same as getregtype().
And visualmode() has an optional argument to clear the mode, which is
unrelated.

Is there a more consistent solution?


--
Your fault: core dumped

/// Bram Moolenaar -- Bram@Moolenaar.net -- 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_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: