Skip to content

Instantly share code, notes, and snippets.

@fishman
Created May 3, 2009 23:38
Show Gist options
  • Save fishman/106199 to your computer and use it in GitHub Desktop.
Save fishman/106199 to your computer and use it in GitHub Desktop.
let s:Marker = {}
let s:Marker.revlookup = {}
function! s:Marker.addRevlookup(lnum, index, istab)
" get current list of tabstops per line
if !exists('s:Marker.revlookup[a:lnum]')
if a:istab
let lookupList = {'tab': [a:index], 'ph': []}
else
let lookupList = {'tab': [], 'ph': [a:index]}
endif
let s:Marker.revlookup[a:lnum] = lookupList
else
if a:istab
key = 'tab'
else
key = 'ph'
endif
let tabList = s:Marker.revlookup[a:lnum][key]
let s:Marker.revlookup[a:lnum][key] = add(tabList, a:index)
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment