diff options
author | Sheogorath | 2018-06-23 21:27:05 +0200 |
---|---|---|
committer | Sheogorath | 2018-06-23 21:27:21 +0200 |
commit | 8fe26988d159b8ad3970f54f256245cece3efce5 (patch) | |
tree | 2a11febfee941631f08ef70eeb080397a6196306 /public/js/lib/editor | |
parent | 49db5bc6534bccaea89192d95a6a0e87d0cb28dd (diff) |
Fix all newly introduced linting issues
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to '')
-rw-r--r-- | public/js/lib/editor/utils.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/public/js/lib/editor/utils.js b/public/js/lib/editor/utils.js index 33670884..36e5c121 100644 --- a/public/js/lib/editor/utils.js +++ b/public/js/lib/editor/utils.js @@ -16,11 +16,11 @@ export function wrapTextWith (editor, cm, symbol) { let headIndex = editor.indexFromPos(ranges[i].head) cm.replaceRange(symbol + selection + symbol, from, to, '+input') if (anchorIndex > headIndex) { - ranges[i].anchor.ch+= symbol.length - ranges[i].head.ch+= symbol.length + ranges[i].anchor.ch += symbol.length + ranges[i].head.ch += symbol.length } else { - ranges[i].head.ch+= symbol.length - ranges[i].anchor.ch+= symbol.length + ranges[i].head.ch += symbol.length + ranges[i].anchor.ch += symbol.length } cm.setSelections(ranges) } else { @@ -54,7 +54,7 @@ export function insertText (cm, text, cursorEnd = 0) { cm.setCursor({line: cursor.line, ch: cursor.ch + cursorEnd}) } -export function insertLink(cm, isImage) { +export function insertLink (cm, isImage) { let cursor = cm.getCursor() let ranges = cm.listSelections() const linkEnd = '](https://)' @@ -71,16 +71,16 @@ export function insertLink(cm, isImage) { selection = symbol + selection + linkEnd cm.replaceRange(selection, from, to) if (anchorIndex > headIndex) { - ranges[i].anchor.ch+= symbol.length - ranges[i].head.ch+= symbol.length + ranges[i].anchor.ch += symbol.length + ranges[i].head.ch += symbol.length } else { - ranges[i].head.ch+= symbol.length - ranges[i].anchor.ch+= symbol.length + ranges[i].head.ch += symbol.length + ranges[i].anchor.ch += symbol.length } cm.setSelections(ranges) } else { cm.replaceRange(symbol + linkEnd, cursor, cursor) - cm.setCursor({line: cursor.line, ch: cursor.ch + symbol.length + linkend.length}) + cm.setCursor({line: cursor.line, ch: cursor.ch + symbol.length + linkEnd.length}) } } cm.focus() |