diff options
Diffstat (limited to 'app/assets/javascripts/repo/components/repo_preview.vue')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_preview.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/repo/components/repo_preview.vue b/app/assets/javascripts/repo/components/repo_preview.vue index 04732489c5f..9a9d200b8c6 100644 --- a/app/assets/javascripts/repo/components/repo_preview.vue +++ b/app/assets/javascripts/repo/components/repo_preview.vue @@ -14,6 +14,11 @@ export default { highlightFile() { $(this.$el).find('.file-content').syntaxHighlight(); }, + highlightLine() { + if (Store.activeLine > -1) { + this.lineHighlighter.highlightHash(`#L${Store.activeLine}`); + } + } }, mounted() { this.highlightFile(); @@ -26,10 +31,11 @@ export default { html() { this.$nextTick(() => { this.highlightFile(); + this.highlightLine(); }); }, activeLine() { - this.lineHighlighter.highlightHash(`#L${Store.activeLine}`); + this.highlightLine(); }, }, }; |