Skip to content

Commit

Permalink
Resolved #295: Added \langle \rangle.
Browse files Browse the repository at this point in the history
  • Loading branch information
HannahSchellekens committed Feb 25, 2018
1 parent 31a777b commit bdd77e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -20,6 +20,9 @@ open class RightInsertHandler : InsertHandler<LookupElement> {
if (name.startsWith("left")) {
insertRight(name, editor)
}
else if (name == "langle") {
insertRangle(editor)
}
}

private fun insertRight(commandName: String, editor: Editor) {
Expand All @@ -28,4 +31,9 @@ open class RightInsertHandler : InsertHandler<LookupElement> {
editor.document.insertString(editor.caretModel.offset, " \\right$opposite")
editor.caretModel.moveToOffset(editor.caretModel.offset + 1)
}

private fun insertRangle(editor: Editor) {
editor.document.insertString(editor.caretModel.offset, " \\rangle")
editor.caretModel.moveToOffset(editor.caretModel.offset + 1)
}
}
2 changes: 2 additions & 0 deletions src/nl/rubensten/texifyidea/lang/LatexMathCommand.kt
Expand Up @@ -178,6 +178,8 @@ enum class LatexMathCommand(
RIGHT_PIPE("right|", display = "|"),
LEFT_DOUBLE_PIPE("left\\|", display = "||"),
RIGHT_DOUBLE_PIPE("right\\|", display = "||"),
LANGLE("langle", display = "<"),
RANGLE("rangle", display = ">"),

/*
* Arrows
Expand Down

0 comments on commit bdd77e4

Please sign in to comment.