-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On July 6, 2014 6:27:28 PM GMT+03:00, LCD 47 <[email protected]> wrote: >On 4 July 2014, ZyX <[email protected]> wrote: >> > I agree 100% that it's broken. They still do it. >> > >> > For what it's worth, I had to look at the sources at many of >> > said compilers to get syntastic to understand their output, and >> > using virtual columns isn't *that* far fetched. Most of the time >> > they just expand tabs while parsing and don't bother keeping track >> > of the original offset. When they run into an error they just >> > compute the column number by adding the lengths of the whitespace >> > and the tokens parsed so far. >> > >> > Double width characters is a different story. Some compilers >> > use Unicode codepoints, others byte length, which is, again, >broken. >> > Still, Vim's virtual columns is yet the best approximation of it. >> >> I think the best solution is proposed colnr() function: check out >> [that thread][1]. virtcol to byte offset transformation is useful not >> only for matchaddpos(). > > Yes, a colnr() function would be useful, both in this situation and >by itself. > >> I had to write it in [translit3][2] and that variant is rather >> slow. Your proposal will fix matchaddpos() for one given use-case and >> only matchaddpos() and only under very limited conditions. colnr() is >> not so limited. > > I'm afraid you lost me here. I just pointed out a number of (what I >consider to be) problems with the design of matchaddpos(), which I >found >when I actually tried to use the function. I never attempetd to >suggest >any solutions. > > Your colnr() might be, IMO, a reasonable solution for one of the >problems I noted. It doesn't address any of the others.
Absence of some colnr() features is not only a matchaddpos() problem. It is helpful for one of matchaddpos() problems you pointed out, but it is not the only scope where this function is useful. Fix to matchaddpos() to accept dictionary with vcol, on the other side, is only useful for matchaddpos(). > >> I say that you are seeking answer in a wrong direction. >> >> [1]: https://groups.google.com/forum/#!topic/vim_dev/2DYfyTuo7G0 >> [2]: >https://sourceforge.net/p/translit3/code/ci/040e92e8021320740109067dbe2fb43e50fbba94/tree/autoload/translit3.vim#l2262 > > /lcd -----BEGIN PGP SIGNATURE----- Version: APG v1.1.1 iQI1BAEBCgAfBQJTuarNGBxaeVggPHp5eC52aW1AZ21haWwuY29tPgAKCRCf3UKj HhHSvh1LD/wN4veq+vWKGR/XlGFqy03o9HEee2Zw807fv8/zBuhvfHFdXoNHb+FV B4ZtaUEeEofrWorr2RxLQQ8Z8N7rHfLyz9zjUbXzCBqF/KPYACKW2sdXYXKi5nTI lNHku1O6ohe3/WzrcXD5/vjiXNNhqIbzU9+Xoq5Kr43MzHphsQAp38CUgcni78Rd qXaOllrN/ep2I6gBKCeQ4xCjvoNBLT8+ef1eci9yaDR7W4ry+DybRpzx2P1n2BNl PwsSS+tDH45hjgr6huCMftYsZJRONM5te7FQRW+GEIhL3fmbeKL3imhCtsZAP+2M 5TwrIzRGyg/9JzUawwDa0W1EJ6BUvL6h57tGb/hV605XU+z5/NdL2mEgpc1BNbtu 7kPSDMKPxJJPD5NcGl2x6Syg7GxUrdXDXUfwrrx9wzEYoz0NsoBgI2QsCVZz7061 qQRBpXkVEVcM1abEA7dMVuF5giN5U86IHW8w0Xd4mdOLY4yLisPgA1m0iFCDHatt ykOtm4sB6N9FTWP9QuFclvL0hyB/j9FyTl72fCduxfZPIR+PaJKrshcbNXslXE4e qgw5g7wH/yryEjidja3RAyWkVc7McUsEKjgz6Y+Gl1/Tenjibyo8LoP1nBhlhBDl cqcYvTOOtB5APUMMn4ZodsPxoT8qWGnGQGwZzfVHcb+mGeza82Vchw== =D961 -----END PGP SIGNATURE----- -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
