Loading ...
Sorry, an error occurred while loading the content.

73023Re: Some TOhtml issues

Expand Messages
  • Nikolay Pavlov
    Sep 3, 2013
    • 0 Attachment


      On Sep 3, 2013 7:04 PM, "Ben Fritz" <fritzophrenic@...> wrote:
      >
      > On Saturday, August 31, 2013 2:24:23 PM UTC-5, ZyX wrote:
      > > 1. When using concealed characters color that extends past the end of line (i.e. diff color) shows different line end positions: http://img-fotki.yandex.ru/get/6704/9151298.3/0_9e202_6394ebc0_orig.png (also attached image 1.png). After inspecting the code it seems that problem is with any multibyte characters, not necessary multibyte character in cchar: script extensively uses things like
      > >
      > >
      > >
      > >       let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new) - s:margin)
      > >
      > >
      > >
      > >    for various fillers. Note the `strlen`: it is not correct to use here, strdisplaywidth() is. Note about strchars(): it is not correct because it counts composing characters separately and does not respect fullwidth characters.
      >
      > Thanks, that should be an easy update. That probably never worked right. I wonder if there are other places where strdisplaywidth() needs to be used instead.
      >
      > > I also have an emulation of strdisplaywidth() (which though works like if there &ambiwidth is set to single regardless of actual setting) for old vim versions: https://bitbucket.org/ZyX_I/frawor/src/c1683934455928961e93466275cedbcae4ea564c/autoload/frawor/table.vim#cl-4.
      > >
      > >
      >
      > I don't think that's needed in this case because I really don't intend to support really old Vims with the official runtime plugin for the latest Vim; but it should at least fail gracefully I suppose.
      >
      > >
      > >     If I set g:html_no_pre it is not better: http://img-fotki.yandex.ru/get/9103/9151298.3/0_9e205_558c48a2_orig.png (1-2.png): highlighting does not extend past the end of line.
      > >
      > >
      > >
      > > 2. With g:html_no_pre=1 empty line does not contain diff highlighting.
      > >
      >
      > Yes, I'd like to figure out a good way to handle this. I really don't want to resort to using a table, though. At least not if I can avoid it. Tables cause huge performance issues in some browsers if they get to be several thousand rows long; and I do on occasion convert entire files this many lines.
      >
      > >
      > >
      > > 3. Sometimes line does not contain highlighting with g:html_no_pre=0: http://img-fotki.yandex.ru/get/9485/9151298.3/0_9e206_c721f0d3_orig.png (3.png): guess this is because it ends with concealed character.
      > >
      > >
      >
      > I haven't noticed this; I'll need to look into that. Thanks for reporting.
      >
      > >
      > > 4. There is a reason for my formatvim using table with one table row per one line, even though it is very imperfect: too tall characters cause shift: http://img-fotki.yandex.ru/get/9264/9151298.3/0_9e208_cb2ab30c_orig.png (4.png). This is not the first tall character here and diff is thus incorrect. Also note thin black gaps between lines.
      > >
      > >
      >
      > I struggled with a similar thin gaps problem for a LONG time before I gave up. As mentioned, I *really* don't want to resort to a table. I would love to find a better solution to that. Please anybody let me know if you have any ideas. Design constraint is that TOhtml (mostly) builds one whole line at a time.

      The problem here is not gaps, they are standable. In fact, I have gaps problem with these characters too, though it is different gaps problem (gap between input with sign or line number and adjacent lines). The real problem is incorrect diff, and this is not. Such characters are uncommon (problem should be observed in case font that browser chose does not have required characters), but e.g. powerline has some. In some fonts characters I use for fold markers are absent (I use unicode black triangles: BLACK RIGHT-POINTING TRIANGLE (U+25B6) and BLACK UP-POINTING TRIANGLE (U+25B2)).

      Note the solution I use: record all non-header and non-footer lines into a list: one list for each buffer; and then merge lines adding start, end and separator, adding header and footer only then. This is a workaround for design constraint. It is also a reason I had to add tilde lines I mentioned previously: you MUST have lines with equal lengths if you use this solution.

      I may as well have switched to using container div's or anything else that will allow keeping diff correct under such circumstances, but table is the only solution I know. Well, I can imagine a few based on JS, but I am not up to using it without user request.

      > >
      > > 5. When diffing with empty buffer “E749: empty buffer” error is shown: from function tohtml#Convert2HTML, line 15.
      > >
      > >
      >
      > That's...interesting. I'm not sure why that ever works. The problem is that line does "windo | if ...." when it should be "windo if ...." (without the |). I guess the default command for windo is :print?
      >
      > >
      > > Used 2html.vim: http://code.google.com/r/fritzophrenic-vim-clone/source/browse/runtime/syntax/2html.vim?r=92d11dd5081080db1d9635eb1f88fa2ceb634a53 (with the whole VIMRUNTIME from the same commit of the same repository).
      > >
      > >
      > >
      > > Used settings: default, unless mentioned otherwise.
      >
      > --
      > --
      > 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 vim_dev+unsubscribe@....
      > For more options, visit https://groups.google.com/groups/opt_out.

      --
      --
      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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Show all 19 messages in this topic