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