Re: Bug in ftdetect?

2017-05-26 Thread Bram Moolenaar
. > > Not for html, which explicitly resets b:current_syntax to be able to > include several other syntax scripts and even provides the main_syntax > global variable to make this work with other syntax scripts. Well, it must be used somehwere to explain why making the file

Re: Bug in ftdetect?

2017-05-26 Thread Christian Brabandt
nt_syntax (to anything), which will cause further syntax scripts to > bail > out. Anyway, this is all working around the actual problem. Not for html, which explicitly resets b:current_syntax to be able to include several other syntax scripts and even provides the main_syntax global variabl

Re: Bug in ftdetect?

2017-05-25 Thread Bram Moolenaar
> scripts as well (for a test, you could set main_syntax='java'). I haven't read the whole thread, but I suspect that the trick is to set b:current_syntax (to anything), which will cause further syntax scripts to bail out. Anyway, this is all working around the actual problem. > However, I thin

Re: Bug in ftdetect?

2017-05-25 Thread Bram Moolenaar
Frew Schmidt wrote: > I'm glad you were able to come up with a solution! So I guess `vim *` goes > through a different codepath than `:args *`? Note that this also affects the > quickfix, the location list, and the local args list. Initially I discovered > this issue with `:cexpr` and

Re: Bug in ftdetect?

2017-05-25 Thread fREW Schmidt
On Thu, May 25, 2017 at 09:14:06AM +0200, Christian Brabandt wrote: > So perhaps we need a similar change here as well. Can you provide a > reproducible example for the :cexpr case please)? Sure; same setup as before, and in vim: :cexpr system('ls * \| xargs -n1 -I{} echo {}:1:{}') -- fREW

Re: Bug in ftdetect?

2017-05-25 Thread Antony Scriven
On May 25, Christian Brabandt wrote: > [...] > > I am not sure, if this behaviour is a bug. However after > thinking some more about it, I am wondering, whether the > fact that the BufNew autocommand triggers a FileType > autocommand is a bug itself, since autocommands shouldn't > nest

Re: Bug in ftdetect?

2017-05-25 Thread Christian Brabandt
On Mi, 24 Mai 2017, Frew Schmidt wrote: > I'm glad you were able to come up with a solution! So much for the unwillingness of the vim maintainers to fix this issue. > So I guess `vim *` goes through a different codepath than `:args *`? Don't think so. Perhaps the autocommand wasn't set up

Re: Bug in ftdetect?

2017-05-25 Thread Christian Brabandt
onds). So you would need to disable all other to be included syntax > scripts as well (for a test, you could set main_syntax='java'). > > However, I think you might have found a bug here. Your ftdetect script > does this: > > autocmd BufNew,BufNewFile,BufRead *.md :set filetyp

Re: Bug in ftdetect?

2017-05-24 Thread Antony Scriven
On May 24, Christian Brabandt wrote: > [...] > > However, I think you might have found a bug here. Your > ftdetect script does this: I don't know that I'd characterise it as a bug, since this: > autocmd BufNew,BufNewFile,BufRead *.md :set filetype=markdown > > The :a

Re: Bug in ftdetect?

2017-05-24 Thread fREW Schmidt
On Wed, May 24, 2017 at 11:08:58PM +, Antony Scriven wrote: > On May 24, Frew Schmidt wrote: > > > [...] > > > > Maybe a dumb question, but why would BufNew be more expensive > > than BufRead? Shouldn't the filetype stuff get run either way? > > I wouldn't expect BufRead to take 500ms

Re: Bug in ftdetect?

2017-05-24 Thread Antony Scriven
On May 24, Frew Schmidt wrote: > [...] > > Maybe a dumb question, but why would BufNew be more expensive > than BufRead? Shouldn't the filetype stuff get run either way? > I wouldn't expect BufRead to take 500ms and BufNew to take > multiple seconds, would you? The bufnew autocommands

Re: Bug in ftdetect?

2017-05-24 Thread Frew Schmidt
I'm glad you were able to come up with a solution! So I guess `vim *` goes through a different codepath than `:args *`? Note that this also affects the quickfix, the location list, and the local args list. Initially I discovered this issue with `:cexpr` and reproduced it with `:lexpr` and

Re: Bug in ftdetect?

2017-05-24 Thread Christian Brabandt
ment vb.vim, the overall loading time only shrinks by 0.2 seconds or so (it needs here a total of around 7 seconds). So you would need to disable all other to be included syntax scripts as well (for a test, you could set main_syntax='java'). However, I think you might have found a bug

Re: Bug in ftdetect?

2017-05-24 Thread fREW Schmidt
Yes. "If I replace the contents of /usr/share/vim/vim80/syntax/vb.vim with `let b:current_syntax = "vb"` everything is fast and, as I would hope, the support files are not loaded N times per buffer but instead exactly once." -- Sent from a telephone. Pardon my brevity. On May 24, 2017 12:52 PM,

Re: Bug in ftdetect?

2017-05-24 Thread Christian Brabandt
On Mi, 24 Mai 2017, fREW Schmidt wrote: > It is sorta weird that the vb syntax, is somehow part of the problem, > but whatever I understand that this was the wrong way to configure the > editor. Not sure I understand. Are you saying, that the vb syntax script is responsible for the long

