-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Check to redrawcmdline after handling K_EVENT or K_COMMAND #9804
Conversation
Do you plan to add a test? If this fixes #8490 then test should be fairly easy to write. |
test/functional/ui/cmdline_spec.lua
Outdated
456789^ | | ||
]]} | ||
|
||
command('call timer_start(0, {-> 1})') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run()
is not added here as adding it will cause the test to pass with or without the fix.
Without the fix, this test fails with:
Expected:
|* |
|{3: }|
|:012345678901234567890123|
|456789^ |
|456789^ |
Actual:
|*:012345678901234567890123|
|:012345678901234567890123|
|:012345678901234567890123|
|:012345678901234567890123|
|456789^ |
The cmdline is redrawn multiple times, indicating that the test or Screen API is causing more than 1 redrawcmdline
.
Adding run()
seems to clear the extra cmdlines and results in the test not failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be be the purpose of adding run()
? Bare run()
shouldn't be used in a screen test as it discards redraw events. Use timeout
param to screen:expect{}
if the purpose is to wait longer.
thanks, and please remove the binary file. |
Rebased and fixed lint issues. |
2nd attempt at #9790.
Check if cmdline needs to be drawn and redraws it accordingly.
2 cases:
cmdline_was_last_drawn
inmsg_puts_display
, which bothMSG
andEMSG
will call.update_screen
has been called - this clears the cmdline so it needs to be redrawn.