From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 203C71F670 for ; Fri, 25 Sep 2020 20:37:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbgIYUg0 (ORCPT ); Fri, 25 Sep 2020 16:36:26 -0400 Received: from cloud.peff.net ([104.130.231.41]:41494 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbgIYUgT (ORCPT ); Fri, 25 Sep 2020 16:36:19 -0400 Received: (qmail 15935 invoked by uid 109); 25 Sep 2020 19:05:02 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 25 Sep 2020 19:05:02 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 22899 invoked by uid 111); 25 Sep 2020 19:05:02 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 25 Sep 2020 15:05:02 -0400 Authentication-Results: peff.net; auth=none Date: Fri, 25 Sep 2020 15:05:01 -0400 From: Jeff King To: phillip.wood@dunelm.org.uk Cc: Ryan Zoeller , Junio C Hamano , git@vger.kernel.org Subject: Re: [RFC 0/1] Leading whitespace as a function identification heuristic? Message-ID: <20200925190501.GA668512@coredump.intra.peff.net> References: <20200923215859.102981-1-rtzoeller@rtzoeller.com> <20200924211725.GA3103003@coredump.intra.peff.net> <1c03faa0-011c-39c2-acb6-d09a5fcfc818@gmail.com> <20200925184319.GA660343@coredump.intra.peff.net> <005de229-ad05-437c-7b83-8f6502b4e27d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <005de229-ad05-437c-7b83-8f6502b4e27d@gmail.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, Sep 25, 2020 at 08:01:07PM +0100, Phillip Wood wrote: > > Another possible corner case: tabs vs spaces. If I have: > > > > foo > > bar > > > > which is more indented? Counting isspace(), it is the first one. But > > visually, it would _usually_ be the second one. But of course it would > > depend on your tabstops. > > > > The above example is obviously stupid and contrived, but I wonder if > > there are legitimate confusing cases where people mix tabs and spaces > > (e.g., mixed tabs and spaces to align function parameters, etc). > > To calculate the indentation for diff > --color-moved-ws=allow-indentation-change in fill_es_indent_data() we use > the tabwidth whitespace attribute to calculate the width of a tab in spaces > [...] Ah, right, I forgot we already had "tabwidth" config to deal with this. I agree we could make use of that same technique here. -Peff