-
-
Notifications
You must be signed in to change notification settings - Fork 683
Description
This issue is related to #1519, but in a reproducible way.
In my context, I collect all math-related snippets in a file called tex_math.snippets, and I have a tex.snippets with content:
extends tex_math.snippets
# Some LaTeX-specific snippetsThe issue occurs when I type any snippet in a a.tex file that is defined in tex_math.snippets, something like:
1: (frac) "math frac" (/Users/user/.vim/UltiSnips/tex_math.snippets:1)
2: (frac) "math frac" (/Users/user/.vim/UltiSnips/tex_math.snippets:1)
The cause of the issue is that according to UltiSnips doc (section UltiSnips-how-snippets-are-loaded), both tex_math.snippets and tex.snippets refer to snippets of tex filetype. Thus, by extending tex_math.snippets in tex.snippets, it might somehow trigger certain naming conflicts and causes any snippet defined in tex_math.snippets to be redefined. Interestingly, using extends tex rather than extends tex_math in tex.snippets won't trigger the issue.
Expected behavior:
Either error out, suggesting the user extends tex_math is an improper use of extends keyword, or behave as if the extends tex_math in tex.snippets is not present. In the latter case, all definitions in tex_math.snippets take effect in a a.tex file automatically, by definition.
Actual behavior:
As mentioned above, something like
1: (frac) "math frac" (/Users/user/.vim/UltiSnips/tex_math.snippets:1)
2: (frac) "math frac" (/Users/user/.vim/UltiSnips/tex_math.snippets:1)
is prompted, and the user must enter, e.g. 1<ENTER>, to select one, which IMHO is confusing and misleading.
Steps to reproduce
In the docker container:
- Open
vim x.tex - Type
frac<TAB> - The prompt mentioned above occurs
- Operating System: macOS 12.7.6
- Vim Version:
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jan 4 2024 03:08:50)
macOS version - x86_64
- UltiSnips Version: 49dc8cb
- Python inside Vim:
py:
2.7.18 (v2.7.18:8d21aa21f2, Apr 19 2020, 20:48:48)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
py3:
3.11.9 (v3.11.9:de54cf5be3, Apr 2 2024, 07:12:50) [Clang 13.0.0 (clang-1300.0.29.30)]
- Docker repo/vimrc: https://github.com/kkew3/ultisnips-issue1/tree/issue