Fix vimwiki#diary#calendar_sign when g:vimwiki_list is not set
If a user is happy with the default vimwiki location, they may not set the g:vimwiki_list global variable. In this case, the len(g:vimwiki_list) vimwiki#diary#calendar_sign function throws an error every time it is called. This function is called for every day displayed in the calendar which is very noisy. Checking if the variable exists before doing the length check prevents the error and the rest of the function works fine if the variable is not set.
This commit is contained in:
@@ -523,7 +523,7 @@ endfunction
|
|||||||
function! vimwiki#diary#calendar_sign(day, month, year) abort
|
function! vimwiki#diary#calendar_sign(day, month, year) abort
|
||||||
" Callback function for Calendar.vim
|
" Callback function for Calendar.vim
|
||||||
" Clause: no wiki no sign #290
|
" Clause: no wiki no sign #290
|
||||||
if len(g:vimwiki_list) <= 0
|
if exists('g:vimwiki_list') && len(g:vimwiki_list) <= 0
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let day = s:prefix_zero(a:day)
|
let day = s:prefix_zero(a:day)
|
||||||
|
|||||||
@@ -4002,6 +4002,7 @@ Contributors and their Github usernames in roughly chronological order:
|
|||||||
- Thomas Leyh (@leyhline)
|
- Thomas Leyh (@leyhline)
|
||||||
- nebulaeandstars (@nebulaeandstars)
|
- nebulaeandstars (@nebulaeandstars)
|
||||||
- dmitry kim (@jsn)
|
- dmitry kim (@jsn)
|
||||||
|
- Luke Atkinson (@LukeDAtkinson)
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
16. Changelog *vimwiki-changelog*
|
16. Changelog *vimwiki-changelog*
|
||||||
@@ -4021,6 +4022,12 @@ This is somewhat experimental, and will probably be refined over time.
|
|||||||
|
|
||||||
2023.04.04~
|
2023.04.04~
|
||||||
|
|
||||||
|
Fixed:~
|
||||||
|
* Issue #1336: vimwiki#diary#calendar_sign throws an error
|
||||||
|
when g:vimwiki_list is not set
|
||||||
|
|
||||||
|
2023.04.04~
|
||||||
|
|
||||||
New:~
|
New:~
|
||||||
* Issue #1261: Feature: Support for <mark> in Markdown
|
* Issue #1261: Feature: Support for <mark> in Markdown
|
||||||
highlighting with yellow background and back foreground
|
highlighting with yellow background and back foreground
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ endif
|
|||||||
let g:loaded_vimwiki = 1
|
let g:loaded_vimwiki = 1
|
||||||
|
|
||||||
" Set to version number for release:
|
" Set to version number for release:
|
||||||
let g:vimwiki_version = '2023.04.04'
|
let g:vimwiki_version = '2023.05.12'
|
||||||
|
|
||||||
" Get the directory the script is installed in
|
" Get the directory the script is installed in
|
||||||
let s:plugin_dir = expand('<sfile>:p:h:h')
|
let s:plugin_dir = expand('<sfile>:p:h:h')
|
||||||
|
|||||||
+1
-1
@@ -257,7 +257,7 @@ Expect (Correctly formatted tags file):
|
|||||||
!_TAG_PROGRAM_AUTHOR Vimwiki
|
!_TAG_PROGRAM_AUTHOR Vimwiki
|
||||||
!_TAG_PROGRAM_NAME Vimwiki Tags
|
!_TAG_PROGRAM_NAME Vimwiki Tags
|
||||||
!_TAG_PROGRAM_URL https://github.com/vimwiki/vimwiki
|
!_TAG_PROGRAM_URL https://github.com/vimwiki/vimwiki
|
||||||
!_TAG_PROGRAM_VERSION 2023.04.04
|
!_TAG_PROGRAM_VERSION 2023.05.12
|
||||||
second-tag Test-Tag.md 13;" vimwiki:Test-Tag\tTest-Tag#second-tag\tTest-Tag#second-tag
|
second-tag Test-Tag.md 13;" vimwiki:Test-Tag\tTest-Tag#second-tag\tTest-Tag#second-tag
|
||||||
test-tag Test-Tag.md 5;" vimwiki:Test-Tag\tTest-Tag#a-header\tA header
|
test-tag Test-Tag.md 5;" vimwiki:Test-Tag\tTest-Tag#a-header\tA header
|
||||||
top-tag Test-Tag.md 1;" vimwiki:Test-Tag\tTest-Tag\tTest-Tag
|
top-tag Test-Tag.md 1;" vimwiki:Test-Tag\tTest-Tag\tTest-Tag
|
||||||
|
|||||||
Reference in New Issue
Block a user