From 972baa34d26f283a10a0cc86a11ed9211ad9c949 Mon Sep 17 00:00:00 2001 From: ryanss Date: Thu, 19 Mar 2015 23:59:00 -0400 Subject: Add hidden item id links to comment header lines --- ftplugin/hackernews.py | 4 ++-- syntax/hackernews.vim | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ftplugin/hackernews.py b/ftplugin/hackernews.py index 37f1e05..65938ae 100644 --- a/ftplugin/hackernews.py +++ b/ftplugin/hackernews.py @@ -253,9 +253,9 @@ def print_comments(comments, level=0): for comment in comments: if 'level' in comment: # This is a comment (not content) so add comment header - bwrite("%sComment by %s %s:" + bwrite("%sComment by %s %s: [%s]" % (" "*level*4, comment.get('user', '???'), - comment['time_ago'])) + comment['time_ago'], comment['id'])) for p in comment['content'].split("

"): if not p: continue diff --git a/syntax/hackernews.vim b/syntax/hackernews.vim index 390d2a3..27c41ad 100644 --- a/syntax/hackernews.vim +++ b/syntax/hackernews.vim @@ -39,7 +39,7 @@ syn match Comment /^.*ago\s|.*comments/ syn match Comment /^[0-9an]\+\s.\+\sago$/ " Comment titles -syn match Comment /^\s*Comment\sby.\+ago:$/ contains=Question +syn match Comment /^\s*Comment\sby.\+ago:/ contains=Question " Highlight links syn region Constant start="\[http" end="\]" -- cgit v1.2.3