Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 0.34

- tlib#buffer#HighlightLine(line): call tlib#autocmdgroup#Init()  (reported by Sergey Khorev)
  • Loading branch information...
commit 8386fa8d7996c309a5a901d7b1b0b4583003d7df 1 parent 3654b70
@tomtom tomtom authored committed
View
6 autoload/tlib/World.vim
@@ -3,8 +3,8 @@
" @Website: http://members.a1.net/t.link/
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-05-01.
-" @Last Change: 2009-08-23.
-" @Revision: 0.1.738
+" @Last Change: 2009-10-25.
+" @Revision: 0.1.740
" :filedoc:
" A prototype used by |tlib#input#List|.
@@ -672,7 +672,7 @@ function! s:prototype.Resize(hsize, vsize) dict "{{{3
endf
-" :def: function! s:prototype.DisplayList(query, ?list)
+" function! s:prototype.DisplayList(query, ?list)
" :nodoc:
function! s:prototype.DisplayList(query, ...) dict "{{{3
" TLogVAR a:query
View
4 autoload/tlib/autocmdgroup.vim
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2008-08-19.
-" @Last Change: 2009-02-15.
-" @Revision: 0.0.3
+" @Last Change: 2009-12-07.
+" @Revision: 0.0.5
if &cp || exists("loaded_tlib_autocmdgroup_autoload")
finish
View
6 autoload/tlib/buffer.vim
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-06-30.
-" @Last Change: 2009-08-17.
-" @Revision: 0.0.283
+" @Last Change: 2009-12-07.
+" @Revision: 0.0.287
if &cp || exists("loaded_tlib_buffer_autoload")
finish
@@ -21,6 +21,7 @@ endf
function! tlib#buffer#DisableMRU() "{{{3
+ call tlib#autocmdgroup#Init()
autocmd! TLib BufEnter
endf
@@ -180,6 +181,7 @@ endf
function! tlib#buffer#HighlightLine(line) "{{{3
" exec '3match MatchParen /^\%'. a:line .'l.*/'
exec '3match Search /^\%'. a:line .'l.*/'
+ call tlib#autocmdgroup#Init()
autocmd TLib CursorHold,CursorHoldI,CursorMoved,CursorMovedI * 3match none
endf
View
23 autoload/tlib/map.vim
@@ -0,0 +1,23 @@
+" map.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-08-23.
+" @Last Change: 2009-08-23.
+" @Revision: 0.0.4
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
+" For use in maps like: >
+" imap <expr> <cr> tlib#map#PumAccept("\<cr>")
+function! tlib#map#PumAccept(key) "{{{3
+ return pumvisible() ? "\<c-y>" : a:key
+endf
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
View
46 autoload/tlib/paragraph.vim
@@ -0,0 +1,46 @@
+" paragraph.vim
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-10-26.
+" @Last Change: 2009-10-26.
+" @Revision: 0.0.12
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+" :def: function! tlib#paragraph#Delete(?register="")
+" Almost the same as dap but behaves differently when the cursor is on a
+" blank line or when the paragraph's last line is the last line in the
+" file.
+"
+" This function assumes that a paragraph is a block of text followed by
+" blank lines or the end of file.
+function! tlib#paragraph#Delete(...) "{{{3
+ TVarArg 'register'
+ if empty(register)
+ let prefix = ''
+ else
+ let prefix = '"'. register
+ endif
+ let lineno = line('.')
+ let lastno = line('$')
+ let hastext = getline(lineno) =~ '\S'
+ if line("'}") == lastno
+ if lineno == lastno
+ silent norm! {j0
+ else
+ silent norm! }{j0
+ endif
+ exec 'silent norm! '. prefix .'dG'
+ elseif hastext
+ silent norm! dap
+ else
+ silent norm! {j0dap
+ endif
+endf
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
View
5 autoload/tlib/scratch.vim
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-07-18.
-" @Last Change: 2009-08-04.
-" @Revision: 0.0.144
+" @Last Change: 2009-10-24.
+" @Revision: 0.0.145
if &cp || exists("loaded_tlib_scratch_autoload")
finish
@@ -66,6 +66,7 @@ function! tlib#scratch#UseScratch(...) "{{{3
setlocal foldmethod=manual
setlocal foldcolumn=0
setlocal modifiable
+ setlocal nospell
if &ft != '*'
let &ft = ft
endif
View
103 autoload/tlib/signs.vim
@@ -0,0 +1,103 @@
+" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim])
+" @Website: http://www.vim.org/account/profile.php?user_id=4037
+" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
+" @Created: 2009-03-12.
+" @Last Change: 2009-03-13.
+" @Revision: 0.0.44
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+
+let s:base = 2327
+let s:register = {}
+
+
+" Clear all signs with name SIGN.
+function! tlib#signs#ClearAll(sign) "{{{3
+ " TLog a:sign
+ for bn in keys(s:register)
+ let idxs = keys(s:register)
+ call filter(idxs, 's:register[v:val].sign == a:sign')
+ " TLogVAR bns
+ for idx in idxs
+ exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+ call remove(s:register, idx)
+ endfor
+ endfor
+endf
+
+
+" Clear all signs with name SIGN in buffer BUFNR.
+function! tlib#signs#ClearBuffer(sign, bufnr) "{{{3
+ for bn in keys(s:register)
+ let idxs = keys(s:register)
+ call filter(idxs, 's:register[v:val].sign == a:sign && s:register[v:val].bn == a:bufnr')
+ " TLogVAR bns
+ for idx in idxs
+ exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+ call remove(s:register, idx)
+ endfor
+ endfor
+endf
+
+
+" function! tlib#signs#Clear(sign, list) "{{{3
+" " TLogVAR a:sign
+" let done = []
+" for item in a:list
+" let bn = get(item, 'bufnr', -1)
+" if index(done, bn) == -1
+" let idxs = keys(s:register)
+" call filter(idxs, 's:register[v:val].sign == a:sign && s:register[v:val].bn == bn')
+" for idx in idxs
+" exec 'sign unplace '. idx .' buffer='. s:register[idx].bn
+" call remove(s:register, idx)
+" endfor
+" call add(done, bn)
+" endif
+" endfor
+" endf
+
+
+" Add signs for all locations in LIST. LIST must confirm with the
+" quickfix list format (see |getqflist()|; only the fields lnum and
+" bufnr are required).
+"
+" list:: a quickfix or location list
+" sign:: a sign defined with |:sign-define|
+function! tlib#signs#Mark(sign, list) "{{{3
+ " TLogVAR a:sign
+ for item in a:list
+ let idx = s:SignId(item)
+ if idx >= 0
+ let lnum = get(item, 'lnum', 0)
+ if lnum > 0
+ let bn = get(item, 'bufnr')
+ exec ':sign place '. idx .' line='. lnum .' name='. a:sign .' buffer='. bn
+ let s:register[idx] = {'sign': a:sign, 'bn': bn}
+ endif
+ endif
+ endfor
+endf
+
+
+function! s:SignId(item) "{{{3
+ " TLogVAR a:item
+ " let bn = bufnr('%')
+ let bn = get(a:item, 'bufnr', -1)
+ if bn == -1
+ return -1
+ else
+ let idx = s:base + bn * 500
+ while has_key(s:register, idx)
+ let idx += 1
+ endwh
+ return idx
+ endif
+endf
+
+
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
View
18 doc/tlib.txt
@@ -71,7 +71,7 @@ Contents~
prototype.Super
prototype.Methods
tlib#World#New .......................... |tlib#World#New()|
- prototype.DisplayList
+ prototype.Reset
tlib#agent#Exit ......................... |tlib#agent#Exit()|
tlib#agent#CopyItems .................... |tlib#agent#CopyItems()|
tlib#agent#PageUp ....................... |tlib#agent#PageUp()|
@@ -182,6 +182,7 @@ Contents~
tlib#normal#WithRegister ................ |tlib#normal#WithRegister()|
tlib#notify#Echo ........................ |tlib#notify#Echo()|
tlib#notify#TrimMessage ................. |tlib#notify#TrimMessage()|
+ tlib#paragraph#Delete ................... |tlib#paragraph#Delete()|
tlib#progressbar#Init ................... |tlib#progressbar#Init()|
tlib#progressbar#Display ................ |tlib#progressbar#Display()|
tlib#progressbar#Restore ................ |tlib#progressbar#Restore()|
@@ -536,7 +537,7 @@ Inherits from |tlib#Object#New|.
tlib#World#New(...)
-prototype.DisplayList
+prototype.Reset
========================================================================
@@ -1140,6 +1141,19 @@ tlib#notify#TrimMessage(message)
========================================================================
+autoload/tlib/paragraph.vim~
+
+ *tlib#paragraph#Delete()*
+tlib#paragraph#Delete(?register="")
+ Almost the same as dap but behaves differently when the cursor is on a
+ blank line or when the paragraph's last line is the last line in the
+ file.
+
+ This function assumes that a paragraph is a block of text followed by
+ blank lines or the end of file.
+
+
+========================================================================
autoload/tlib/progressbar.vim~
*tlib#progressbar#Init()*
View
15 plugin/02tlib.vim
@@ -3,8 +3,8 @@
" @Website: http://www.vim.org/account/profile.php?user_id=4037
" @License: GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created: 2007-04-10.
-" @Last Change: 2009-08-23.
-" @Revision: 581
+" @Last Change: 2009-12-07.
+" @Revision: 588
" GetLatestVimScripts: 1863 1 tlib.vim
"
" Please see also ../test/tlib.vim for usage examples.
@@ -29,11 +29,15 @@ if v:version < 700 "{{{2
echoerr "tlib requires Vim >= 7"
finish
endif
-let loaded_tlib = 32
+let loaded_tlib = 34
let s:save_cpo = &cpo
set cpo&vim
+" Init~ {{{1
+" call tlib#autocmdgroup#Init()
+
+
" Commands~ {{{1
" :display: TRequire NAME [VERSION [FILE]]
@@ -551,3 +555,8 @@ pressing <esc> when browsing an index-list, returns 0 and not "")
- Don't use fnamemodify() to split filenames (for performance reasons)
- scratch: Set ft after setting up scratch options
- tlib#map#PumAccept(key)
+
+0.34
+- tlib#buffer#HighlightLine(line): call tlib#autocmdgroup#Init()
+(reported by Sergey Khorev)
+
Please sign in to comment.
Something went wrong with that request. Please try again.