Skip to content

Feature: public function with preformatted unicode data (for external fuzzy finder provider) #74

Description

@Grueslayer

Hi,

as this plugin

  • only supports fzf.vim
  • invisible chars (like control codes in the lower ascii range) needs different output (as in the UnicodeTable)
  • additional infos like html tags would be welcome
  • the chosen console colour code does not match my liking

I need access to some internal functions / variables or have a new public function like

fu! unicode#FuzzySource() abort "{{{2
    if !filereadable(s:data_cache_file) | exe 'UnicodeCache' | endif
    if !filereadable(s:data_cache_file)
        let s:fuzzy_source = []
        return s:WarningMsg('Failed to create the cache file')
    endif
    exe 'source ' . s:data_cache_file

    let l:fuzzydict = {}
    for [value,name] in items(g:unicode#unicode#data)
        let value  += 0
        let l:fuzzydict[value] = {
        \    'dec': value,
        \    'char': strtrans(nr2char(value)),
        \    'dig': <sid>GetDigraphChars(value),
        \    'html': <sid>GetHtmlEntity(value, 0),
        \    'codep': printf('U+%04X', value),
        \    'name': g:unicode#unicode#data[value] 
        \}
    endfor
    return l:fuzzydict
endfu

what do you think, should I make a PR for it?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions