Commit Graph

8676 Commits

Author SHA1 Message Date
Jonathan de Boyne Pollard
4408bd28cb tui: Char signedness fix for the big blocks of (signed) numbers. 2017-06-03 18:53:29 +01:00
Jonathan de Boyne Pollard
1b008be1e6 tui: Correct to_status_line for screen.
PM...ST actually sends the string to screen's message area.  Sending the
string to the status line requires a different control sequence peculiar to
screen.

Also make iTerm2 SGR 38/48 consistent.
2017-06-03 18:53:29 +01:00
Jonathan de Boyne Pollard
c2a0fd349e doco: Move TERM help into its own section and expand.
:help TERM previously pointed to a section that no longer even discussed the
variable.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
533f5c38c4 doco: Note some common $TERM mistakes and how to fix them.
Also explain more clearly the difference between Vim and Nvim
when it comes to built-in terminfo entries.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
1c1231bf13 tui: Add built-in terminfo entry for VTE.
Also slightly refactor the way in which GNOME/MATE Terminal pretending to be
xterm is detected.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
32396b5879 tui: Perform length safety check in comparison macros. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
41403c6d25 tui: Treat genuine Xterm and iTerm.app as standards-conformant.
They both can handle SGR control sequences in the form set out in
ISO 8613-6:1994/ITU T.416:1993.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
5265ac5000 tui: Change terminal family recognition to avoid '+' entries.
The terminfo commentary states that these are not standalone
entries suitable for end-use.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
5377de33ac tui: Add st to the always 256-colour capable list.
Also comment and augment some terminal colour tests.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
3f8dedd7ae tui: Correct a copy and paste error in stterm tests.
The test decsription was correct; the test was not.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
24db94b1a6 tui: Fix Interix and account for deferred wrap.
The Interix termcap entry is missing the carriage_return capability which nvim
relies upon.  And Interix is one of the few terminal emulators that does not
defer automatic wrap at the right margin, which is now accounted for when
moving the cursor left and when outputting whole lines at a time.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
0d53767274 tui: Add iTerm and rxvt to the terminals that know extended DECSCUSR. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
8f60395dd1 tui: Update colour tests some more. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
6910bfee0f tui: Correct error in terminfo extension processing.
Using the right unibilium query function then revealed a latent NULL pointer
problem.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
1f3b5e1a82 tui: Correct error in terminfo extension processing.
Using the wrong unibilium query function just happened to work with the
various terminfo records used in local testing.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
8768b7f4a0 tui: Remove now-unused flag variable.
Follows on from fcf0d13f48bffbd41749069ce383d01153dd960c.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
e6cbb01b55 tui: Update colour tests. 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
a2434aeddb tui: Remove tmux wrapper from the Konsole path.
tmux has its own code path, now; and the tmux wrapping was not the ideal thing
to do in the first place.

Also improve the commentary on the built-in terminfo records.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
16300d02c7 tui: Improvements to RGB colour support.
The details are in the on-line help under :help true-color .

The brief precis is that nvim is (I hope.) converging with tmux and libvte.
It is taking the same approach with setrgbf and setrgbb terminfo capabilities
that it does with the Ss and Se terminfo capabilities.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
67e2120459 tui: Refactor built-in teminfo records.
No change to their contents, but make the Big Blocks Of Numbers half as wide
but twice as deep, in order to accomodate house style.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
9e9ffeb5eb tui: Update fallback terminfo records.
Replace the 8-color xterm from unibilium with the 256-colour one from terminfo.
Add a fallback record for suckless terminal.
2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
503a5c458b tui: Spelling corrections in doco and commentary 2017-06-03 18:53:28 +01:00
Jonathan de Boyne Pollard
74472f7b2b tui: Fix conflict with predefined "linux" macro. 2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
756a17a848 doco: Replace termcap with terminfo where appropriate.
Also document better what to do on slow terminals.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
76a6509c59 tui: More refactoring, and improvements to cursor shape support.
The details are in the on-line help under :help cursor-shape .

The brief precis is that nvim is following the lead of tmux, and going
beyond what tmux does to make cursor shape changes work on a broad range of
terminals.  This includes on tmux itself, which is no longer bypassed.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
03683c375c tui: Disable interference in guicursor by higher layers.
Ironically, higher layers trying to be "smart" about the terminal type
but not actually being very smart at all, makes it more difficult rather
than less to correct the TUI layer.

Note that this orphans the os_term_is_nice() function and down the road,
presuming that we do not have to revert this, that function can be removed.
It incorporates knowledge of terminal types and behaviours in the wrong place.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
3d8e0594e4 tui: Split fix_terminfo() up and refactor.
There are now a few built-in terminfo entries, taken either from unibilium
or ncurses terminfo, for falling back upon when there is no terminfo database
or when it is missing stuff.  In an ideal world, these would be in unibilium
itself.

The ultimate fallback, for no terminfo database and no built-in terminfo
record that matches the terminal type, is now the "ansi" terminal type; so
unknown terminal types are now considered to have at minimum the basic
ECMA-48 colour, motion, and editing capabilities.

The terminfo records are just blobs, raw images of the equivalent terminfo file
created with the od command.  No longer are incomplete terminfo records built
up with code.  These blobs are the full, real, records; already built.

The post-processing of the terminfo record, once found, is split into the
part where we fix known errors and deficiencies in terminfo, and the part
where we add extensions that we need that terminfo does not define
capabilities for.  In an ideal world, the former would be a no-op.

No part of the TUI layer apart from these is aware of terminal type or has
conditional code based upon checking environment variables at runtime.  It
is all pre-calculated and written into unibilium (or the TUIData object) at
initialization time.

This is fairly aggressive about turning on 256-colour and true colour support.

This also positively decodes genuine xterm for turning on DECSLRM use, rather
than assuming that anything that says that it is xterm is actually xterm,
fixing scrolling problems with vertically split windows.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
d65cff9de8 doc: Document some more terminal behaviours.
This documents 256-colour and true colour handling, cursor shapes,
and scrolling regions.

Almost all of these headings are taken from the Vim doco, so that
the :help commands that people learn are a transferable skill.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
6be921b71c doc: Relegate xterm-8bit to a removed feature. 2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
ede4d620de tui: Fix cursor motion clear screen bug visible on line #1 in redraws.
The clear_screen capability moves the cursor position.
This needs to be accounted for.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
d077a161ee tui: Coding style changes only
Per warnings about house style from automated tools.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
e826ec0b0e tui: Optimize more cursor motions
A slight improvement on the CR optimization for some edge cases.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
5b07ca1dfd tui: Use what scrolling PuTTY has.
PuTTY does not implement DECLRMM or DECSLRM, but it does implement DECSTBM.
So allow using PuTTY terminal scrolling when the scroll rectangle is the
full width of the terminal.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
dbc25f5a87 tui: Optimize cursor motions
Instead of emitting CUP in several places each with their own poor local
optimizations, funnel all cursor motion through a central place.

This central function performs the same optimization for every place that
needs to move the cursor, and implements a better set of optimizations:

* Emit CUU/CUD/CUF/CUB instad of CUP when they are likely shorter.
* Use BS and LF when they are shorter than CUB and CUD.
* Use CR for quick returns to column zero.
* If printing the next few characters is shorter than a rightwards motion,
  then just write out the characters.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
d711bb84e6 tui: Eliminate superfluous SGR resets.
Track whether the terminal is in no attribute mode, assuming that it starts
this way, and do not attempt to reset back to that mode if already in it.
2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
5e5914655b tui: document fix_terminfo()'s several tasks 2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
7821eef258 Separate 16- and 256- colour control sequences and tidy up some redundancy. 2017-06-03 18:53:27 +01:00
Jonathan de Boyne Pollard
d5468d3cde Change TUI resize to use an extended terminal capability.
... rather than hardwiring the string and testing the terminal
type every time the screen is re-sized.
2017-06-03 18:53:27 +01:00
Jonas Stein
fd07250e6c doc: README.md (#6839) 2017-06-02 23:45:32 +02:00
Jonathan de Boyne Pollard
838277e28a test: fix bashisms (#6791) 2017-06-01 00:46:00 +02:00
Justin M. Keyes
133f8bc628 Merge #4700 from AdnoC/keep-default-register 2017-05-31 23:43:40 +02:00
Jan Viljanen
c1026ff4b3 build: LuaRocks 2.4.2 #6059
LuaRocks 2.3 and onwards changed the /P option to no longer include the
version number which made newer releases of LuaRocks fail when compiling
on Windows.
2017-05-31 23:13:47 +02:00
AdnoC
2f2eeb19ba shada: Add default value for is_unnamed 2017-05-31 13:31:06 -04:00
AdnoC
745bac562d eval.c: Ignore unnamed register error in f_setreg
The error case is already handled and an appropriate error message is
already printed.
2017-05-31 13:31:06 -04:00
AdnoC
5908f562df test: Fix and add cases for unnamed register
Also:

Add ru to shada tests with all keys

Add test for unset unnamed and register 0
2017-05-31 13:31:05 -04:00
AdnoC
0c3dea5c4d style/lint 2017-05-31 13:31:01 -04:00
AdnoC
336412e1db shada/linting: Moved some code out of shada_write.
shada_write was too long (over 500 lines) and caused a linting error.
Register initialization was moved to its own function in order to save lines.
2017-05-31 13:19:09 -04:00
AdnoC
beca4dc16c eval/shada: Add testing for unnamed register with setreg and startup 2017-05-31 13:19:08 -04:00
AdnoC
9a91ce4fa6 eval: Add ability to set the unnamed register with setreg 2017-05-31 13:19:08 -04:00
AdnoC
a00b03d03f shada: Set the unnamed register to the previous unnamed register on startup 2017-05-31 13:18:59 -04:00