I have a bunch of YASnippet for a single mode and sometimes it's kind of hard to find the snippet I'm looking for in the main list.
Expected behavior:
My goal is to have snippets like this one activated in all files/buffers with "model" in its name(e.g. app/models/my_model.rb)
# that's ruby-mode/model-foo:
# -*- mode: snippet -*-
# name: model - foo activation name
# condition: (string-match-p (regexp-quote "models") (buffer-file-name (window-buffer (minibuffer-selected-window))))
# --
model_foo
And this one in files/buffers with "controller" in its name(e.g. app/controllers/another_model.rb or test/controllers/another_model.rb etc)
# that's ruby-mode/controller-foo:
# -*- mode: snippet -*-
# name: controller - foo activation name
# condition: (string-match-p (regexp-quote "controllers") (buffer-file-name (window-buffer (minibuffer-selected-window))))
# --
controller_foo
Actual behavior:
Both snippets are activated(available for selection) in all files in ruby-mode. It looks like condition:
is completely ignored. I've even tried to set it as "# condition: false" and snippets are still working/visible.
What might be causing this issue?
pkg-info-package-version yasnippet
20191222.2206