Test to demonstrate fifo buffer blank line inconsistency

When "edit -fifo" reads data without a trailing newline, the fifo
buffer will not have a trailing blank line. But if there is a trailing
newline, we will get a trailing blank line. This is weird because the
trailing blank line exists for scrolling, it should not be determined
by the data read.

Add a test case to demonstrates the inconsistency which is fixed by
the next patch.
This commit is contained in:
Johannes Altmanninger 2024-01-28 18:23:07 +01:00 committed by Maxime Coste
parent c124c8f517
commit fdbad4d9b2
3 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1 @@
:nop %sh{mkfifo fifo}; edit -fifo fifo *fifo*<ret>

View File

@ -0,0 +1 @@
* noeol

View File

@ -0,0 +1,10 @@
ui_out -ignore 7
exec 5>fifo
ui_out '{ "jsonrpc": "2.0", "method": "refresh", "params": [true] }'
printf '* noeol' >&5
ui_out '{ "jsonrpc": "2.0", "method": "draw", "params": [[[{ "face": { "fg": "black", "bg": "white", "underline": "default", "attributes": [] }, "contents": "*" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " noeol\u000a" }]], { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }] }'
ui_out -ignore 2
exec 5>&-
ui_out '{ "jsonrpc": "2.0", "method": "draw_status", "params": [[], [{ "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": "*fifo* 1:1 " }, { "face": { "fg": "black", "bg": "yellow", "underline": "default", "attributes": [] }, "contents": "[scratch]" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " " }, { "face": { "fg": "blue", "bg": "default", "underline": "default", "attributes": [] }, "contents": "1 sel" }, { "face": { "fg": "default", "bg": "default", "underline": "default", "attributes": [] }, "contents": " - client0@[kak-tests]" }], { "fg": "cyan", "bg": "default", "underline": "default", "attributes": [] }] }'