test(calendar): add Vim + Neovim integration harnesses
Add headless harnesses covering the calendar-vim integration, wired into CI alongside the existing keymap/config suites: - test-calendar-vim.sh/.vim (+ -optout.vim): pure-VimL diary hooks (calendar_sign markers, calendar_action path resolution from wiki root, calendar window close), plugin/nuwiki.vim hook auto-wiring that overrides calendar-vim's defaults, and opt-out via g:nuwiki_use_calendar and g:nuwiki_no_calendar. Uses a stub calendar-vim on the runtimepath. - test-calendar.sh/.lua: Neovim setup() wiring + window-close under the real window API, and opt-out via use_calendar = false. Fixes surfaced by the suite: - diary.vim: new diary entries set filetype 'vimwiki' (was the raw extension, e.g. 'wiki'); the stray FileType autocmd also blocked the calendar window from closing. - init.lua: drop the redundant Neovim FileType autocmd (plugin/nuwiki.vim already wires both editors) and translate use_calendar=false into g:nuwiki_no_calendar so the opt-out actually disables wiring.
This commit is contained in:
@@ -34,12 +34,10 @@ function! nuwiki#diary#calendar_action(day, month, year, week, dir) abort
|
||||
endif
|
||||
|
||||
execute 'edit ' . fnameescape(l:file_path)
|
||||
if !filereadable(l:file_path)
|
||||
if l:c.ext[0] ==# '.'
|
||||
execute 'setfiletype ' . l:c.ext[1:]
|
||||
else
|
||||
execute 'setfiletype ' . l:c.ext
|
||||
endif
|
||||
" A brand-new entry has no file on disk yet, so ftdetect may not have run;
|
||||
" ensure the vimwiki filetype so syntax/maps are active immediately.
|
||||
if &filetype !=# 'vimwiki'
|
||||
setfiletype vimwiki
|
||||
endif
|
||||
|
||||
" Close the calendar window now that the diary is open (keep at least one).
|
||||
|
||||
Reference in New Issue
Block a user