summaryrefslogtreecommitdiff
path: root/ftplugin
diff options
context:
space:
mode:
authorryanss2015-08-27 23:59:00 -0400
committerryanss2015-08-28 23:59:00 -0400
commitb3a25f78abc1455e7eebef00d212ff3ace798b1e (patch)
tree08a790e7ed955e93d0df5b02a113d6ba01b65312 /ftplugin
parent0224a7839e4e47d4de1fe07514e19b16c0858d27 (diff)
downloadvim-hn-b3a25f78abc1455e7eebef00d212ff3ace798b1e.tar.gz
Prevent syntax issues in long threads with code blocks
Example comments [10114881]
Diffstat (limited to 'ftplugin')
-rw-r--r--ftplugin/hackernews.py6
1 files changed, 4 insertions, 2 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: