Avoid overwriting the TUI source window frame (Re: [RFC 8.3 0/3] Some style fixes)

Pedro Alves
2019-03-15T12:43:26Z

On 03/12/2019 04:44 PM, Eli Zaretskii wrote:
> 2. The fix for avoiding to overwrite the source window frame is
> simple: revert 4a3045920. I don't really understand why that change
> was made: AFAIU, wclrtoeol clears to the end of the window line, and
> cannot be told to clear only part of the line.
>
> --- gdb/tui/tui-winsource.c~4 2019-02-27 06:51:50.000000000 +0200
> +++ gdb/tui/tui-winsource.c 2019-03-12 10:57:02.052875200 +0200
> @@ -285,7 +285,12 @@ tui_show_source_line (struct tui_win_inf
> wattroff (win_info->generic.handle, A_STANDOUT);
>
> /* Clear to end of line but stop before the border. */
> - wclrtoeol (win_info->generic.handle);
> + int x = getcurx (win_info->generic.handle);
> + while (x + 1 < win_info->generic.width)
> + {
> + waddch (win_info->generic.handle, ' ');
> + x = getcurx (win_info->generic.handle);
> + }
> }
>

Makes sense to me. I confirm this fixes it for me too.

> void

Thanks,
Pedro Alves