You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When previewing source files it appears to be using a default tab size, but anything that uses a non-default setting isn't rendered properly (this is also an issue with telescope and fzf-lua in neovim+lazy).
Feature
If a source file has a modeline (vim terminology) or file-variables (emacs terminology), then use that for the tab settings for example by extracting tab-width (emacs file variables) or ts (vim modeline).
If the file type if specified, for example using the mode (emacs) or ft (vim) then use that rather than the file extension (for example, I use the C mode/filetype for .ragel files because I don't have a mode for ragel, but it mostly looks like C).
Examples
An example of a Makefile with both emacs file variables and a vim modeline is as follows:
Additional context
There are a few projects around that use regular expressions to parse out the file variables/modelines from the first 5-10 lines of each file, here's a fairly comprehensive looking example:
Problem
When previewing source files it appears to be using a default tab size, but anything that uses a non-default setting isn't rendered properly (this is also an issue with telescope and fzf-lua in neovim+lazy).
Feature
If a source file has a modeline (vim terminology) or file-variables (emacs terminology), then use that for the tab settings for example by extracting
tab-width
(emacs file variables) orts
(vim modeline).If the file type if specified, for example using the
mode
(emacs) orft
(vim) then use that rather than the file extension (for example, I use the C mode/filetype for .ragel files because I don't have a mode for ragel, but it mostly looks like C).Examples
An example of a Makefile with both emacs file variables and a vim modeline is as follows:
Additional context
There are a few projects around that use regular expressions to parse out the file variables/modelines from the first 5-10 lines of each file, here's a fairly comprehensive looking example:
https://github.com/github-linguist/linguist/blob/main/lib/linguist/strategy/modeline.rb
The text was updated successfully, but these errors were encountered: