Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allow exotic filenames.
Fixes issue #9
  • Loading branch information
xim committed Nov 5, 2013
1 parent 06d6c0e commit eebcb59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/file_line.vim
@@ -1,5 +1,5 @@
" Avoid installing twice or when in unsupported Vim version.
if exists('g:loaded_file_line') || (v:version < 700)
if exists('g:loaded_file_line') || (v:version < 701)
finish
endif
let g:loaded_file_line = 1
Expand Down Expand Up @@ -29,7 +29,7 @@ function! s:gotoline()
if filereadable(file_name)
let l:bufn = bufnr("%")

exec "keepalt edit " . file_name
exec "keepalt edit " . fnameescape(file_name)
exec ":" . line_num
exec "normal! " . col_num . '|'
if foldlevel(line_num) > 0
Expand Down

3 comments on commit eebcb59

@bogado
Copy link
Owner

@bogado bogado commented on eebcb59 Nov 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know for a fact that this won't work on version 7.0?

@xim
Copy link
Contributor Author

@xim xim commented on eebcb59 Nov 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, haven't tested it. fnameescape was added in 7.1.299 according to a random quote found by googling the function name.

Maybe we should use

if exists('*fnameescape')
    exec "keepalt edit " . fnameescape(file_name)
else
    exec "keepalt edit " . file_name
endif

@bogado
Copy link
Owner

@bogado bogado commented on eebcb59 Nov 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need such details, I was just making sure that we're not limiting the code for no good reason. :-)

Please sign in to comment.