From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4FD18385840F for ; Mon, 18 Jul 2022 14:16:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FD18385840F Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-VF68270fN92u-BAnRP-y5w-1; Mon, 18 Jul 2022 10:16:13 -0400 X-MC-Unique: VF68270fN92u-BAnRP-y5w-1 Received: by mail-wm1-f70.google.com with SMTP id n18-20020a05600c501200b003a050cc39a0so5485302wmr.7 for ; Mon, 18 Jul 2022 07:16:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=cxLEDqMj3HeTmWrSOSCscDOyt/cdQ7MCSRdt1lo/Bek=; b=ZeCOcBEkxkAX3TVboe/JqpiErBZrjAADzK7lk2jP8UHyTCvbxBOg5s3XSjc3bfTMey Y68ZuzPufdplCGrU2FA3qufmhlRtkSLF/4TL7v7trQfAkFmrGcueql7GROqw2OmrrOvf 76ZBMmzQwzHg5S7z16R2uklorLZ06die4Ex3ScTHjOo/FhCfnVROTLpw6xPYUOtFKHvU QlJFHyR/XYxEiCuUDHfSpqEeTWY+o+Xz+Wu2TmDn6Nf4MXFdZrpOKZDlqW6uwBkzsTwz poq5crX2DjRRE+oELn/4G8JlxCFCARJOTk5fPzsSLrRF3gseybrfnmy2sUAJYGfIMBBa e46w== X-Gm-Message-State: AJIora+ooQ+Bkt9YeairDocf3ZTWkZPkzKzptLE1LnC36ggqt8MYLs5G rz6eqejlKCa52icdpeYGBKDsutE5qqjU1lyqeErpr73snf3Btviaib1LeMBHAOHBd6v4ZquKgiN /dCNsi2U/dhvtv5v8C8tFew== X-Received: by 2002:a05:600c:1993:b0:3a1:918d:671b with SMTP id t19-20020a05600c199300b003a1918d671bmr25491969wmq.14.1658153771440; Mon, 18 Jul 2022 07:16:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vz9nw3nr/YRlyyeeB2m/T3iGx9EBUEUcPTsQAX8miOJZN0fYb4mENW3QmqO7ivbxc6nIgG5A== X-Received: by 2002:a05:600c:1993:b0:3a1:918d:671b with SMTP id t19-20020a05600c199300b003a1918d671bmr25491940wmq.14.1658153771051; Mon, 18 Jul 2022 07:16:11 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id f8-20020a05600c4e8800b003a31673515bsm7963107wmq.7.2022.07.18.07.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 07:16:10 -0700 (PDT) From: Andrew Burgess To: Andrei Pikas , Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 (mentions of reverse mode eliminated)] Add style tui-cursorline command to colorize TUI current line. In-Reply-To: References: <83sfn91rvt.fsf@gnu.org> <20220710101003.4245-1-gdb@mail.api.win> <87tu7imafv.fsf@tromey.com> Date: Mon, 18 Jul 2022 15:16:09 +0100 Message-ID: <87tu7eqzfa.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 14:16:16 -0000 Andrei Pikas writes: > > I think I'd prefer a hyphen in there, since "cursorline" isn't a word. > > So, tui-cursor-line.=C2=A0 But why "cursor" and not "current"? "curren= t > > line" seems to be the term used in the gdb manual. > > I chose this name to match vim for those who familiar with :set=20 > cursorline. OK, I'll change it to tui-cursor-line. Or would you prefer=20 > tui-current-line? > > > > > Andrei> @@ -54,6 +54,28 @@ static const char * const cli_colors[] =3D = { > > Andrei>=C2=A0=C2=A0=C2=A0 "magenta", > > Andrei>=C2=A0=C2=A0=C2=A0 "cyan", > > Andrei>=C2=A0=C2=A0=C2=A0 "white", > > Andrei> +=C2=A0 "8", "9", "10", "11", "12", "13", "14", "15", "16", "1= 7",=20 > "18", "19", "20", > > > > What's this for? > > This is to support all 256 colors=20 > https://www.ditig.com/256-colors-cheat-sheet . I want to use the=20 > lightest shade of gray #255 for the background. Thanks. I've been playing with adding 256 colour support to GDB. I think this change is big enough that it should be split into a separate patch. It certainly deserves its own NEWS entry, and probably requires a docs update to indicate what all these (seemingly) random numbers mean. Thanks, Andrew > > > > Andrei>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 case '\n': > > Andrei> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (wa= ttr_get (w, &w_attrs, &w_pair, nullptr) =3D=3D OK) > > Andrei> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 /* Apply current style till the end of line. */ > > Andrei> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 wchgat (w, -1, w_attrs, w_pair, nullptr); > > > > I don't think this is correct, because the source window may not exten= d > > to the end of the line. > > I tested for long line. It doesn't seem to be a problem (screenshot=20 > https://drive.google.com/file/d/1lMgdR9cTNEQJAz05wO7TCgd3SVYOdXyP/view?us= p=3Dsharing=20 > ). > > I think -1 handles this case: "A character count of -1 or greater than=20 > the remaining window width means to change attributes all the way to the= =20 > end of the current line." from https://linux.die.net/man/3/wchgat > > I can rewrite this line as wchgat (w, std::max (0, getmaxx (w) - getcurx= =20 > (w)), w_attrs, w_pair, nullptr). But I think it's the same.