summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ftplugin/hackernews.py6
-rw-r--r--plugin/hackernews.vim3
2 files changed, 4 insertions, 5 deletions
diff --git a/ftplugin/hackernews.py b/ftplugin/hackernews.py
index f081733..94f1a90 100644
--- a/ftplugin/hackernews.py
+++ b/ftplugin/hackernews.py
@@ -215,10 +215,12 @@ def link(external=False):
print_comments([item])
else:
print_comments(item['comments'])
+ # Prevent syntax issues in long comment threads with code blocks
+ vim.command("syntax sync fromstart")
# Highlight OP username in comment titles
if 'level' not in item:
- vim.command("syn clear Question")
- vim.command("syn match Question /%s/ contained" % item['user'])
+ vim.command("syntax clear Question")
+ vim.command("syntax match Question /%s/ contained" % item['user'])
elif url:
if external:
diff --git a/plugin/hackernews.vim b/plugin/hackernews.vim
index c4e060b..bbe8200 100644
--- a/plugin/hackernews.vim
+++ b/plugin/hackernews.vim
@@ -14,9 +14,6 @@ filetype plugin on
" Load ftplugin when opening .hackernews buffer
au! BufRead,BufNewFile *.hackernews set filetype=hackernews
-" Prevent syntax highlighting issues in long comment threads with code blocks
-au! BufEnter *.hackernews syntax sync fromstart
-
" Set required defaults
if !exists("g:hackernews_stories")