mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
tui: Hint wrapped lines to terminals.
Previously, when neovim would wrap a line across multiple lines, terminal emulators could not detect that the lines represent a single wrapped line as opposed to several separate lines. As a result, many terminals' selection/copying functionality would treat a wrapped line as several newline-delimited lines. Fix this by reenabling a "special trick" from Vim. When a line is wrapped, write the last character of that line followed by the first character of the next line to the terminal. This hints to the terminal that the next line is a continuation of the current line. Extends the raw_line event with a "wrap" parameter which controls when to do wrap hinting.
This commit is contained in:
@@ -47,7 +47,7 @@ struct ui_t {
|
||||
// in to the public grid_line format.
|
||||
void (*raw_line)(UI *ui, Integer grid, Integer row, Integer startcol,
|
||||
Integer endcol, Integer clearcol, Integer clearattr,
|
||||
const schar_T *chunk, const sattr_T *attrs);
|
||||
Boolean wrap, const schar_T *chunk, const sattr_T *attrs);
|
||||
void (*event)(UI *ui, char *name, Array args, bool *args_consumed);
|
||||
void (*stop)(UI *ui);
|
||||
void (*inspect)(UI *ui, Dictionary *info);
|
||||
|
Reference in New Issue
Block a user