Skip to content

Commit

Permalink
Strip brainstormy-type comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
chreekat committed Dec 2, 2012
1 parent 14963d4 commit a4a4342
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions after/ftplugin/markdown/instant-markdown.vim
@@ -1,45 +1,3 @@
function! UpdateMarkdown()
let buf = join(getline(1, "$"), "\n")
if (b:im_needs_init)
let b:im_needs_init = 0
call system("instant-markdown-d &>/dev/null &", buf)
endif
if (b:last_number_of_changes == "" || b:last_number_of_changes != b:changedtick)
let b:last_number_of_changes = b:changedtick
call system("curl -X PUT -T - http://localhost:8090/ &>/dev/null &", buf)
endif
endfunction

function! OpenMarkdown()
let b:last_number_of_changes = ""
let b:im_needs_init = 1
endfunction

function! CloseMarkdown()
call system("curl -s -X DELETE http://localhost:8090/ &>/dev/null &")
endfunction

" autocmd CursorMoved,CursorMovedI,CursorHold,CursorHoldI <buffer> silent call UpdateMarkdown()
" autocmd BufWinLeave <buffer> silent call CloseMarkdown()
" autocmd BufWinEnter <buffer> silent call OpenMarkdown()

" BufEnter:
" Refresh view in case we came from a different markdown file. This should
" only fire if BufWinEnter has already happened; so BufWinEnter and BufWinLeave
" must create and delete the autocmd.
"
" Save implementing it for later.
"
" BufWinEnter:
" Number of markdown buffers = 0? Start daemon. Add self to list.
" Refresh view.
"
" BufWinLeave:
" Remove self from view. Number of markdown buffers = 0? Kill daemon.
"
" When it's time, we want to refresh. What signifies "it is time?" the right
" autocmds, obviously. And they are: CursorMoved, CursorHold

" # UTILITY FUNCTIONS
function! s:refreshView()
let bufnr = expand('<bufnr>')
Expand Down Expand Up @@ -94,7 +52,6 @@ fu! s:myBufNr()
return str2nr(expand('<abuf>'))
endfu

" # Hur we go
" ## push a new Markdown buffer into the system.
"
" 1. Track it so we know when to garbage collect the daemon
Expand Down

0 comments on commit a4a4342

Please sign in to comment.