Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix: Escape ~ in tag search patterns

There's probably more characters I'm supposed to escape. Ideally I would
just prefix \V to every search pattern like the Vim documentation
describes but I couldn't get this to work consistently :-(
  • Loading branch information...
commit 2da32565a73c0a9ab25d4fd9b0f6626336202d07 1 parent 964e4db
@xolox authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 autoload.vim
View
7 autoload.vim
@@ -69,7 +69,12 @@ function! s:pattern_to_lnum(entry, pathname) " {{{2
let contents = s:cached_contents[a:pathname]
endif
let pattern = substitute(a:entry.cmd, '^/\(.*\)/$', '\1', '')
- let index = match(contents, pattern)
+ let pattern = substitute(pattern, '\~', '\\~', 'g')
+ try
+ let index = match(contents, pattern)
+ catch
+ throw "Failed pattern: " . string(pattern)
+ endtry
if index >= 0
let lnum = index + 1
let a:entry.cmd = string(lnum)
Please sign in to comment.
Something went wrong with that request. Please try again.