Re: Bug in ftdetect?

2017-05-24 Thread fREW Schmidt
Aha! That's it Antony; thanks; that explains it and a lot more. Sorry for inexplicably missing this myself. On Wed, May 24, 2017 at 08:17:46AM +0100, Antony Scriven wrote: > Try taking out the BufNew autocmd. That'll get triggered for every > file in the args list, whereas BufRead is only

Re: Bug in ftdetect?

2017-05-24 Thread fREW Schmidt
It is sorta weird that the vb syntax, is somehow part of the problem, but whatever I understand that this was the wrong way to configure the editor. On Wed, May 24, 2017 at 08:17:46AM +0100, Antony Scriven wrote: > Try taking out the BufNew autocmd. That'll get triggered for every > file in the

Re: Bug in ftdetect?

2017-05-24 Thread Antony Scriven
P.S. If you want to detect name changes, there's BufFilePost. --Antony On 24 May 2017 at 08:17, Antony Scriven wrote: > Try taking out the BufNew autocmd. That'll get triggered for every > file in the args list, whereas BufRead is only triggered for the first > one that's

Re: Bug in ftdetect?

2017-05-24 Thread Antony Scriven
Try taking out the BufNew autocmd. That'll get triggered for every file in the args list, whereas BufRead is only triggered for the first one that's actually edited. FWIW 'BufNew' is not in the template ftdetect file in the docs. --Antony On 23 May 2017 at 22:28, Frew Schmidt

Re: Bug in ftdetect?

2017-05-23 Thread Frew Schmidt
On Tuesday, May 23, 2017 at 12:58:16 PM UTC-7, Bram Moolenaar wrote: > I'm afraid this doesnt make any sense. I would suggest to reinstall > Vim, making sure you first delete all Vim related files (make a backup > of your preferences somewhere). Well I have already repro'd this on a fresh 7.3,

Re: Bug in ftdetect?

2017-05-23 Thread Bram Moolenaar
Frew Schmidt wrote: > On Tuesday, May 23, 2017 at 9:40:02 AM UTC-7, Frew Schmidt wrote: > > On Tuesday, May 23, 2017 at 9:16:45 AM UTC-7, Frew Schmidt wrote: > > > > Perhaps you can get some more information by setting 'verbose' to a > > > > > > > > non-zero number, e.g. ten. > > > > > > > >

Re: Bug in ftdetect?

2017-05-23 Thread Frew Schmidt
On Tuesday, May 23, 2017 at 9:40:02 AM UTC-7, Frew Schmidt wrote: > On Tuesday, May 23, 2017 at 9:16:45 AM UTC-7, Frew Schmidt wrote: > > > Perhaps you can get some more information by setting 'verbose' to a > > > > > > non-zero number, e.g. ten. > > > > > > Well, I ran it with -V10 and even

Re: Bug in ftdetect?

2017-05-23 Thread Frew Schmidt
On Tuesday, May 23, 2017 at 9:16:45 AM UTC-7, Frew Schmidt wrote: > > Perhaps you can get some more information by setting 'verbose' to a > > > > non-zero number, e.g. ten. > > > Well, I ran it with -V10 and even after deleting both ~/.vim/ (except for the > ftdetect file) and ~/.vimrc and I

Re: Bug in ftdetect?

2017-05-23 Thread Frew Schmidt
> Perhaps you can get some more information by setting 'verbose' to a > > non-zero number, e.g. ten. Well, I ran it with -V10 and even after deleting both ~/.vim/ (except for the ftdetect file) and ~/.vimrc and I can still reproduce it. It looks about the same as before: the markdown support

Re: Bug in ftdetect?

2017-05-23 Thread fREW Schmidt
The fast version is a filetype.vim script in my ~/. vim. If there is a cost to these settings, why does it show up with ftdetect but not a local filetype.vim? Also most machines are not on vim 8, and thus still think .md is modula 2. -- Sent from a telephone. Pardon my brevity. On May 23, 2017

Re: Bug in ftdetect?

2017-05-23 Thread Bram Moolenaar
Frew Schmidt wrote: > I recently discovered that using ftdetect is absurdly slower than > filetype.vim. To reproduce, try this: > > mkdir -p ~/.vim/ftdetect > echo 'autocmd BufNew,BufNewFile,BufRead *.md :set filetype=markdown' > > ~/.vim/ftdetect/markdown.vim > mkdir testing

Re: Bug in ftdetect?

2017-05-22 Thread Frew Schmidt
FYI I reproduced this with a recent checkout and also a 7.3 build, so I'm pretty sure it's neither fixed nor a regression. I will look into profiling the issue, but I am still baffled. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the

Bug in ftdetect?

2017-05-22 Thread Frew Schmidt
I recently discovered that using ftdetect is absurdly slower than filetype.vim. To reproduce, try this: mkdir -p ~/.vim/ftdetect echo 'autocmd BufNew,BufNewFile,BufRead *.md :set filetype=markdown' > ~/.vim/ftdetect/markdown.vim mkdir testing cd testing touch