When waddnstr is called with a string that would extend past the
end of the window, the string is truncated, the cursor remains at
the last column, and ERR is returned. If this error is ignored and
the loop continues, the next call to waddnstr overwrites the character
at this column, resulting in a slight visual artifact. When the
window is too small to fit the full status line, it is effectively
truncated by one space on the right, since the string shown for
each channel begins with a space. Additionally, if the last window
is the current window, the space is shown with a colored background.
To fix this, when waddnstr returns ERR, exit the loop in styleAdd()
early return -1 to propogate this error down to the caller.
Apparently these are common. There's no terminfo for these, so
manually define the xterm sequences.
There's no documentation in the manual for the "intuitive" keys...
I'm not sure if that should continue to be the case or not.
A_BLINK has probably always existed, but there's no good reason to
ever use it, so make it do italics instead. Normally all attributes
are set by a single set_attributes string if it's set, so clear it
to force ncurses to use the reassigned enter_blink_mode string. If
the terminal has no enter_italics_mode string, then nothing will
happen.
This makes setting multiple attributes a bit less efficient, but I
don't think it's likely to make much of a difference since using
multiple attributes at once is so uncommon.
OpenBSD's xterm doesn't have bracketed paste mode, and it would be
nice to still be able to paste in several lines and collapse them
with M-q, provided one remembers to type C-z p first...
A little annoying to make it a "chord" like this, but C-v is already
used for scrolling, following Emacs-style key bindings (in order
to have a way to scroll without using "special" keys like the arrows
and page up/down), and C-z is at least already in the business of
inserting control characters. This makes it possible to manually
enter some things that are otherwise only possible with /exec printf.
With the early return, mainUpdate doesn't get called in cases where
other functions expect windowShow to call it, such as when closing
or moving windows.
I don't know why I ruled this out originally, it's more visually
pleasing to me now especially that threshold is likely to remain
set at "+" for a long time.
Finally! Changing the message visibility threshold doesn't totally
screw up scroll position. Neither do horizontal resizes, but vertical
resizes drift because the value of windowTop() changes before and
after...
The scroll position is anchored to the top of the window. It's
arbitrary whether to anchor the top or the bottom, but other scrolling
commands like M-p and C-r are anchored to the top, so this is
consistent.