From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id BED36386F816 for ; Sun, 24 May 2020 16:29:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BED36386F816 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=eliz@gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]:34214) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jctUw-0003Pj-Kg; Sun, 24 May 2020 12:29:14 -0400 Received: from [176.228.60.248] (port=3915 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jctUu-000638-Fo; Sun, 24 May 2020 12:29:13 -0400 Date: Sun, 24 May 2020 19:29:22 +0300 Message-Id: <83wo51wb31.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves Cc: tom@tromey.com, gdb-patches@sourceware.org In-Reply-To: <0bee2d7c-4fe2-f6ff-088a-2d0c2730fbc9@redhat.com> (message from Pedro Alves on Sun, 24 May 2020 16:30:07 +0100) Subject: Re: [PATCH] Add completion styling References: <20200409024112.18065-1-tom@tromey.com> <83369dp3gy.fsf@gnu.org> <87eesc1x2d.fsf@tromey.com> <4b370f83-3954-bbc4-50b5-1528e8b4fca5@redhat.com> <83a71xxul5.fsf@gnu.org> <0bee2d7c-4fe2-f6ff-088a-2d0c2730fbc9@redhat.com> X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sun, 24 May 2020 16:29:16 -0000 > Cc: tom@tromey.com, gdb-patches@sourceware.org > From: Pedro Alves > Date: Sun, 24 May 2020 16:30:07 +0100 > > >> while it should highlight here: > >> > >> selftests::string_view::cons_1::main() > >> selftests::string_view::cons_2::main() > >> selftests::string_view::cons_3::main() > >> ^ > > > > Really? not here: > > > > selftests::string_view::cons_1::main() > > ^ > > I don't understand. Under the "1"? Why? because that's the first difference between the candidates. > My understanding is that "set style completion-difference" highlights the > first character that follows the string that the user typed, right? No, it highlights the first character from the left that distinguishes between candidates. That is the character the user _has_ to type to narrow his/her choice, potentially resolving it to a single candidate. > > But I actually don't understand how did we get these candidates by > > typing "main". Don't we complete by looking for strings that begin > > with what the user typed? I'm probably missing something here. > > You're missing that "b main" sets a breakpoint on every "main" > function in every namespace. OK, but then I still stand by my expectations. Although implementing that may not be easy given that the candidates don't start with what the user typed.