From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125045 invoked by alias); 15 Mar 2019 12:43:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 125034 invoked by uid 89); 15 Mar 2019 12:43:26 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=UD:width X-HELO: mail-wr1-f51.google.com Received: from mail-wr1-f51.google.com (HELO mail-wr1-f51.google.com) (209.85.221.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Mar 2019 12:43:25 +0000 Received: by mail-wr1-f51.google.com with SMTP id t5so9440410wri.7 for ; Fri, 15 Mar 2019 05:43:24 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id a204sm2093174wmf.12.2019.03.15.05.43.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 05:43:22 -0700 (PDT) Subject: Avoid overwriting the TUI source window frame (Re: [RFC 8.3 0/3] Some style fixes) To: Eli Zaretskii , Tom Tromey References: <20190308210433.32683-1-tromey@adacore.com> <83pnr08tc8.fsf@gnu.org> <83zhq26fcw.fsf@gnu.org> <874l899nh3.fsf@tromey.com> <8336ns3uv4.fsf@gnu.org> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <33f140c3-f0b1-6750-2142-5365bb5466e9@redhat.com> Date: Fri, 15 Mar 2019 12:43:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8336ns3uv4.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-03/txt/msg00309.txt.bz2 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