vimwiki-backup / vimwiki

Automatically exported from code.google.com/p/vimwiki
1 stars 1 forks source link

can not open diaries other than today's within Calender #347

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. open a wiki file
2. load in calender
3. from calender, try open a diary on a highlighted date

What is the expected output? What do you see instead?
open that date's diary. wiki opens today's diary instead

What version of the product are you using? On what operating system?
2.0

Please provide any additional information below.

Original issue reported on code.google.com by hyan...@gmail.com on 25 Jun 2012 at 3:51

GoogleCodeExporter commented 8 years ago
Thx!

Original comment by habamax on 26 Jun 2012 at 3:36

GoogleCodeExporter commented 8 years ago
Stuart, could you please make changes to diary#make_note function?

function! vimwiki#diary#make_note(wnum, ...) "{{{
  if a:wnum > len(g:vimwiki_list)
    echom "vimwiki: Wiki ".a:wnum." is not registered in g:vimwiki_list!"
    return
  endif

  " TODO: refactor it. base#goto_index uses the same
  if a:wnum > 0
    let idx = a:wnum - 1
  else
    let idx = 0
  endif

  call vimwiki#base#validate_wiki_options(idx)
  call vimwiki#base#mkdir(VimwikiGet('path', idx).VimwikiGet('diary_rel_path', idx))

  if a:0 && a:1 == 1
    let cmd = 'tabedit'
  else
    let cmd = 'edit'
  endif
  if a:0 > 1
    let link = 'diary:'.a:2
  else
    let link = 'diary:'.s:diary_date_link(idx)
  endif

  call vimwiki#base#open_link(cmd, link, s:diary_index(idx))
  call vimwiki#base#setup_buffer_state(idx)
endfunction "}}}

It is all about 'if a:0' part. I, unfortunatly, am still waiting for my dev 
laptop to be fixed.

Original comment by habamax on 26 Jun 2012 at 3:55

GoogleCodeExporter commented 8 years ago
Fixed by r9734edf9c0da and r80c11e58a4f0

Original comment by stu.andrews on 26 Jun 2012 at 2:56

GoogleCodeExporter commented 8 years ago
Thanks guys.

Original comment by hyan...@gmail.com on 27 Jun 2012 at 2:54