Re: [RFC 0/1] Leading whitespace as a function identification heuristic?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 25, 2020 at 08:01:07PM +0100, Phillip Wood wrote:

> > Another possible corner case: tabs vs spaces. If I have:
> > 
> >    <space><space><space><space><space><space><space><space>foo
> >    <tab><tab>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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux