@@ -27,8 +27,7 @@ func! s:execute(start_line, end_line, count, command)
27
27
endfunc
28
28
29
29
func ! s: selection (start_line, end_line)
30
- let l: lines = getline (a: start_line , a: end_line )
31
- return join (l: lines , " \n " ) . " \n "
30
+ return getline (a: start_line , a: end_line )
32
31
endfunc
33
32
34
33
func ! s: command (command )
@@ -41,8 +40,14 @@ func! s:command(command)
41
40
endfunc
42
41
43
42
func ! s: result (command , selection , count )
43
+ if len (a: selection ) == 1
44
+ let l: command = a: command . ' ' . a: selection [0 ]
45
+ return system (l: command )
46
+ endif
47
+
44
48
if a: count
45
- return system (a: command , a: selection )
49
+ let l: selection = join (a: selection , " \n " ) . " \n "
50
+ return system (a: command , l: selection )
46
51
endif
47
52
48
53
return system (a: command )
@@ -77,7 +82,7 @@ func! s:buffer_name(command)
77
82
let l: buffer_name = substitute (l: buffer_name , ' {command}' , a: command , ' g' )
78
83
let l: buffer_name = substitute (l: buffer_name , ' {filename}' , expand (' %:t' ), ' g' )
79
84
80
- return l: buffer_name
85
+ return escape ( l: buffer_name, ' | ' )
81
86
endfunc
82
87
83
88
func ! s: set_buffer_defaults ()
0 commit comments