Git Product home page Git Product logo

Comments (5)

michal-h21 avatar michal-h21 commented on May 18, 2024 3

Hi, sorry for the late reply. The support for the current Vimwiki version should work now.

from vim-zettel.

prurph avatar prurph commented on May 18, 2024 2

Okay, figured it out. I'm using a later version of vimwiki where the signature of update_listing_in_buffer has changed. Now it takes a generator for the first argument, and has an additional create argument.

I've never used vimscript before but I got it mostly working by changing insert_link_array like this:

" insert list of links to the current page
function! s:insert_link_array(title, lines)
  let links_rx = '\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxListBullet').'\)'
  " I have no idea how to just close over the argument directly
  let s:_lines = a:lines
  let GeneratorLinks = copy(l:)
  function! GeneratorLinks.f() abort
    return s:_lines
  endfunction
  call vimwiki#base#update_listing_in_buffer(GeneratorLinks, a:title, links_rx, line('$')+1, 1, 1)
endfunction

Now it appears to work. I just cobbled this together from copying the vimwiki code as I've never written VimL, so if anyone has some suggestions to spruce it up I'm all 👂.

from vim-zettel.

tiev avatar tiev commented on May 18, 2024

Thanks for the patch. I have the same problem. Can you create a PR?

from vim-zettel.

nathanbraun avatar nathanbraun commented on May 18, 2024

Having the same issue here.

from vim-zettel.

bharrisau avatar bharrisau commented on May 18, 2024

Came across this just now too. I closed over the arguments

" insert list of links to the current page
function! s:insert_link_array(title, lines)
  let links_rx = '\m^\s*'.vimwiki#u#escape(vimwiki#lst#default_symbol()).' '
  let gen = { 'lines': a:lines }

  function! gen.f() abort
      return self.lines
  endfunction

  call vimwiki#base#update_listing_in_buffer(gen, a:title, links_rx, line('$')+1, 1, 1)
endfunction

Should also be applied to zettel#vimwiki#generate_tags at the end of the file as that also calls vimwiki#base#update_listing_in_buffer. That change would look like this

  let links_rx = '\m\%(^\s*$\)\|\%('.vimwiki#vars#get_syntaxlocal('rxH2').'\)\|\%(^\s*'
        \ .vimwiki#u#escape(vimwiki#lst#default_symbol()).' '
        \ .vimwiki#vars#get_syntaxlocal('rxWikiLink').'$\)'
  let gen = { 'lines': lines }

  function! gen.f() abort
      return self.lines
  endfunction

  call vimwiki#base#update_listing_in_buffer(gen, 'Generated Tags', links_rx, line('$')+1, 1, 1)

from vim-zettel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.