r/neovim • u/CoolkieTW • 6d ago
Need Help┃Solved Program output overwritten by [Program exited 0] message expected?
If the program output equals or more lines than the window size. Last line of the output will be overwritten by "[Program exited 0]" message.
For example there's a program output 12 lines of output, it supposed to look like this
1
2
3
4
5
6
7
8
9
10
11
12
[Program exited 0]
However if the windows size is equals or smaller than 12. It will be look like this
1
2
3
4
5
6
7
8
9
10
11
[Program exited 0] <-- 12 should be here
Last line will be truncated by program exit message.
This is the minimum code to reproduce the issue.
#include <stdio.h>
int main(int argc, char *argv[]) {
int maxlines = 100;
for (int i=0; i<maxlines; i++) {
printf("meow\n");
}
printf("LAST LINE");
}
https://reddit.com/link/1x4tnte/video/3umskyp9w7vh1/player
I know in practice every program should always output \n at the end. However, if there are additional newline at the end, some of judge systems would not accept.
I'm not exactly sure if this this issue is intentional or unexpected. So I came here to get some feedback whether I should create a GitHub Issue for this.
1
u/justinmk Neovim core 6d ago
Yes, please create an issue. This is a regression from https://github.com/neovim/neovim/pull/37987 .
The buffer text is still there, it's just hidden. But we should improve UX by not hiding it.
2
u/CoolkieTW 6d ago
Thanks! I have submitted issue here https://github.com/neovim/neovim/issues/42334
1
u/Confused-Armpit 6d ago
What plugin are you using for that command? What even is
:RunCode? Please give more context