Skip to content

Instantly share code, notes, and snippets.

@lesguillemets
Created May 1, 2014 10:03
Show Gist options
  • Save lesguillemets/3572a74dc04c5934f310 to your computer and use it in GitHub Desktop.
Save lesguillemets/3572a74dc04c5934f310 to your computer and use it in GitHub Desktop.
calling function <SNR>12_info('
')
line 1: if empty(a:char)
line 2: return 'NUL'
line 3: endif
line 4: let charseq = a:char
line 5: let outs = []
line 6: while !empty(charseq)
line 7: let nr = charseq ==# "\n" ? 0 : char2nr(charseq)
line 8: let char = nr < 32 ? '^'.nr2char(64 + nr) : nr2char(nr)
line 9: let charseq = strpart(charseq, len(nr2char(nr)))
line 10: let out = '<' . (empty(outs) ? '' : ' ') . char . '> ' . nr
line 11: if nr < 256
line 12: let out .= printf(', \%03o', nr)
line 13: endif
line 14: let out .= printf(', U+%04X', nr)
line 15: let out .= ' '.characterize#description(nr, '<unknown>')
calling function <SNR>12_info..characterize#description(0, '<unknown>')
line 1: return get(s:d, a:nr, a:0 ? a:1 : '')
function <SNR>12_info..characterize#description returning 'NULL'
continuing in function <SNR>12_info
line 16: for digraph in characterize#digraphs(nr)
calling function <SNR>12_info..characterize#digraphs(0)
line 1: if !exists('s:digraphs')
line 2: redir => out
line 3: silent digraphs
line 4: redir END
line 5: redraw
line 6: let s:digraphs = {}
line 7: for line in split(out, '\n')
line 8: for entry in split(line, " \\d\\+\\zs\\s*")
line 9: let nr = matchstr(entry, '\d\+$')
line 10: if nr ==# '10' && len(s:digraphs) <= 1
line 11: let nr = 0
line 12: endif
line 13: if !has_key(s:digraphs, nr)
line 14: let s:digraphs[nr] = []
line 15: endif
line 16: let s:digraphs[nr] += [matchstr(entry, '^..')]
line 17: endfor
line 18: endfor
line 19: endif
line 20: return a:0 ? get(s:digraphs, a:1, []) : s:digraphs
function <SNR>12_info..characterize#digraphs returning ['NU']
continuing in function <SNR>12_info
line 17: let out .= ", \<C-K>".digraph
line 18: endfor
line 16: for digraph in characterize#digraphs(nr)
line 17: let out .= ", \<C-K>".digraph
line 18: endfor
line 19: for emoji in characterize#emojis(nr)
calling function <SNR>12_info..characterize#emojis(0)
line 1: return a:0 ? get(s:emojis, a:1, []) : s:emojis
function <SNR>12_info..characterize#emojis returning []
continuing in function <SNR>12_info
line 20: let out .= ', '.emoji
line 21: endfor
line 22: let entity = characterize#html_entity(nr)
calling function <SNR>12_info..characterize#html_entity(0)
line 1: let char = get(s:html_entities, a:nr, '')
line 2: if !empty(char)
line 3: return '&' . char . ';'
line 4: else
line 5: return ''
function <SNR>12_info..characterize#html_entity returning ''
continuing in function <SNR>12_info
line 23: if !empty(entity)
line 24: let out .= ', '.entity
line 25: endif
line 26: call add(outs, out)
line 27: endwhile
line 6: while !empty(charseq)
line 7: let nr = charseq ==# "\n" ? 0 : char2nr(charseq)
line 8: let char = nr < 32 ? '^'.nr2char(64 + nr) : nr2char(nr)
line 9: let charseq = strpart(charseq, len(nr2char(nr)))
line 10: let out = '<' . (empty(outs) ? '' : ' ') . char . '> ' . nr
line 11: if nr < 256
line 12: let out .= printf(', \%03o', nr)
line 13: endif
line 14: let out .= printf(', U+%04X', nr)
line 15: let out .= ' '.characterize#description(nr, '<unknown>')
calling function <SNR>12_info..characterize#description(0, '<unknown>')
line 1: return get(s:d, a:nr, a:0 ? a:1 : '')
function <SNR>12_info..characterize#description returning 'NULL'
@lesguillemets
Copy link
Author

then loops at Line 21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment