Re: [PATCH 5/6] whitespace: more accurate initial-indent highlighting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2007, 08:04 UTC
- Message-ID
- <7vwsrdd9wa.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <ACA0791E-189F-4E19-AE87-C7D1163C0366@wincent.com>
Wincent Colaiuta <win@wincent.com> writes:
Show 7 quoted lines
> Basically I would have proposed extracting out each type of whitespace > error into an inline function in ws.c, where it could be used by both > check_and_emit_line() in ws.c and apply_one_fragment() in builtin- > apply.c. > > Unfortunately, mixing checking and emission phases makes this proposed > refactoring a little bit ugly.
The right refactoring would be what JBF hinted in his message, to record and return a list of suspicious ranges from the checker function and have the highlighter and the fixer make use of that list.
Such a refactoring is still possible but I think it is beyond the scope of pre 1.5.4 clean-up.