Commits

Shrikant Sharat Kandula committed c4f8752

Refactoring and some debug helping code.

Comments (0)

Files changed (1)

plugin/twitvim.vim

 
 " Add update to Twitter buffer if public, friends, or user timeline.
 function! s:add_update(output)
-    if has_key(s:curbuffer, 'buftype') && (s:curbuffer.buftype == "public" || s:curbuffer.buftype == "friends" || s:curbuffer.buftype == "user" || s:curbuffer.buftype == "replies" || s:curbuffer.buftype == "list" || s:curbuffer.buftype == "retweeted_by_me" || s:curbuffer.buftype == "retweeted_to_me")
+    if has_key(s:curbuffer, 'buftype') && (
+                \ s:curbuffer.buftype == "public" ||
+                \ s:curbuffer.buftype == "friends" ||
+                \ s:curbuffer.buftype == "user" ||
+                \ s:curbuffer.buftype == "replies" ||
+                \ s:curbuffer.buftype == "list" ||
+                \ s:curbuffer.buftype == "retweeted_by_me" ||
+                \ s:curbuffer.buftype == "retweeted_to_me"
+                \)
 
         " Parse the output from the Twitter update call.
-        let lines = s:format_status_xml(a:output)
+        let g:output = output
+        return
+        let lines = s:format_status(a:output)
 
         " Line number where new tweet will be inserted. It should be 2 if
         " header is shown and 1 if header is hidden.
     if error != ''
         let errormsg = s:xml_get_element(output, 'error')
         call s:errormsg("Error retweeting: ".(errormsg != '' ? errormsg : error))
-    "" This is a retweet, you don't add it to the timeline. Moreover, the adding is done
-    "" independent of what *page* is being viewed.
-    " else
-        " call s:add_update(output)
-        " redraw
+    else
+        call s:add_update(output)
+        redraw
         echo "Retweeted."
     endif
 endfunction