Tuesday, February 2, 2016

Re: Puzzling behavior of AnsiEsc! in an autocommand

Hi Gary!

On Di, 02 Feb 2016, Gary Johnson wrote:

> I'm running Vim 7.4.1152 in an xterm on a Red Hat Enterprise Linux
> 7.1 system and using Dr. Chip's AnsiEsc plugin (v13i) to make ANSI
> color escape sequences in some files readable.
>
> I noticed some odd behavior and simplified the conditions down to
> this (one line).
>
> $ vim -N -u NONE -o2 --cmd 'so plugin/cecutil.vim' --cmd 'so plugin/AnsiEscPlugin.vim' --cmd 'au BufWinEnter * AnsiEsc' --cmd 'au ColorScheme * AnsiEsc!'
>
> I used "-o2" to make the current-window and not-current-window
> status lines visible.
>
> The initial appearance of the screen is as expected: the status
> lines are in inverse video with "[No Name]" on the left and no other
> characters in them, and the empty buffer lines are indicated by a
> blue tilde in the first column. Now execute
>
> :colorscheme default
>
> (The name of the color scheme doesn't seem to matter.) All
> highlighting disappears: the status lines and the tildes are white
> on black. In addition, the "empty" space on the current-window
> status line is filled with carats (^) and the space on the
> not-current-window is filled with equal signs (=). The screen looks
> like this (with redundant lines and columns removed for clarity):
>
> ~
> ~
> ~
> ~
> [No Name]^^^^^^^^^^^^^^^^^^^^
> ~
> ~
> ~
> ~
> [No Name]====================
>
> Executing ":hi" shows almost all the highlights have been cleared,
> e.g.,
>
> SpecialKey xxx cleared
>
> The corruption of the highlighting occurs when "AnsiEsc!" is
> executed by the ColorScheme event. If I remove that autocommand and
> execute ":AnsiEsc" from the command line, nothing odd happens.
>
> I don't know whether this is a bug in the AnsiEsc plugin or in the
> processing of the ColorScheme autocommand event, or perhaps in some
> command the AnsiEsc plugin is executing, so I thought I'd post this
> here rather than send it just to Dr. Chip.

IIRC, this is a feature of Vim, to prevent an empty statusline. E.g.
this is done on purpose, when fillchars does not contain an entry stl:x
or stlnc:x and the 'statusline' option is not empty and the default
highlighting group for Statusline or StatuslineNC is reset

Mit freundlichen Grüßen
Christian
--
Ein Mensch in einer fremden Stadt fragt:
"Wissen Sie, wo es zum Bahnhof geht?"
Esoteriker: "Wenn Du da hin sollst, wirst Du den Weg auch finden."

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