Skip to content

Commit 67a0a83

Browse files
committed
Updated miscellaneous scripts
2 parents 0197197 + a7ed49e commit 67a0a83

File tree

3 files changed

+28
-81
lines changed

3 files changed

+28
-81
lines changed

autoload/xolox/easytags.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: April 21, 2013
3+
" Last Change: April 28, 2013
44
" URL: http://peterodding.com/code/vim/easytags/
55

6-
let g:xolox#easytags#version = '3.1.5'
6+
let g:xolox#easytags#version = '3.1.6'
77

88
call xolox#misc#compat#check('easytags', 1)
99

autoload/xolox/misc/README.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

autoload/xolox/misc/path.vim

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: April 18, 2013
3+
" Last Change: April 22, 2013
44
" URL: http://peterodding.com/code/vim/misc/
55

66
let s:windows_compatible = has('win32') || has('win64')
77
let s:mac_os_x_compatible = has('macunix')
88

9-
function! xolox#misc#path#which(...)
9+
function! xolox#misc#path#which(...) " {{{1
10+
" Scan the executable search path for programs.
1011
let extensions = s:windows_compatible ? split($PATHEXT, ';') : ['']
1112
let matches = []
1213
let checked = {}
@@ -29,9 +30,8 @@ function! xolox#misc#path#which(...)
2930
return matches
3031
endfunction
3132

32-
" Split a pathname into a list of path components.
33-
34-
function! xolox#misc#path#split(path)
33+
function! xolox#misc#path#split(path) " {{{1
34+
" Split a pathname into a list of path components.
3535
if type(a:path) == type('')
3636
if s:windows_compatible
3737
return split(a:path, '[\/]\+')
@@ -44,9 +44,8 @@ function! xolox#misc#path#split(path)
4444
return []
4545
endfunction
4646

47-
" Join a list of path components into a pathname.
48-
49-
function! xolox#misc#path#join(parts)
47+
function! xolox#misc#path#join(parts) " {{{1
48+
" Join a list of path components into a pathname.
5049
if type(a:parts) == type([])
5150
if !s:windows_compatible && a:parts[0] == '/'
5251
return join(a:parts, '/')[1 : -1]
@@ -57,9 +56,10 @@ function! xolox#misc#path#join(parts)
5756
return ''
5857
endfunction
5958

60-
" Canonicalize and resolve a pathname.
61-
62-
function! xolox#misc#path#absolute(path)
59+
function! xolox#misc#path#absolute(path) " {{{1
60+
" Canonicalize and resolve a pathname, regardless of whether it exists. This
61+
" is intended to support string comparison to determine whether two pathnames
62+
" point to the same directory or file.
6363
if type(a:path) == type('')
6464
let path = fnamemodify(a:path, ':p')
6565
" resolve() doesn't work when there's a trailing path separator.
@@ -77,9 +77,8 @@ function! xolox#misc#path#absolute(path)
7777
return ''
7878
endfunction
7979

80-
" Make an absolute pathname relative.
81-
82-
function! xolox#misc#path#relative(path, base)
80+
function! xolox#misc#path#relative(path, base) " {{{1
81+
" Make an absolute pathname relative.
8382
let path = xolox#misc#path#split(a:path)
8483
let base = xolox#misc#path#split(a:base)
8584
while path != [] && base != [] && path[0] == base[0]
@@ -90,9 +89,9 @@ function! xolox#misc#path#relative(path, base)
9089
return xolox#misc#path#join(distance + path)
9190
endfunction
9291

93-
" Join a directory and filename into a single pathname.
9492

95-
function! xolox#misc#path#merge(parent, child, ...)
93+
function! xolox#misc#path#merge(parent, child, ...) " {{{1
94+
" Join a directory and filename into a single pathname.
9695
" TODO Use isabs()!
9796
if type(a:parent) == type('') && type(a:child) == type('')
9897
if s:windows_compatible
@@ -108,9 +107,8 @@ function! xolox#misc#path#merge(parent, child, ...)
108107
return ''
109108
endfunction
110109

111-
" Find the common prefix of path components in a list of pathnames.
112-
113-
function! xolox#misc#path#commonprefix(paths)
110+
function! xolox#misc#path#commonprefix(paths) " {{{1
111+
" Find the common prefix of path components in a list of pathnames.
114112
let common = xolox#misc#path#split(a:paths[0])
115113
for path in a:paths
116114
let index = 0
@@ -127,9 +125,8 @@ function! xolox#misc#path#commonprefix(paths)
127125
return xolox#misc#path#join(common)
128126
endfunction
129127

130-
" Encode a pathname so it can be used as a filename.
131-
132-
function! xolox#misc#path#encode(path)
128+
function! xolox#misc#path#encode(path) " {{{1
129+
" Encode a pathname so it can be used as a filename.
133130
if s:windows_compatible
134131
let mask = '[*|\\/:"<>?%]'
135132
elseif s:mac_os_x_compatible
@@ -140,12 +137,13 @@ function! xolox#misc#path#encode(path)
140137
return substitute(a:path, mask, '\=printf("%%%x", char2nr(submatch(0)))', 'g')
141138
endfunction
142139

143-
" Decode a pathname previously encoded with xolox#misc#path#encode().
144140

145-
function! xolox#misc#path#decode(encoded_path)
141+
function! xolox#misc#path#decode(encoded_path) " {{{1
142+
" Decode a pathname previously encoded with xolox#misc#path#encode().
146143
return substitute(a:encoded_path, '%\(\x\x\?\)', '\=nr2char("0x" . submatch(1))', 'g')
147144
endfunction
148145

146+
" xolox#misc#path#equals(a, b) {{{1
149147
" Check whether two pathnames point to the same file.
150148

151149
if s:windows_compatible
@@ -158,9 +156,8 @@ else
158156
endfunction
159157
endif
160158

161-
" Check whether a path is relative.
162-
163-
function! xolox#misc#path#is_relative(path)
159+
function! xolox#misc#path#is_relative(path) " {{{1
160+
" Check whether a path is relative.
164161
if a:path =~ '^\w\+://'
165162
return 0
166163
elseif s:windows_compatible
@@ -170,9 +167,8 @@ function! xolox#misc#path#is_relative(path)
170167
endif
171168
endfunction
172169

173-
" Create a temporary directory and return the path.
174-
175-
function! xolox#misc#path#tempdir()
170+
function! xolox#misc#path#tempdir() " {{{1
171+
" Create a temporary directory and return the path.
176172
if !exists('s:tempdir_counter')
177173
let s:tempdir_counter = 1
178174
endif

0 commit comments

Comments
 (0)