<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rneovim.git/runtime/filetype.lua, branch userreg</title>
<subtitle>Neovim fork with Rahm's personal hacks.</subtitle>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/'/>
<entry>
<title>fix(filetype): make sure buffer is valid before call nvim_buf_call (#24922)</title>
<updated>2023-08-30T15:14:58+00:00</updated>
<author>
<name>Hongbo Liu</name>
<email>hongboliu@tencent.com</email>
</author>
<published>2023-08-30T15:14:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=670c7609c85547ef041af8cf17139a396d6af050'/>
<id>670c7609c85547ef041af8cf17139a396d6af050</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(filetype): call on_detect before setting buffer filetype</title>
<updated>2023-08-24T17:48:21+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>greg@gpanders.com</email>
</author>
<published>2023-08-24T17:48:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=020d1f626a3fbda84b84b2f57e8a85662a792a1a'/>
<id>020d1f626a3fbda84b84b2f57e8a85662a792a1a</id>
<content type='text'>
The on_detect functions returned by filetype.lua set buffer local
variables which are often used by filetype plugins. For example, the
on_detect function for shell buffers sets variables such as b:is_bash or
b:is_sh, which are used by the sh ftplugin.

When called after setting the buffer's filetype, these variables cannot
be used by the ftplugin (because they are not yet defined). Instead,
call on_detect before setting the buffer filetype so that any buffer
variables set by on_detect can be used in the ftplugin.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The on_detect functions returned by filetype.lua set buffer local
variables which are often used by filetype plugins. For example, the
on_detect function for shell buffers sets variables such as b:is_bash or
b:is_sh, which are used by the sh ftplugin.

When called after setting the buffer's filetype, these variables cannot
be used by the ftplugin (because they are not yet defined). Instead,
call on_detect before setting the buffer filetype so that any buffer
variables set by on_detect can be used in the ftplugin.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(runtime): respect 'rtp' order for all runtime files (#24335)</title>
<updated>2023-07-13T22:46:16+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2023-07-13T22:46:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=dbb840da01c72d8a311e0c55d3248d78a64b63a4'/>
<id>dbb840da01c72d8a311e0c55d3248d78a64b63a4</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>feat(runtime)!: remove filetype.vim (#20428)</title>
<updated>2022-10-17T06:52:40+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2022-10-17T06:52:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9'/>
<id>042eb74ff1ed63d79f8a642649cd6be6ec4b0eb9</id>
<content type='text'>
Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Made obsolete by now graduated `filetype.lua` (enabled by default).

Note that changes or additions to the filetype detection still need to
be made through a PR to vim/vim as we port the _logic_ as well as tests.</pre>
</div>
</content>
</entry>
<entry>
<title>fix(filetype): use :setf instead of nvim_buf_set_option (#20334)</title>
<updated>2022-09-25T14:29:25+00:00</updated>
<author>
<name>zeertzjq</name>
<email>zeertzjq@outlook.com</email>
</author>
<published>2022-09-25T14:29:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f8a1cadccff39923643fdea2e282be9fffa60e99'/>
<id>f8a1cadccff39923643fdea2e282be9fffa60e99</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(filetype): run filetype.match on StdinReadPost (#20070)</title>
<updated>2022-09-03T17:27:57+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2022-09-03T17:27:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=927d4d2a15b8474cd6c605df65ef53873cf73131'/>
<id>927d4d2a15b8474cd6c605df65ef53873cf73131</id>
<content type='text'>
Problem: filetype detection does not run on piped input
Solution: add `StdinReadPost` to main filetype.lua autocommand

Rationale: legacy filetype detection checked contents by sourcing
`scripts.vim` in separate autocommands, including on `StdinReadPost`.
For Lua filetype detection, this was moved into the main autocommand,
with bundled `scripts.vim` gated behind `g:do_legacy_filetype` (i.e.,
only user `scripts.vim` are sourced for compatibility by default). Adding
`StdinReadPost` to the main autocommand again runs content checks on
piped input without requiring code duplication and low-payoff
refactoring.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: filetype detection does not run on piped input
Solution: add `StdinReadPost` to main filetype.lua autocommand

Rationale: legacy filetype detection checked contents by sourcing
`scripts.vim` in separate autocommands, including on `StdinReadPost`.
For Lua filetype detection, this was moved into the main autocommand,
with bundled `scripts.vim` gated behind `g:do_legacy_filetype` (i.e.,
only user `scripts.vim` are sourced for compatibility by default). Adding
`StdinReadPost` to the main autocommand again runs content checks on
piped input without requiring code duplication and low-payoff
refactoring.</pre>
</div>
</content>
</entry>
<entry>
<title>feat(runtime)!: enable filetype.lua by default (#19216)</title>
<updated>2022-07-07T16:53:47+00:00</updated>
<author>
<name>Christian Clason</name>
<email>c.clason@uni-graz.at</email>
</author>
<published>2022-07-07T16:53:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=72877bb17d70362f91a60b31bf0244dbf8ed58ae'/>
<id>72877bb17d70362f91a60b31bf0244dbf8ed58ae</id>
<content type='text'>
* revert to filetype.vim by setting `g:do_legacy_filetype`
* skip either filetype.lua or filetype.vim via `g:did_load_filetypes`

(Running both is no longer required and therefore no longer supported.)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* revert to filetype.vim by setting `g:do_legacy_filetype`
* skip either filetype.lua or filetype.vim via `g:did_load_filetypes`

(Running both is no longer required and therefore no longer supported.)</pre>
</div>
</content>
</entry>
<entry>
<title>fix(filetype): remove call to vim.fn.resolve and pass filename to match function</title>
<updated>2022-07-06T14:25:51+00:00</updated>
<author>
<name>smjonas</name>
<email>jonas.strittmatter@gmx.de</email>
</author>
<published>2022-07-06T14:25:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f9683f28236599a7082f43304a9685fad8ee8e00'/>
<id>f9683f28236599a7082f43304a9685fad8ee8e00</id>
<content type='text'>
For example on MacOS, /etc/hostname.file is symlinked to
/private/etc/hostname.file. We only care about the original file path though.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For example on MacOS, /etc/hostname.file is symlinked to
/private/etc/hostname.file. We only care about the original file path though.
</pre>
</div>
</content>
</entry>
<entry>
<title>fix(filetype): fix filetype patterns</title>
<updated>2022-07-06T14:25:23+00:00</updated>
<author>
<name>smjonas</name>
<email>jonas.strittmatter@gmx.de</email>
</author>
<published>2022-07-06T14:25:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f3c78a4465942db62cf231b9eedc5107ad46e655'/>
<id>f3c78a4465942db62cf231b9eedc5107ad46e655</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>refactor(filetype)!: allow vim.filetype.match to use different strategies (#18895)</title>
<updated>2022-06-26T16:41:20+00:00</updated>
<author>
<name>Gregory Anders</name>
<email>8965202+gpanders@users.noreply.github.com</email>
</author>
<published>2022-06-26T16:41:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.josher.dev/rneovim.git/commit/?id=f3ce06cfa139ca3fb142cf5adf96a2ecc4d8f551'/>
<id>f3ce06cfa139ca3fb142cf5adf96a2ecc4d8f551</id>
<content type='text'>
This enables vim.filetype.match to match based on a buffer (most
accurate) or simply a filename or file contents, which are less accurate
but may still be useful for some scenarios.

When matching based on a buffer, the buffer's name and contents are both
used to do full filetype matching. When using a filename, if the file
exists the file is loaded into a buffer and full filetype detection is
performed. If the file does not exist then filetype matching is only
performed against the filename itself. Content-based matching does the
equivalent of scripts.vim, and matches solely based on file contents
without any information from the name of the file itself (e.g. for
shebangs).

BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead 
of `vim.filetype.match(name, bufnr)`</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This enables vim.filetype.match to match based on a buffer (most
accurate) or simply a filename or file contents, which are less accurate
but may still be useful for some scenarios.

When matching based on a buffer, the buffer's name and contents are both
used to do full filetype matching. When using a filename, if the file
exists the file is loaded into a buffer and full filetype detection is
performed. If the file does not exist then filetype matching is only
performed against the filename itself. Content-based matching does the
equivalent of scripts.vim, and matches solely based on file contents
without any information from the name of the file itself (e.g. for
shebangs).

BREAKING CHANGE: use `vim.filetype.match({buf = bufnr})` instead 
of `vim.filetype.match(name, bufnr)`</pre>
</div>
</content>
</entry>
</feed>
