File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ def link(external=False):
178
178
print ("HackerNews.vim Error: HTTP Request Timeout" )
179
179
return
180
180
save_pos ()
181
+ vim .command ("set syntax=hackernews" )
181
182
del vim .current .buffer [:]
182
183
if 'title' in item :
183
184
if 'domain' in item :
@@ -235,6 +236,7 @@ def link(external=False):
235
236
return
236
237
content = re .sub (r"(http\S+?)([\<\>\s\n])" , "[\g<1>]\g<2>" , content )
237
238
save_pos ()
239
+ vim .command ("set syntax=markdown" )
238
240
del vim .current .buffer [:]
239
241
for i , line in enumerate (content .split ('\n ' )):
240
242
if not line :
@@ -249,6 +251,7 @@ def save_pos():
249
251
marks = vim .eval ("g:hackernews_marks" )
250
252
m = hex (vim .current .buffer [0 ])
251
253
marks [m ] = list (vim .current .window .cursor )
254
+ marks [m ].append (vim .eval ("&syntax" ))
252
255
vim .command ("let g:hackernews_marks = %s" % str (marks ))
253
256
254
257
@@ -258,6 +261,7 @@ def recall_pos():
258
261
if m in marks :
259
262
mark = marks [m ]
260
263
vim .current .window .cursor = (int (mark [0 ]), int (mark [1 ]))
264
+ vim .command ("set syntax=%s" % mark [2 ])
261
265
262
266
263
267
def print_comments (comments , level = 0 ):
You can’t perform that action at this time.
0 commit comments