Skip to content

Commit

Permalink
Merge branch 'release-2.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
kopischke committed Mar 12, 2015
2 parents 640388c + 47795f9 commit 8cddd0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions autoload/fetch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,17 @@ function! fetch#visual(count) abort " {{{
" adapted from http://stackoverflow.com/a/6271254/990363
let [l:startline, l:startcol] = getpos("'<")[1:2]
let [l:endline, l:endcol] = getpos("'>")[1:2]
let l:endcol = min([l:endcol, col([l:endline, '$'])]) " 'V' col nr. bug
let l:endcol -= &selection is 'inclusive' ? 0 : 1
let lines = getline(l:startline, l:endline)
let lines[-1] = matchstr(lines[-1], '\m^.\{'.string(l:endcol).'}')
let lines[0] = matchstr(lines[0], '\m^.\{'.string(l:startcol - 1).'}\zs.*')
let l:selection = join(lines, "\n")
let l:lines = getline(l:startline, l:endline)
if visualmode() isnot? 'v' " block-wise selection
let l:endexpr = 'matchstr(v:val, "\\m^.*\\%'.string(l:endcol).'c.\\?")'
call map(l:lines, 'strpart('.l:endexpr.', '.string(l:startcol-1).')')
else
let l:lines[-1] = matchstr(lines[-1], '\m^.*\%'.string(l:endcol).'c.\?')
let l:lines[0] = strpart(l:lines[0], l:startcol-1)
endif
let l:selection = join(l:lines, "\n")

" test for a trailing spec
if !empty(l:selection)
Expand Down
2 changes: 1 addition & 1 deletion doc/vim-fetch.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*vim-fetch.txt* For Vim version 7.0 or better version 2.0.0
*vim-fetch.txt* For Vim version 7.0 or better version 2.0.1


VIM REFERENCE for the Fetch plug-in
Expand Down
2 changes: 1 addition & 1 deletion plugin/fetch.vim
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
" SIMPLIFIED TAKE ON BOGADO/FILE-LINE (HOPEFULLY) WITHOUT THE WARTS
" Maintainer: Martin Kopischke <martin@kopischke.net>
" License: MIT (see LICENSE.md)
" Version: 2.0.0
" Version: 2.0.1
if &compatible || !has('autocmd') || v:version < 700
finish
endif
Expand Down

0 comments on commit 8cddd0b

Please sign in to comment.