You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever my terminal is resized with cReddit already running, the position of the text on the screen does not change at all. If the terminal window is made wider, empty space is added to the right side. Similarly if the terminal window is made narrower, then whatever was on the screen is clipped.
Once a key is pressed that changes something on screen, only the link section at the bottom of the terminal is "aware" of the resizing and starts using the new amount of space to display text.
This is strange behavior. ncurses should be able to know when a terminal is resized, because programs like vim can. cReddit should know when the window is resized and immediately redraw the text with the right display width and formatting.
The text was updated successfully, but these errors were encountered:
I agree it's an issue, I've got some other changes in the works and I might take a stab at this one.
It shouldn't that hard to do. We render the lines into separate buffers in the LinkScreen and CommentScreen structs, and then print those buffers to the screen when that line is on the screen and something changes. When a new line shows up (Such as if you scroll past the bottom and cause a new link to appear), only that new line is rendered, all the old lines keep their old rendering. All we'd really have to do is keep asking ncurses if the screen size changed, and then free and erase all of the lines on the current screen. Then the next time the screen is printed (Which should be forced at that point), add a check to see if the line is NULL in the 'drawScreen' section, and then render the line again if it is.
This is pretty simple - I don't know when I'll be able to do this, but it's a change that probably wouldn't take more then 5/10 minutes really. If someone else tries this, just make sure that you update the code for both the LinkScreen and CommentScreen.
Whenever my terminal is resized with cReddit already running, the position of the text on the screen does not change at all. If the terminal window is made wider, empty space is added to the right side. Similarly if the terminal window is made narrower, then whatever was on the screen is clipped.
Once a key is pressed that changes something on screen, only the link section at the bottom of the terminal is "aware" of the resizing and starts using the new amount of space to display text.
This is strange behavior. ncurses should be able to know when a terminal is resized, because programs like vim can. cReddit should know when the window is resized and immediately redraw the text with the right display width and formatting.
The text was updated successfully, but these errors were encountered: