Skip to content

Commit cbf4f3b

Browse files
committed
Make :NoteFromSelectedText compatible with selection=inclusive (issue #36)
Issue #36 on GitHub: NoteFromSelectedText trims the last character of a visual selection #36
1 parent 96e5c83 commit cbf4f3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/xolox/notes.vim

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

66
" Note: This file is encoded in UTF-8 including a byte order mark so
77
" that Vim loads the script using the right encoding transparently.
88

9-
let g:xolox#notes#version = '0.18.2'
9+
let g:xolox#notes#version = '0.18.3'
1010
let s:scriptdir = expand('<sfile>:p:h')
1111

1212
call xolox#misc#compat#check('notes', 2)
@@ -220,7 +220,7 @@ function! s:get_visual_selection()
220220
let [lnum1, col1] = getpos("'<")[1:2]
221221
let [lnum2, col2] = getpos("'>")[1:2]
222222
let lines = getline(lnum1, lnum2)
223-
let lines[-1] = lines[-1][: col2 - 2]
223+
let lines[-1] = lines[-1][: col2 - (&selection == 'inclusive' ? 1 : 2)]
224224
let lines[0] = lines[0][col1 - 1:]
225225
return join(lines, ' ')
226226
endfunction

0 commit comments

Comments
 (0)