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

@ -576,21 +576,21 @@ describe("pending scrollback line handling", function()
]]
screen:expect [[
{1: 1 }^a |
{1: 2 } a |
{1: 3 } a |
{1: 4 } a |
{1: 5 } a |
{1: 6 } a |
{1: 2 }a |
{1: 3 }a |
{1: 4 }a |
{1: 5 }a |
{1: 6 }a |
|
]]
feed('G')
screen:expect [[
{1: 7 } a |
{1: 8 } a |
{1: 9 } a |
{1: 10 } a |
{1: 11 } a |
{1: 12 } ^a |
{1: 7 }a |
{1: 8 }a |
{1: 9 }a |
{1: 10 }a |
{1: 11 }a |
{1: 12 }^a |
|
]]
assert_alive()