mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 23:27:20 +03:00
Autocomplete for \left command
Signed-off-by: Joao C. Monteiro <jcmonteiro@poli.ufrj.br>
This commit is contained in:
parent
a34eb07ed5
commit
b0ceb7ff68
@ -4,6 +4,21 @@
|
|||||||
"snippet":"begin{${1:env}}\n\t$2\n\\\\end{${1:env}}",
|
"snippet":"begin{${1:env}}\n\t$2\n\\\\end{${1:env}}",
|
||||||
"detail":"begin a new environment"
|
"detail":"begin a new environment"
|
||||||
},
|
},
|
||||||
|
"lrparen":{
|
||||||
|
"command":"left(",
|
||||||
|
"snippet":"left(${1}\\right)${0}",
|
||||||
|
"detail":"\\left( ... \\right)"
|
||||||
|
},
|
||||||
|
"lrbrack":{
|
||||||
|
"command":"left[",
|
||||||
|
"snippet":"left[${1}\\right]${0}",
|
||||||
|
"detail":"\\left[ ... \\right]"
|
||||||
|
},
|
||||||
|
"lrcurly":{
|
||||||
|
"command":"left\\{",
|
||||||
|
"snippet":"left\\{${1}\\right\\\\}${0}",
|
||||||
|
"detail":"\\left\\{ ... \\right\\}"
|
||||||
|
},
|
||||||
"latexinlinemath":{
|
"latexinlinemath":{
|
||||||
"command":"(",
|
"command":"(",
|
||||||
"snippet":"(${1}\\)${0}",
|
"snippet":"(${1}\\)${0}",
|
||||||
|
@ -48,7 +48,7 @@ export class Command {
|
|||||||
command.insertText = new vscode.SnippetString(item.snippet)
|
command.insertText = new vscode.SnippetString(item.snippet)
|
||||||
this.defaultCommands[key] = command
|
this.defaultCommands[key] = command
|
||||||
})
|
})
|
||||||
const bracketCommands = {'latexinlinemath': '(', 'latexdisplaymath': '[', 'curlybrackets': '{'}
|
const bracketCommands = {'latexinlinemath': '(', 'latexdisplaymath': '[', 'curlybrackets': '{', 'lrparen': 'left(', 'lrbrack': 'left[', 'lrcurly': 'left\\{'}
|
||||||
this.specialBrackets = Object.keys(this.defaultCommands)
|
this.specialBrackets = Object.keys(this.defaultCommands)
|
||||||
.filter(key => bracketCommands.hasOwnProperty(key))
|
.filter(key => bracketCommands.hasOwnProperty(key))
|
||||||
.reduce((obj, key) => {
|
.reduce((obj, key) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user