Thursday, December 10, 2015

Re: programmatically determine blockwise visual mode



2015-12-10 20:18 GMT+03:00 Christian Brabandt <cblists@256bit.org>:
On Mi, 09 Dez 2015, Bram Moolenaar wrote:

> 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().

Well, I don't understand what the visual selection has in common with
registers or in other words, why should it be the same as getregtype().
Even if we used ^V<width>$ it would be different.

​In common it has type (absent, characterwise, linewise​, blockwise) and width in case of blockwise (what is also common because width applies only to blockwise registers as well). Except that the last one may be "to the end of line", while register is not connected to a buffer and thus cannot have such idea.

 

> And visualmode() has an optional argument to clear the mode, which is
> unrelated.

I don't understand that argument. I introduced an additional argument,
because it is independent of the first optional argument.

> Is there a more consistent solution?

I am open for suggestions.

Best,
Christian

--
--
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.

--
--
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:

Post a Comment