From: Jeff King Date: Fri, 25 Sep 2020 19:05:01 GMT Subject: Re: [RFC 0/1] Leading whitespace as a function identification heuristic? Message-ID: <20200925190501.GA668512@coredump.intra.peff.net> In-Reply-To: <005de229-ad05-437c-7b83-8f6502b4e27d@gmail.com> 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