feat(nvim_open_term): convert LF => CRLF (#26384)

Problem:
Unlike termopen(), nvim_open_term() PTYs do not carriage-return the
cursor on newline ("\n") input.

    nvim --clean
    :let chan_id = nvim_open_term(1, {})
    :call chansend(chan_id, ["here", "are", "some", "lines"])

Actual behavior:

    here
        are
           some
               lines

Expected behaviour:

    here
    are
    some
    lines

Solution:
Add `force_crlf` option, and enable it by default.
This commit is contained in:
Raphael
2023-12-14 16:08:00 +08:00
committed by GitHub
parent 36552adb39
commit 619407eb54
11 changed files with 91 additions and 13 deletions

View File

@@ -16,6 +16,7 @@ typedef struct {
terminal_write_cb write_cb;
terminal_resize_cb resize_cb;
terminal_close_cb close_cb;
bool force_crlf;
} TerminalOptions;
#ifdef INCLUDE_GENERATED_DECLARATIONS