Comments (13)
Great, happy to hear it! :)
from wiki.vim.
Thanks. The problem is most likely due to external calls to the date
utilitity. Which system are you on? Linux, BSD, MacOS, ...? What's the output of date --version
in a terminal?
from wiki.vim.
Thanks for the prompt answer. The output of date --version
is:
date (GNU coreutils) 8.28
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
My system is Linux (Ubuntu 18.04).
from wiki.vim.
Suddenly it works. Strangely, I cannot reproduce the error anymore, although it occured consistently over the last three days when I tried.
Now, I tested creating a weekly summary of daily entries from a couple of months ago to test whether it only doesn't work for me to create a weekly summary when i'm inside the journal entry of "today". That worked and suddenly it also works from within the journal entry from "today".
Update: I could reproduce the error now. It only occurs when I got to the daily entry with
`n` <leader>w<leader>w |<plug>(wiki-journal)| [GLOBAL]
and then try :WikiJournalToWeek
. It does not occur when I directly open a diary entry via the terminal vim 2020-04-02.md
and than try the creation.
from wiki.vim.
Ok, so, the following steps reproduce the issue for you?
- start Vim/neovim
- do
<leader>w<leader>w
to open todays journal entry - type
:WikiJournalToWeek
from wiki.vim.
Do you get any error messages? If so, could you copy them here?
from wiki.vim.
Yes, those 3 steps reproduce the issue. Then an empty file opens and I just noticed an error message for the first time (the error does not appear immediately but only after clicking the enter key):
Error detected while processing function wiki#link#open:
line 4:
E716: Key not present in Dictionary: open, a:000, l:link)
E116: Invalid arguments for function call
E488: Trailing characters
And I realize that after :WikiJournalToWeek
the file name changes from 2020-04-02.md
to 2020-04-02’.md
.
from wiki.vim.
That does help somewhat, but not enough. It is difficult to debug without actually seeing what is happening on my end. Would you be able to add some debug code?
diff --git a/autoload/wiki/journal.vim b/autoload/wiki/journal.vim
index 6b2a973..483d88d 100644
--- a/autoload/wiki/journal.vim
+++ b/autoload/wiki/journal.vim
@@ -53,9 +53,12 @@ function! wiki#journal#freq(frq) abort " {{{1
let l:fmt = g:wiki_journal.date_format.daily
let l:rx = wiki#date#format_to_regex(l:fmt)
let l:date = l:filedate =~# l:rx ? l:filedate : strftime(l:fmt)
+ unsilent echom 'date' l:date "\n"
- call wiki#url#parse('journal:'
- \ . wiki#date#format(l:date, g:wiki_journal.date_format[a:frq])).open()
+ let l:newdate = wiki#date#format(l:date, g:wiki_journal.date_format[a:frq])
+ unsilent echom 'newdate' l:newdate "\n"
+
+ call wiki#url#parse('journal:' . l:newdate).open()
endfunction
" }}}1
If you apply the above patch, it should show some relevant output, I think. You might need to do :messages
after running the command to see the output. Could you report the output here?
from wiki.vim.
The output after applying the patch is:
date /home/skervim/wiki/journal/2020-04-02
newdate date: invalid date ‘/home/skervim/wiki/journal/2020-04-02’
from wiki.vim.
Next patch:
diff --git a/autoload/wiki/date.vim b/autoload/wiki/date.vim
index 2dba81a..28a216a 100644
--- a/autoload/wiki/date.vim
+++ b/autoload/wiki/date.vim
@@ -153,6 +153,8 @@ endfunction
" Utility functions for running GNU date or similar shell commands
"
function! s:date(date, format) abort " {{{1
+ unsilent echom 'gnudate' s:gnu_date
+ unsilent echom a:date '|' a:format "\n"
if s:gnu_date
return systemlist(printf('date +"%s" -d "%s"', a:format, a:date))[0]
else
This should show which parameters are passed to the date
utility.
from wiki.vim.
gnudate 1
/home/skervim/wiki/journal/2020-04-02 | %Y_w%V
from wiki.vim.
Ah, ok. I think I see now. Can you test latest version?
from wiki.vim.
It works! Thank you very much for the quick and successful fix!
from wiki.vim.
Related Issues (20)
- citekey: link to BibDesk (in wiki.vim too) [feature request] HOT 27
- Feature Request: Auto-Copy Text for WikiLinkFollow HOT 10
- Default keybinds not loading when attempting to use `adoc` HOT 3
- How can I avoid affecting certain default templates of wiki.vim HOT 3
- Possible to use one prefix to delimit a line of tags? HOT 3
- WikITocGenerate for more filetypes HOT 3
- WikiJournalNext / WikiJournalPrev navigate out of journal folder HOT 7
- Backlinks don't update immediately HOT 16
- WikiExport: cmd should use double quote under windows HOT 18
- How can g:wiki_export be configured to support HTML, docx, and PDF? HOT 4
- Using custom resolver breaks WikiJournalNext/WikiJournalPrev HOT 10
- Disabling default mappings might be broken HOT 2
- Provide dictionaries containing default mappings HOT 6
- Enhancement request for WikiJournalIndex: reverse order and update HOT 3
- Is it possible for wiki-link-types to support jumping to Vim help? HOT 7
- WikiTags can't work under gvim 9.1 or neovim 0.10 + win 10 pro HOT 19
- Infinite loop on template rendering if function starts at index 0 in template file HOT 1
- HTML text objects are overwritten by text objects for link texts HOT 3
- WikiLinkAdd in visual mode HOT 3
- Add completion source for `:WikiOpen`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wiki.vim.