Skip to content
Browse files

- Improved open cursor file.

  • Loading branch information...
1 parent ff17d38 commit 9b4902f0cb7e8ce5e4be128d3b9f6e9ef2c8799e @Shougo Shougo committed Jul 5, 2011
Showing with 14 additions and 7 deletions.
  1. +5 −2 autoload/vimshell/int_mappings.vim
  2. +6 −5 autoload/vimshell/mappings.vim
  3. +3 −0 doc/vimshell.txt
View
7 autoload/vimshell/int_mappings.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: int_mappings.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 01 Jul 2011.
+" Last Modified: 05 Jul 2011.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -174,7 +174,10 @@ endfunction"}}}
function! vimshell#int_mappings#execute_line(is_insert)"{{{
if !a:is_insert
" Search cursor file.
- let l:filename = matchstr(substitute(substitute(expand('<cfile>'), '\\', '/', 'g'), ' ', '\\ ', 'g'), '\h\w*://\f\+')
+ let l:filename_pattern = '\%([[:alnum:];/?:@&=+$,_.!~*''|()-]\+[ ]\)*[[:alnum:];/?:@&=+$,_.!~*''|()-]\+'
+ let l:filename = matchstr(getline('.')[: col('.')-1], l:filename_pattern . '$')
+ \ . matchstr(getline('.')[col('.') :], '^'.l:filename_pattern)
+ let l:filename = substitute(l:filename, '\\', '/', 'g')
if &termencoding != '' && &encoding != &termencoding
" Convert encoding.
View
11 autoload/vimshell/mappings.vim
@@ -1,7 +1,7 @@
"=============================================================================
" FILE: mappings.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
-" Last Modified: 04 Jul 2011.
+" Last Modified: 05 Jul 2011.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
@@ -201,11 +201,12 @@ function! vimshell#mappings#execute_line(is_insert)"{{{
let l:pattern = l:line[1]
else
" Search cursor file.
- " let l:filename = expand('<cfile>')
- let l:filename = matchstr(getline('.')[: col('.')-1], '\%(\f\+[ ]\)*\f\+$')
- \ . matchstr(getline('.')[col('.') :], '^\%(\f\+[ ]\)*\f\+')
+ let l:filename_pattern = '\%([[:alnum:];/?:@&=+$,_.!~*''|()-]\+[ ]\)*[[:alnum:];/?:@&=+$,_.!~*''|()-]\+'
+ let l:filename = matchstr(getline('.')[: col('.')-1], l:filename_pattern . '$')
+ \ . matchstr(getline('.')[col('.') :], '^'.l:filename_pattern)
if has('conceal') && l:filename =~ '\[\%[%\]]\|^%$'
- let l:filename = matchstr(getline('.'), '\%(\f\+[ ]\)*\f\+', 3)
+ " Skip user prompt.
+ let l:filename = matchstr(getline('.'), l:filename_pattern, 3)
endif
let l:pattern = ''
endif
View
3 doc/vimshell.txt
@@ -217,6 +217,9 @@ BUGS *vimshell-bugs*
==============================================================================
CHANGELOG *vimshell-changelog*
+2011-07-05
+- Improved open cursor file.
+
2011-07-04
- Added <Plug>(vimshell_move_head) mapping.
- Improved <Plug>(vimshell_previous_prompt) and <Plug>(vimshell_next_prompt)

0 comments on commit 9b4902f

Please sign in to comment.
Something went wrong with that request. Please try again.