mirror of https://github.com/gorhill/uBlock.git
Minor code review
This commit is contained in:
parent
9637ab56a9
commit
2e0a8951b8
|
@ -83,19 +83,19 @@ const renderAdvancedSettings = async function(first) {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeHash = hashFromAdvancedSettings(raw);
|
beforeHash = hashFromAdvancedSettings(raw);
|
||||||
let pretty = [],
|
const pretty = [];
|
||||||
whitespaces = ' ',
|
const lines = raw.split('\n');
|
||||||
lines = raw.split('\n'),
|
let max = 0;
|
||||||
max = 0;
|
for ( const line of lines ) {
|
||||||
for ( let line of lines ) {
|
const pos = line.indexOf(' ');
|
||||||
let pos = line.indexOf(' ');
|
|
||||||
if ( pos > max ) { max = pos; }
|
if ( pos > max ) { max = pos; }
|
||||||
}
|
}
|
||||||
for ( let line of lines ) {
|
for ( const line of lines ) {
|
||||||
let pos = line.indexOf(' ');
|
const pos = line.indexOf(' ');
|
||||||
pretty.push(whitespaces.slice(0, max - pos) + line);
|
pretty.push(' '.repeat(max - pos) + line);
|
||||||
}
|
}
|
||||||
cmEditor.setValue(pretty.join('\n') + '\n');
|
pretty.push('');
|
||||||
|
cmEditor.setValue(pretty.join('\n'));
|
||||||
if ( first ) {
|
if ( first ) {
|
||||||
cmEditor.clearHistory();
|
cmEditor.clearHistory();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue