diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-10-05 12:54:46 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-10-05 12:54:46 +0300 |
commit | 8b16f1074ddb6ea6a5404d37409ab81002f28d52 (patch) | |
tree | aca5904f189a8353fd56942b2c28a2bfbdab7923 /app/assets/javascripts/repo/components/repo_editor.vue | |
parent | 8d14a95638d7d6b52254b192b3e54296e22fddc3 (diff) |
Refactored Highlighting mechanism
Diffstat (limited to 'app/assets/javascripts/repo/components/repo_editor.vue')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_editor.vue | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/repo/components/repo_editor.vue b/app/assets/javascripts/repo/components/repo_editor.vue index f1acd339ad3..02d9c775046 100644 --- a/app/assets/javascripts/repo/components/repo_editor.vue +++ b/app/assets/javascripts/repo/components/repo_editor.vue @@ -64,11 +64,6 @@ const RepoEditor = { if (e.target.element.classList.contains('line-numbers')) { location.hash = `L${lineNumber}`; Store.setActiveLine(lineNumber); - - Helper.monacoInstance.setPosition({ - lineNumber: this.activeLine, - column: 1, - }); } }, }, @@ -101,6 +96,15 @@ const RepoEditor = { this.setupEditor(); } }, + + activeLine() { + if (Helper.monacoInstance) { + Helper.monacoInstance.setPosition({ + lineNumber: this.activeLine, + column: 1, + }); + } + }, }, computed: { shouldHideEditor() { |