[SCM] vim-scripts packaging branch, master, updated. v20091011-7-g153d936
James Vega
jamessan at debian.org
Tue Jan 26 22:26:45 UTC 2010
The following commit has been merged in the master branch:
commit 9738f398ca8d8f143532eec43824d0bed0445fe1
Author: James Vega <jamessan at debian.org>
Date: Tue Jan 26 17:14:56 2010 -0500
Update calendar to 2.0
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 3a428c7..b5747e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,7 @@ vim-scripts (20091012) UNRELEASED; urgency=low
- DoxygenToolkit: Update to 0.2.7
- Color Sampler Pack: Update to 8.03
- vcscommand: Update to 1.99.35
+ - calendar: Update to 2.0
-- James Vega <jamessan at debian.org> Sun, 24 Jan 2010 17:10:16 -0500
diff --git a/debian/patches/disabledby-calendar.diff b/debian/patches/disabledby-calendar.diff
index e7439e0..dd02987 100644
--- a/debian/patches/disabledby-calendar.diff
+++ b/debian/patches/disabledby-calendar.diff
@@ -4,16 +4,16 @@ Index: vim-scripts/plugin/calendar.vim
===================================================================
--- vim-scripts.orig/plugin/calendar.vim
+++ vim-scripts/plugin/calendar.vim
-@@ -305,10 +305,10 @@
+@@ -315,10 +315,10 @@
" :echo calendar_version
" GetLatestVimScripts: 52 1 :AutoInstall: calendar.vim
--let g:calendar_version = "1.8"
+-let g:calendar_version = "2.0"
-if &compatible
+if &compatible || exists("g:calendar_version")
finish
endif
-+let g:calendar_version = "1.8"
++let g:calendar_version = "2.0"
if !exists("g:calendar_action")
let g:calendar_action = "<SID>CalendarDiary"
diff --git a/debian/vim-scripts.status b/debian/vim-scripts.status
index e954dbe..b511dbc 100644
--- a/debian/vim-scripts.status
+++ b/debian/vim-scripts.status
@@ -92,7 +92,7 @@ author_url: http://www.vim.org/account/profile.php?user_id=103
email: mattn.jp at gmail.com
license: no license
disabledby: let calendar_version = 1
-version: 1.8
+version: 2.0
script_name: plugin/winmanager.vim
addon: winmanager
diff --git a/html/index.html b/html/index.html
index 31e4a06..e432ca6 100644
--- a/html/index.html
+++ b/html/index.html
@@ -50,7 +50,7 @@
<li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
</ul>
<p>
- Page generated on Tue, 26 Jan 2010 17:05:50 -0500
+ Page generated on Tue, 26 Jan 2010 17:13:48 -0500
.
</p>
</body>
diff --git a/html/plugin_calendar.vim.html b/html/plugin_calendar.vim.html
index 963941c..22ba5de 100644
--- a/html/plugin_calendar.vim.html
+++ b/html/plugin_calendar.vim.html
@@ -166,8 +166,8 @@
<tr>
<td class="lightbg"><b> script karma </b></td>
<td>
- Rating <b>1286/528</b>,
- Downloaded by 24073 </td>
+ Rating <b>1335/544</b>,
+ Downloaded by 25267 </td>
</tr>
</table>
<p>
@@ -217,6 +217,22 @@ Click on the package to download.
<th valign="top">release notes</th>
</tr>
<tr>
+ <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=11795">calendar.vim</a></td>
+ <td class="rowodd" valign="top" nowrap><b>2.0</b></td>
+ <td class="rowodd" valign="top" nowrap><i>2009-11-24</i></td>
+ <td class="rowodd" valign="top" nowrap>6.0</td>
+ <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=103">Yasuhiro Matsumoto</a></i></td>
+ <td class="rowodd" valign="top" width="2000">Applied patch from Ingo Karkat. Thanks.<br><br>- ENH: Added a config setting g:calendar_datetime. This allows to remove the<br>display of the current date/time in the title (I don't like it), and offers the<br>window's statusline as an alternative.<br><br>- BUG: The checks for g:calendar_action and g:calendar_sign should also check<br>for an existing, but empty variable. Otherwise, it is not possible to disable it<br>in a .vimrc, because the sourcing of calendar.vim would initialize the variables.<br><br>- BUG: In s:CalendarDoAction(), the check for g:calendar_action must come after<br>the "navi" handling; otherwise "navi" breaks if g:calendar_action is disabled<br>(see above).<br><br>- ENH: The :set wrapscan is ugly, because it is a global setting. The search()<br>commands already pass the 'w' flag, so the only remaining issue were the<br>searches via /. I modified the 'G0/...' search to 'G$?' (i.e. backward from end<br>of buffer), so that 'wrapscan' isn't required any more. (Even better would be to<br>use search() for these jumps, too.) With this, I can also completely get rid of<br>the autocmds in case one does not want the date/time in the title, neither (see<br>above).<br><br>- Using :setlocal buftype=nofile instead of =nowrite; this is more suitable for<br>this kind of scratch buffer, and avoids that the path may be shown in the title<br>/ statusline (depending on the customization).<br><br>- BUG: Replaced :setlocal nowrap with 'wrap'. Without this, the 'sidescrolloff'<br>setting may cause the left side of the calendar to disappear if the last<br>inserted element is near the right window border. 'wrap' shouldn't matter,<br>anyway, and 'sidescrolloff' is a global setting, unfortunately.<br>Try :set sidescrolloff=3 in combination with :let g:calendar_navi = 'bottom' to<br>reproduce.<br><br>- BUG: The :normal i... for the navi rendering causes a trailing space after the<br>"Next>" button. This way, I cannot quickly type "G$<CR>" to activate the next<br>button. Now using :normal a... to append. This causes the entire navi to shift<br>one character to the right, but you could fix this by decreasing the column<br>counter.<br><br>- ENH: Use :stopinsert in case we've gotten here from insert mode (via<br><C-O>:Calendar<CR>)...<br><br>- Using :wincmd w instead of :normal <C-w>; it's simpler. (And you should always<br>use :normal! (with a bang) to avoid interference with user remappings!)<br><br>- ENH: I noticed that <left> and <s-left> do the same thing, but in different<br>ways (one uses the navi and the latter is called by the former). I dropped the<br>unintuitive shift mappings and instead do the jumps consistently in the navi,<br>using the b:Calendar... variables instead of that ugly maparg() stuff.<br><br>- ENH: I noticed that <left> and <up> do the same thing. I changed <up>/<down><br>to move an entire year, so one can quickly let the years pass...<br><br>- ENH: the 'q' mapping now returns to the previous window, not the first one.<br></td>
+</tr>
+<tr>
+ <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=11771">calendar.vim</a></td>
+ <td class="roweven" valign="top" nowrap><b>1.9</b></td>
+ <td class="roweven" valign="top" nowrap><i>2009-11-20</i></td>
+ <td class="roweven" valign="top" nowrap>6.0</td>
+ <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=103">Yasuhiro Matsumoto</a></i></td>
+ <td class="roweven" valign="top" width="2000">This is an upgrade for calendar.vim. use nnoremap.<br></td>
+</tr>
+<tr>
<td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=11496">calendar.vim</a></td>
<td class="rowodd" valign="top" nowrap><b>1.8</b></td>
<td class="rowodd" valign="top" nowrap><i>2009-10-08</i></td>
diff --git a/plugin/calendar.vim b/plugin/calendar.vim
index 041fa29..1055ca5 100644
--- a/plugin/calendar.vim
+++ b/plugin/calendar.vim
@@ -2,9 +2,11 @@
" What Is This: Calendar
" File: calendar.vim
" Author: Yasuhiro Matsumoto <mattn.jp at gmail.com>
-" Last Change: Thu, 08 Oct 2009
-" Version: 1.8
+" Last Change: Tue, 24 Nov 2009
+" Version: 2.0
" Thanks:
+" Ingo Karkat : bug fix
+" Thinca : bug report
" Yu Pei : bug report
" Per Winkvist : bug fix
" Serge (gentoosiast) Koksharov : bug fix
@@ -54,6 +56,8 @@
" <Leader>ch
" show horizontal calendar ...
" ChangeLog:
+" 2.0 : bug fix, many bug fix and enhancements.
+" 1.9 : bug fix, use nnoremap.
" 1.8 : bug fix, E382 when close diary.
" 1.7 : bug fix, week number was broken on 2008.
" 1.6 : added calendar_begin action.
@@ -254,6 +258,12 @@
" let g:calendar_weeknm = 3 " KW01
" let g:calendar_weeknm = 4 " KW 1
"
+" *if you want to show the current date and time, add below to your .vimrc:
+"
+" let g:calendar_datetime = 'title'
+"
+" NOTE:you can set 'title', 'statusline', '' for this option.
+"
" *if you want to hook calender when pressing enter,
" add this to your .vimrc:
"
@@ -305,7 +315,7 @@
" :echo calendar_version
" GetLatestVimScripts: 52 1 :AutoInstall: calendar.vim
-let g:calendar_version = "1.8"
+let g:calendar_version = "2.0"
if &compatible
finish
endif
@@ -338,12 +348,18 @@ endif
if !exists("g:calendar_focus_today")
let g:calendar_focus_today = 0
endif
+if !exists("g:calendar_datetime")
+ \|| (g:calendar_datetime != ''
+ \&& g:calendar_datetime != 'title'
+ \&& g:calendar_datetime != 'statusline')
+ let g:calendar_datetime = 'title'
+endif
"*****************************************************************
"* Calendar commands
"*****************************************************************
-:command! -nargs=* Calendar call Calendar(0,<f-args>)
-:command! -nargs=* CalendarH call Calendar(1,<f-args>)
+command! -nargs=* Calendar call Calendar(0,<f-args>)
+command! -nargs=* CalendarH call Calendar(1,<f-args>)
if !hasmapto("<Plug>CalendarV")
nmap <unique> <Leader>cal <Plug>CalendarV
@@ -351,8 +367,8 @@ endif
if !hasmapto("<Plug>CalendarH")
nmap <unique> <Leader>caL <Plug>CalendarH
endif
-nmap <silent> <Plug>CalendarV :cal Calendar(0)<CR>
-nmap <silent> <Plug>CalendarH :cal Calendar(1)<CR>
+nnoremap <silent> <Plug>CalendarV :cal Calendar(0)<CR>
+nnoremap <silent> <Plug>CalendarH :cal Calendar(1)<CR>
"*****************************************************************
"* GetToken : get token from source with count
@@ -388,19 +404,22 @@ endfunction
"*----------------------------------------------------------------
"*****************************************************************
function! s:CalendarDoAction(...)
- " if no action defined return
- if !exists("g:calendar_action")
- return
- endif
-
" for navi
if exists('g:calendar_navi')
let navi = (a:0 > 0)? a:1 : expand("<cWORD>")
let curl = line(".")
if navi == '<' . s:GetToken(g:calendar_navi_label, ',', 1)
- exec substitute(maparg('<s-left>', 'n'), '<CR>', '', '')
+ if b:CalendarMonth > 1
+ call Calendar(b:CalendarDir, b:CalendarYear, b:CalendarMonth-1)
+ else
+ call Calendar(b:CalendarDir, b:CalendarYear-1, 12)
+ endif
elseif navi == s:GetToken(g:calendar_navi_label, ',', 3) . '>'
- exec substitute(maparg('<s-right>', 'n'), '<CR>', '', '')
+ if b:CalendarMonth < 12
+ call Calendar(b:CalendarDir, b:CalendarYear, b:CalendarMonth+1)
+ else
+ call Calendar(b:CalendarDir, b:CalendarYear+1, 1)
+ endif
elseif navi == s:GetToken(g:calendar_navi_label, ',', 2)
call Calendar(b:CalendarDir)
if exists('g:calendar_today')
@@ -414,18 +433,21 @@ function! s:CalendarDoAction(...)
silent execute "normal! gg/\*\<cr>"
return
else
- setlocal ws
if curl < line('$')/2
silent execute "normal! gg0/".navi."\<cr>"
else
- silent execute "normal! G0/".navi."\<cr>"
+ silent execute "normal! G$?".navi."\<cr>"
endif
- setlocal nows
return
endif
endif
endif
+ " if no action defined return
+ if !exists("g:calendar_action") || g:calendar_action == ""
+ return
+ endif
+
if b:CalendarDir
let dir = 'H'
if !exists('g:calendar_monday') && exists('g:calendar_weeknm')
@@ -741,7 +763,7 @@ function! Calendar(...)
else
let vtarget = vtarget.vdaycur
endif
- if exists("g:calendar_sign")
+ if exists("g:calendar_sign") && g:calendar_sign != ""
exe "let vsign = " . g:calendar_sign . "(vdaycur, vmnth, vyear)"
if vsign != ""
let vsign = vsign[0]
@@ -946,15 +968,15 @@ function! Calendar(...)
if vwinnum >= 0
" if already exist
if vwinnum != bufwinnr('%')
- exe "normal \<c-w>".vwinnum."w"
+ exe vwinnum . 'wincmd w'
endif
setlocal modifiable
silent %d _
else
" make title
- if (!exists('s:bufautocommandsset'))
- auto BufEnter *Calendar let b:sav_titlestring = &titlestring | let &titlestring = '%{strftime("%c")}' | let b:sav_wrapscan = &wrapscan
- auto BufLeave *Calendar let &titlestring = b:sav_titlestring | let &wrapscan = b:sav_wrapscan
+ if g:calendar_datetime == "title" && (!exists('s:bufautocommandsset'))
+ auto BufEnter *Calendar let b:sav_titlestring = &titlestring | let &titlestring = '%{strftime("%c")}'
+ auto BufLeave *Calendar let &titlestring = b:sav_titlestring
let s:bufautocommandsset=1
endif
@@ -974,18 +996,23 @@ function! Calendar(...)
execute 'to '.vcolumn.'vsplit __Calendar'
endif
setlocal noswapfile
- setlocal buftype=nowrite
+ setlocal buftype=nofile
setlocal bufhidden=delete
setlocal nonumber
- setlocal nowrap
+ " Without this, the 'sidescrolloff' setting may cause the left side of the
+ " calendar to disappear if the last inserted element is near the right
+ " window border.
+ setlocal wrap
setlocal norightleft
setlocal foldcolumn=0
setlocal modifiable
setlocal nolist
- set nowrapscan
let b:Calendar='Calendar'
" is this a vertical (0) or a horizontal (1) split?
endif
+ if g:calendar_datetime == "statusline"
+ setlocal statusline=%{strftime('%c')}
+ endif
let b:CalendarDir=dir
let b:CalendarYear = vyear_org
let b:CalendarMonth = vmnth_org
@@ -1007,28 +1034,30 @@ function! Calendar(...)
if g:calendar_navi == 'top'
execute "normal gg".navcol."i "
- silent exec "normal! i".navi_label."\<cr>\<cr>"
+ silent exec "normal! a".navi_label."\<cr>\<cr>"
silent put! =vdisplay1
endif
if g:calendar_navi == 'bottom'
silent put! =vdisplay1
silent exec "normal! Gi\<cr>"
execute "normal ".navcol."i "
- silent exec "normal! i".navi_label
+ silent exec "normal! a".navi_label
endif
if g:calendar_navi == 'both'
execute "normal gg".navcol."i "
- silent exec "normal! i".navi_label."\<cr>\<cr>"
+ silent exec "normal! a".navi_label."\<cr>\<cr>"
silent put! =vdisplay1
silent exec "normal! Gi\<cr>"
execute "normal ".navcol."i "
- silent exec "normal! i".navi_label
+ silent exec "normal! a".navi_label
endif
else
silent put! =vdisplay1
endif
setlocal nomodifiable
+ " In case we've gotten here from insert mode (via <C-O>:Calendar<CR>)...
+ stopinsert
let vyear = vyear_org
let vmnth = vmnth_org
@@ -1037,21 +1066,7 @@ function! Calendar(...)
"+++ build keymap
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
" make keymap
- if vmnth > 1
- execute 'nnoremap <silent> <buffer> <s-left> '
- \.':call Calendar('.dir.','.vyear.','.(vmnth-1).')<cr>'
- else
- execute 'nnoremap <silent> <buffer> <s-left> '
- \.':call Calendar('.dir.','.(vyear-1).',12)<cr>'
- endif
- if vmnth < 12
- execute 'nnoremap <silent> <buffer> <s-right> '
- \.':call Calendar('.dir.','.vyear.','.(vmnth+1).')<cr>'
- else
- execute 'nnoremap <silent> <buffer> <s-right> '
- \.':call Calendar('.dir.','.(vyear+1).',1)<cr>'
- endif
- execute 'nnoremap <silent> <buffer> q :close<cr>'
+ execute 'nnoremap <silent> <buffer> q :close<bar>wincmd p<cr>'
execute 'nnoremap <silent> <buffer> <cr> :call <SID>CalendarDoAction()<cr>'
execute 'nnoremap <silent> <buffer> <2-LeftMouse> :call <SID>CalendarDoAction()<cr>'
@@ -1060,10 +1075,10 @@ function! Calendar(...)
execute 'nnoremap <silent> <buffer> r :call Calendar(' . dir . ',' . vyear . ',' . vmnth . ')<cr>'
let pnav = s:GetToken(g:calendar_navi_label, ',', 1)
let nnav = s:GetToken(g:calendar_navi_label, ',', 3)
- execute 'nnoremap <silent> <buffer> <Up> :call <SID>CalendarDoAction("<' . pnav . '")<cr>'
execute 'nnoremap <silent> <buffer> <Left> :call <SID>CalendarDoAction("<' . pnav . '")<cr>'
- execute 'nnoremap <silent> <buffer> <Down> :call <SID>CalendarDoAction("' . nnav . '>")<cr>'
execute 'nnoremap <silent> <buffer> <Right> :call <SID>CalendarDoAction("' . nnav . '>")<cr>'
+ execute 'nnoremap <silent> <buffer> <Up> :call Calendar('.dir.','.(vyear-1).','.vmnth.')<cr>'
+ execute 'nnoremap <silent> <buffer> <Down> :call Calendar('.dir.','.(vyear+1).','.vmnth.')<cr>'
"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
"+++ build highlight
@@ -1135,7 +1150,7 @@ function! Calendar(...)
return ''
endfunction
-
+
"*****************************************************************
"* CalendarMakeDir : make directory
"*----------------------------------------------------------------
@@ -1227,8 +1242,10 @@ function! s:CalendarHelp()
echohl None
echo 'Calendar version ' . g:calendar_version
echohl SpecialKey
- echo '<s-left> : goto prev month'
- echo '<s-right> : goto next month'
+ echo '<Left> : goto prev month'
+ echo '<Right> : goto next month'
+ echo '<Up> : goto prev year'
+ echo '<Down> : goto next year'
echo 't : goto today'
echo 'q : close window'
echo 'r : re-display window'
--
vim-scripts packaging
More information about the pkg-vim-maintainers
mailing list