bogado / file-line

Plugin for vim to enabling opening a file in a given line
http://www.vim.org/scripts/script.php?script_id=2184
299 stars 61 forks source link

Filetype not set on multiple files #52

Closed lervag closed 9 years ago

lervag commented 9 years ago

The filetype is for some reason not set on the second file if I open multiple files (of the same filetype). The problem only occurs with set hidden. Consider the following minimal working example:

set nocompatible
let &rtp = '~/.vim/bundle/file-line/,' . &rtp
filetype plugin indent on
syntax enable
set hidden
program test1
  implicit none
  !
  print *, "This is test1"
end program test1
program test2
  implicit none
  !
  print *, "This is test2"
end program test2

Now do gvim -u minivimrc *.f90 (or vim) followed by :bnext<cr>. This will go to the next file, which does not have any syntax highlighting because the filetype is not set.

This issue is similar to #28 and #29, which were closed as fixed in #34. However, the above procedure clearly shows that the current issue exists and is reproducible.

Edit: Minor update.

lervag commented 9 years ago

I decided to fix the problem myself. In the process, I ended up rewriting the plugin according to my preferred style of vimL.