Fix bad indentation on paste
I don't fully understand why this is working differently, but these changes enable proper behavior on pasting ql into the editor.
This commit is contained in:
@@ -30,9 +30,5 @@
|
|||||||
"end": "^\\s*//\\s*#?endregion\\b"
|
"end": "^\\s*//\\s*#?endregion\\b"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\.\\<\\>\\/\\?\\s]+)",
|
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\.\\<\\>\\/\\?\\s]+)"
|
||||||
"indentationRules": {
|
|
||||||
"increaseIndentPattern": "^((?!.*?\\/\\*).*\\*/)?\\s*[\\}\\]].*$",
|
|
||||||
"decreaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"']*|\\([^)\"']*|\\[[^\\]\"']*)$"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,11 +17,14 @@ export function install() {
|
|||||||
// setLanguageConfiguration requires a regexp for the wordpattern, not a string
|
// setLanguageConfiguration requires a regexp for the wordpattern, not a string
|
||||||
langConfig.wordPattern = new RegExp(langConfig.wordPattern);
|
langConfig.wordPattern = new RegExp(langConfig.wordPattern);
|
||||||
langConfig.onEnterRules = onEnterRules;
|
langConfig.onEnterRules = onEnterRules;
|
||||||
|
langConfig.indentationRules = {
|
||||||
|
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,
|
||||||
|
increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/
|
||||||
|
};
|
||||||
|
|
||||||
languages.setLanguageConfiguration('ql', langConfig);
|
languages.setLanguageConfiguration('ql', langConfig);
|
||||||
languages.setLanguageConfiguration('qll', langConfig);
|
languages.setLanguageConfiguration('qll', langConfig);
|
||||||
languages.setLanguageConfiguration('dbscheme', langConfig);
|
languages.setLanguageConfiguration('dbscheme', langConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onEnterRules = [
|
const onEnterRules = [
|
||||||
|
|||||||
Reference in New Issue
Block a user