Conversation
Alhadis
added a commit
to file-icons/atom
that referenced
this pull request
Mar 12, 2021
The capitalisation of "prolog" is left intact to assert case-insensitive comparison of language names (i.e., we don't care that Vim's Prolog mode is actually lowercase).
Alhadis
added a commit
to Alhadis/YASR
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-etc
that referenced
this pull request
Mar 12, 2021
Also, fix a copy+paste error in the gitattributes(5) grammar.
Alhadis
added a commit
to Alhadis/language-grammars
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-fontforge
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-viml
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-gn
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-apl
that referenced
this pull request
Mar 12, 2021
Alhadis
added a commit
to Alhadis/language-roff
that referenced
this pull request
Mar 13, 2021
Alhadis
added a commit
to Alhadis/language-emacs-lisp
that referenced
this pull request
Mar 13, 2021
Alhadis
added a commit
to Alhadis/language-webassembly
that referenced
this pull request
Mar 13, 2021
Alhadis
added a commit
to Alhadis/language-sed
that referenced
this pull request
Mar 13, 2021
Alhadis
added a commit
to Alhadis/language-texinfo
that referenced
this pull request
Mar 13, 2021
lildude
approved these changes
Mar 19, 2021
Member
lildude
left a comment
There was a problem hiding this comment.
Nice 😍 I'm surprised we've gone for so long without anyone noticing 🤭
Alhadis
added a commit
to Lukasa/language-restructuredtext
that referenced
this pull request
Aug 6, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a handful of oversights and behavioural discrepancies with the regular expressions used by our modeline strategy (detailed below).
Description
Whilst reviewing #4138, I recommended
[ \t]be used instead of[:blank:]. However, I didn't think to check if the submitter applied the changes correctly. Only recently did I notice Vim's modeline regex had an erroneous[^\\[ \t]](which should have been[^\\ \t]instead).Realising there might be other things I missed, I recently took the time to double-check both regexes and verify their behaviour matches that of Emacs and Vim. Among the things I found were:
:help modelinesays that modelines must be prefixed by “the stringvi:,vim:,Vim:orex:”. Mixed-case prefixes likevIM:orViM:don't work, soVIM_MODELINEshouldn't be flagged as case-insensitive.Vimorvim.Our current pattern allows
vi>600: ft=rubyand# ex>600: ft=ruby, neither of which actually work in Vim.This was due to
\sbeing used instead of[ \t]. An embarrassing habit I've picked up from years of writing TextMate grammars is to assume\sonly matches horizontal whitespace, instead of line-breaks as well. Ergo, something like this (obviously) shouldn't match:So Ruby's insidious treatment of
.meant that.*?also matched newlines, which it logically shouldn't. I resolved this by unsetting multiline mode with(?-m).vim: set … :.A trivial issue that probably won't ever surface in practice; fixed by updating classes to use
\r\ninstead of just\n.(Template removed as it doesn't apply)