Some time ago a different approach to the same goal was discussed that involved highlighting leading tabs. It is relatively easy to add to all languages, Perl already has it:
The only downside at this point is that for soft tabs the tab size is hardcoded, but I guess Allan could add something to fix that.
In most languages all that is needed is to include this into the syntax (replacing the 4 in ' {4}' with the default tab width for the language):
{ name = 'meta.leading-tabs';
begin = '^(?=(\t| {4}))';
end = '(?=[^\t\s])';
patterns = (
{ match = '(\t| {4})(\t| {4})?';
captures =
{ 1 = { name = 'meta.odd-tab'; };
2 = { name = 'meta.even-tab'; };
};
}
);
},
Gerd