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

[BUG] Highlighting bugs

Expand Messages
  • ZyX
    While working at extending my format.vim plugin to make it conform actual vim highlighting I found two following possible highlighting bugs: 1. If DiffChange
    Message 1 of 1 , Aug 18, 2013
    • 0 Attachment
      While working at extending my format.vim plugin to make it conform actual vim highlighting I found two following possible highlighting bugs:

      1. If DiffChange highlighting group is cleared match highlighting extends past the end of line. Script to reproduce is highlight-bugs-1.vim, use `vim -u NONE -N -S {scriptname}` to launch. Screenshot: http://img-fotki.yandex.ru/get/9314/9151298.3/0_9dc9b_bded1809_orig.png (note: unlike attached this is the screenshot of the full window).
      2. If special highlighting (highlighting of tabs with &list set and of non-printable characters) is cancelled by signs, cursorline or matches, first character of replacement text is highlighted according to syntax group it matched (merged with signs, cursorline or matches highlighting), but subsequent characters are highlighted only according to signs, cursorline or matches highlighting. It would be logical to either highlight the whole character with one highlight group or do not use syntax highlighting for them at all. Screenshot: http://img-fotki.yandex.ru/get/9505/9151298.3/0_9dc9d_7545c995_orig.png (full window).

      Also note that highlighting rules appear to be too complicated: there are cancels and different behavior of cleared highlight groups while I would just merge all levels of highlighting in a uniform way:
      " Order: colorcolumn > matches > diff > cursorline > signs > special > syntax
      " Rules:
      " (colorcolumn = colorcolumn and cursorcolumn)
      " (signs = sign linehl)
      " (matches = matches themselves and search)
      " (special = highlighting of special characters defined by listchars (nbsp, tab, trail) and
      " non-printable characters highlighting)
      " (cancel = fg, bg and other attributes are ignored)
      " (cleared = after “hi clear …” or “hi link … Normal”)
      " - signs cancels special
      " - cursorline cancels signs and special
      " - matches cancel cursorline, signs and special
      " - colorcolumn does NOT cancel ANY highlighting
      " - If special is cancelled first character (applicable for tabs and non-printable characters,
      " otherwise read “all characters”) is highligted using syntax (if special is not cancelled
      " syntax is ignored)
      " - cleared diff cancels signs and cursorline and enables special
      " - cleared cursorline cancels signs and enables special
      " - cleared signs does not affect highlighting
      " - cleared matches does not affect highlighting
      " - cleared colorcolumn does not affect highlighting
      " - cleared diff makes match at the EOL extend past the EOL
      " - cursorline makes 'showbreak' characters underlined, but does not alter their highlighting

      --
      --
      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.
    Your message has been successfully submitted and would be delivered to recipients shortly.