Hi, On Wed, Dec 5, 2018 at 12:50 PM Bram Moolenaar <[email protected]> wrote: > > > The help for vcol says: > > > > > vcol |TRUE|: "col" is visual column > > > |FALSE|: "col" is byte index > > You mean the help for getqflist() and setqflist(). > > > But it appears to only handle tab characters: > > https://github.com/vim/vim/blob/b513d3079bbe3f59a1f1a3d6931939a76cd7e54a/src/quickfix.c#L3100-L3120 > > That's a weird loop, doesn't handle multi-byte characters at all. > Relies on a TAB not being part of a multi-byte character. > If it would consider multi-byte characters it could probably use > coladvance() (except that perhaps tabs must always be counted as eight > characters). >
I normally don't use multi-byte characters. So I am not sure how to address this issue. Regards, Yegappan > > > Either the help (and internal documentation) should be clearer on > > this, or it should be changed to actually handle also multibyte > > characters. > > > > I've found that e.g. ALE does this manually already, so in this case > > it would not be backward compatible, but ALE could check the patch > > number of course: > > https://github.com/w0rp/ale/blob/0a384a49d371838903d8401c5358ec60f3f4266d/autoload/ale/engine.vim#L444-L449 > > > > After all "vcol" in ALE appears to be "mis-used", but it would > > certainly be helpful if there was a way to handle quickfix entries > > that refer to char offsets instead of bytes more easily, and it > > appears that vcol could be extended to support this. > > I don't know if ALE matters, but we should be able to handle what > compilers produce. This is the %v item in 'errorformat'. It's > important that this works properly, the rest will follow. > > I suppose this requires a multi-byte aware compiler to start with. > When I try gcc it outputs the byte column, thus that doesn't function as > an example. What other popular compiler actually outputs virtual > columns? > -- -- 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.
