Commits
- Commit:
8358793fd4a596f5a0b865ea0530c275c099defa- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Fix restoration of original filename in Vim
Vim has built-in autocmds for filename suffixes such as .bak, .old, and
.new that remove the trailing suffix from the file name and run file
type detection with the resulting filename. The s:ft_vim() function in
this plugin's ftdetect script receives that filename as an argument.
Prior to this change, it would attempt to rename the file to the given
filename after finishing its filetype detection work. As a result,
a file named "foo.j2.old" would be renamed to "foo.j2". This change
fixes the behavior by renaming the file to the original buffer name
rather than the filename passed to the function.
- Commit:
b83bda57ed2423db0bafd131a8a83f8863fb9172- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Merge branch 'btl/issue-4-bufname' into btl/main
- Commit:
592594b2bec6162a2effb780244744d213d7bb3f- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Ensure temporary file path is unique
This fixes an error that occurred when the temporary filename used for
filetype detection in Vim was identical to the name of another file
already open in Vim. To prevent this from happening, a temporary
directory is created and used as the prefix for the temporary filename.
- Commit:
4a678b53f9da9571333899c9df172b32e4a56df4- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Merge branch 'btl/issue-3-ftdetect' into btl/main
- Commit:
1ab4b34adb9b0225da2f1638460ad0c5737e0730- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Don't reset ft after change to unrecognized suffix
The ftdetect script handled file renames from a recognized compound file
extension such as "foo.html.jinja" to an unrecognized extension such as
"foo.xxxx.jinja" by resetting the filetype to "jinja." However, the
logic used to implement this behavior conflicts with Vim's automatic
filetype detection, causing files with certain compound file extensions
to be set to the "jinja" filetype rather than the detected compound
filetype. This commit fixes this by removing the filetype-reset logic,
which both fixes this bug and brings the plugin's behavior closer to
Vim's default handling of file renames.
This bug occurs because Vim's built-in ftdetect logic, which runs before
this plugin's ftdetect script, sometimes correctly identifies the
filetype for files with a Jinja extension. For example, Vim will set the
filetype to "apache" for a file named "httpd.conf.j2", and it will set
the filetype to "sh" for a file named "foo.sh.j2" if it contains
a /bin/sh shebang.
When Vim correctly detected the filetype in the cases described above,
l:previous_ft was set to that filetype in this plugin's ftdetect script.
The script then proceeded to execute its own filetype detection logic,
producing the same result. The script then compared l:previous_ft to the
detected result and, finding them the same, erroneously treated this as
a file renamed to an invalid compound type and reset the filetype to
"jinja".
The motivation for removing this logic altogether here rather than
attempting to fix the logic is that Vim's default ftdetect behavior on
file renames is less clever than the plugin was attempting to be. If you
edit a new file in vim named "foo.sh", the filetype will be set to sh.
If you then run ":saveas foo.c", the filetype will remain "sh" rather
than being updated to "c". Since Vim doesn't attempt to execute ftdetect
heuristics on file renames, it seems reasonable to imitate that behavior
in this plugin.
- Commit:
677c930a18e4f7924ac44c4dcf9672d3f7d0dbdb- From:
- Benjamin Linskey <git@linskey.org>
- Date:
Fix typo in readme
- Commit:
05373374a288b20845937cbc3a7abda23a2e65d2- From:
- HiPhish <hiphish@posteo.de>
- Date:
Silence file type detection in Neovim
- Commit:
dacfd49e9f410647b62b3ae7905a7628cfd61d5e- From:
- HiPhish <hiphish@posteo.de>
- Date:
Merge branch 'syntax-on'
- Commit:
56feeed8504aff3ad9b6cb1dd13f1035b08a68ff- From:
- HiPhish <hiphish@posteo.de>
- Date:
Update syntax test to be in line with upstream
There is a syntax file included upstream which should be taken as the
canonical syntax highlighting.
- Commit:
7e8399c4c76620eaafa8120dc38e0180668b6e79- From:
- HiPhish <hiphish@posteo.de>
- Date:
Add comments to `.submodules` file
- Commit:
950b01fae0a8aa23e8332d8072fec0bc307c377e- From:
- HiPhish <hiphish@posteo.de>
- Date:
Fix file type detection for Neovim
- Commit:
cd939896b8d73ce6b3f31a734b516e32383a76a4- From:
- HiPhish <hiphish@posteo.de>
- Date:
Hide Git submodules from plugin managers
I have renamed the `.gitmodules` file so Git no longer picks it up.
Contributors have to create a symbolic link.
- Commit:
99afb6bf05b761d87abc0833304b508521ca2bd0- From:
- HiPhish <hiphish@posteo.de>
- Date:
Update README
Mention all the supported extensions.
- Commit:
966cc763f35472ea1033743766688621d93a39af- From:
- HiPhish <hiphish@posteo.de>
- Date:
Add `commentstring` setting for Jinja
- Commit:
f29c4abc60dae17b2931621748d14d2759e00a6c- From:
- HiPhish <hiphish@posteo.de>
- Date:
Make the node bold
- Commit:
697c1d4f200a3d520c0aebe3152b698d0c6425ec- From:
- HiPhish <hiphish@posteo.de>
- Date:
Make note in README more prominent
- Commit:
a56da59ed3b49f09b4b20e35b80a197bc7f54fe4- From:
- HiPhish <hiphish@posteo.de>
- Date:
Add test for FQCN highlighting
- Commit:
5674eee5f22fbe9dad382eac21d52b65b48d6083- From:
- HiPhish <hiphish@posteo.de>
- Date:
Merge branch 'patch-1' into 'master'
fix: FQCN highlighting of Jinja2 filters
See merge request HiPhish/jinja.vim!3
- Commit:
975e0eb900b5410dd8fdd42e944e2078dd6a42b0- From:
- Vadim A. Misbakh-Soloviov <gitlab@mva.name>
- Date:
fix: FQCN highlighting of Jinja2 filters
See: https://github.com/pearofducks/ansible-vim/commit/3329367d2e5f90d203c8d340c53fa83c60a1ad41
(and links to the issues there)
- Commit:
06fcfeeb20c6c76d6fee021b250c8780c38e2925- From:
- HiPhish <hiphish@posteo.de>
- Date:
Add `import` to keywords for Jinja detection
- Commit:
70c2d09857bc2ff75a91b017271ffaa004201df9- From:
- HiPhish <hiphish@posteo.de>
- Date:
Update test shims
- Commit:
c06165c2074790a220a20845b5246be61edd01b6- From:
- Axel H. <noirbizarre@gmail.com>
- Date:
fix(ftdetect): escape filenames to avoid failure on special chars (fix #3)
- Commit:
81c0602f531ceceb20dba9ccb9a04d047a90b200- From:
- HiPhish <hiphish@posteo.de>
- Date:
Silence file type detection
- Commit:
a6a6477f6f75604ce3df6d870bbfbd8dc176e196- From:
- HiPhish <hiphish@posteo.de>
- Date:
Do not use Neovim functions in filetype detection
- Commit:
d112541c062122969c6c0bc3df7e3cab3595c253- From:
- HiPhish <hiphish@posteo.de>
- Date:
Add note about submodules to README
