Code Monkey home page Code Monkey logo

sf.vim's People

Contributors

g0xa52a2a avatar george-b avatar

Watchers

 avatar  avatar

sf.vim's Issues

Autocmd events only fire when the pattern is a literal

If you have something like the following in your configuration it will
not be triggered by this plugin.

autocmd QuickFixCmdPost [^l]* nested cwindow

This is because before executing doautocmd a check is performed to see
if there are associated events. This will be in the from of
exists('QuickFixCmdPost#grep') or exists('QuickFixCmdPost#make'),
neither of which will match the above as exists() doesn't evaluate the
pattern.

The reason this check is done is to avoid Vim printing "No matching
autocommands" if there are no associated events. This must be checked
using exists() as if we were to use :silent it would also silence
any potential output from events. This cannot be handled with :try
either as this isn't a hard error.

There can be other subtle issues using such a pattern as a means to
trigger events for anything that is not location list related, e.g
romainl/vim-qf#93. It is for this reason that
I won't be expanding the check to try and catch the pattern above. If
you have something like this in your configuration I recommend
explicitly listing events.

One way to do this is as follows, though it's just an example, handle
this however you want.

let s:cmds =
  [ , 'caddbuffer'
  \ , 'caddexpr'
  \ , 'caddfile'
  \ , 'cbuffer'
  \ , 'cexpr'
  \ , 'cfile'
  \ , 'cgetbuffer'
  \ , 'cgetexpr'
  \ , 'cgetfile'
  \ , 'cscope'
  \ , 'grep'
  \ , 'grepadd'
  \ , 'helpgrep'
  \ , 'make'
  \ , 'vimgrep'
  \ , 'vimgrepadd'
  \ ]

augroup cwindow
  autocmd!
augroup END

execute 'autocmd cwindow QuickFixCmdPost' join(s:cmds, ',') 'nested cwindow'

unlet s:cmds

Frankly the overlap between the location list and quickfix list in Vim
is a mess but we just have to deal with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.