diff options
author | Sheogorath | 2019-06-04 16:09:46 +0200 |
---|---|---|
committer | GitHub | 2019-06-04 16:09:46 +0200 |
commit | 6462968e84e8d92292dd23764a9e558d7800147d (patch) | |
tree | 03ab6b40402c79c766ffa05a0a09118c6987d540 /public/js/lib/editor | |
parent | ae32a129303fd14b3b2bd2f5b7bb0b0c0c8a7f81 (diff) | |
parent | 4da68597f701376307fe8849ed57edd3a80833ed (diff) |
Merge pull request #97 from SISheogorath/fix/linting
Fix eslint warnings
Diffstat (limited to '')
-rw-r--r-- | public/js/lib/editor/utils.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/public/js/lib/editor/utils.js b/public/js/lib/editor/utils.js index 36e5c121..d87c7e41 100644 --- a/public/js/lib/editor/utils.js +++ b/public/js/lib/editor/utils.js @@ -51,7 +51,7 @@ export function insertText (cm, text, cursorEnd = 0) { let cursor = cm.getCursor() cm.replaceSelection(text, cursor, cursor) cm.focus() - cm.setCursor({line: cursor.line, ch: cursor.ch + cursorEnd}) + cm.setCursor({ line: cursor.line, ch: cursor.ch + cursorEnd }) } export function insertLink (cm, isImage) { @@ -80,7 +80,7 @@ export function insertLink (cm, isImage) { 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() @@ -88,8 +88,8 @@ export function insertLink (cm, isImage) { export function insertHeader (cm) { let cursor = cm.getCursor() - let startOfLine = {line: cursor.line, ch: 0} - let startOfLineText = cm.getRange(startOfLine, {line: cursor.line, ch: 1}) + let startOfLine = { line: cursor.line, ch: 0 } + let startOfLineText = cm.getRange(startOfLine, { line: cursor.line, ch: 1 }) // See if it is already a header if (startOfLineText === '#') { cm.replaceRange('#', startOfLine, startOfLine) @@ -108,14 +108,14 @@ export function insertOnStartOfLines (cm, symbol) { if (!range.empty()) { const from = range.from() const to = range.to() - let selection = cm.getRange({line: from.line, ch: 0}, to) + let selection = cm.getRange({ line: from.line, ch: 0 }, to) selection = selection.replace(/\n/g, '\n' + symbol) selection = symbol + selection cm.replaceRange(selection, from, to) } else { - cm.replaceRange(symbol, {line: cursor.line, ch: 0}, {line: cursor.line, ch: 0}) + cm.replaceRange(symbol, { line: cursor.line, ch: 0 }, { line: cursor.line, ch: 0 }) } } - cm.setCursor({line: cursor.line, ch: cursor.ch + symbol.length}) + cm.setCursor({ line: cursor.line, ch: cursor.ch + symbol.length }) cm.focus() } |