From patchwork Fri Mar 15 16:38:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 31864 Received: (qmail 13989 invoked by alias); 15 Mar 2019 16:39:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 13980 invoked by uid 89); 15 Mar 2019 16:39:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=sk:ncurses, __mingw32__, __MINGW32__, video X-HELO: sonic306-20.consmr.mail.ir2.yahoo.com Received: from sonic306-20.consmr.mail.ir2.yahoo.com (HELO sonic306-20.consmr.mail.ir2.yahoo.com) (77.238.176.206) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Mar 2019 16:39:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1552667949; bh=GMp4g5XxxQZTc56phx6s5DqIvp2wS4IuLtJWxlJUeio=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject; b=V6lgDkD+exLIb4TgHInryIMVdEdBNtOLwG2cawzNaTSk7Jr0lcWf4V6SupTRuBIc2SCFdlxbNdpofvAdzqfjuDyxQiBGHjv5yqVFM9MxsA9iOJipeVXqcjRvHbUvjulCJ8J1SoBStWZv3ZL0hkm9IRBDxGKKjgv3rvkbr5NFdQ7ArkqplxYOs1QF/xF+g7x6Oy7CFiMU6yyembDRqPiHJcswm0IT3NsRx1QTWBu4AUywdJNJPfJPWiZGAupWIXzdwImvm+5dQPrkWwo01/7KHoXEsKlDx0/g781o4OCpPO26SJ2JbjG+s+8k6PYpUj17L9jTukD/MphSixTaiXm52Q== Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ir2.yahoo.com with HTTP; Fri, 15 Mar 2019 16:39:09 +0000 Date: Fri, 15 Mar 2019 16:38:37 +0000 (UTC) X-Patchwork-Original-From: "Hannes Domani via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Hannes Domani To: GDB Patches Message-ID: <186859064.9289078.1552667917410@mail.yahoo.com> In-Reply-To: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> References: <6ada07d6-ff84-e215-19ff-0a17563390c6@redhat.com> Subject: Re: [PATCH] Improve/fix the TUI's current source line highlight MIME-Version: 1.0 Content-Length: 1802 X-IsSubscribed: yes Am Donnerstag, 14. März 2019, 18:47:56 MEZ hat Pedro Alves Folgendes geschrieben: > WDYT? The result looks very nice. > +/* If true, we're highlighting the current source line in reverse > +  video mode.  */ > +static bool reverse_mode_p = true; Shouldn't this variable be initialized to false? Weird things happen on my end with true (sometimes the cmd window contents are reversed). Also, I had to add the following to make it work on windows (but beware, I'm using pdcurses, not ncurses, and I don't know if ncurses for windows needs this as well): --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -369,6 +386,17 @@ apply_ansi_escape (WINDOW *w, const char *buf)    if (reverse_mode_p)      { +#if defined(__MINGW32__) +      if (style.get_foreground ().is_basic () +         && style.get_foreground ().get_value () +         == (ncurses_norm_attr & 15)) +       style.set_fg (ui_file_style::NONE); +      if (style.get_background ().is_basic () +         && style.get_background ().get_value () +         == ((ncurses_norm_attr >> 4) & 15)) +       style.set_bg (ui_file_style::NONE); +#endif +        /* We want to reverse _only_ the default foreground/background          colors.  If the foreground color is not the default (because          the text was styled), we want to leave it as is.  If e.g.,