This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Implement missing function calls and fix shebang detection #93
Open
Xevnar
wants to merge
21
commits into
nathom:main
Choose a base branch
from
Xevnar:dist_ft_fixes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
I created a `filetype.detect` module that stores the functions used to detect the filetypes of shell files. The function I implemented checks is the shell name passed to it is in the shebang table and sets filetype to that or it sets the filetype to the shell name directly. I also moved the `analyze_shebang` function to `filetype_detect` since it fits there more than having it in the main module. I moved `getlines` to `filetype.util` and renamed it to `getlines_as_string` The shell functions I added were taken from `vim.filetype.detect` but I modified the behaviour so that it bash, ksh, and dash do not get converted to sh filetype and instead it is up to the user to do so if they want. closes: #79,#34 Can correctly identify shebangs with arguments closes: #63 Can correctly identify python3 files as python closes: #43 Provide an option to set a default filetype
…tion callback This allows for more intricate functions to be written that provide better filetype detection
…ml file detection
closes: #91 all `dist#ft` functions that are being used have been ported over
My bad, I didn't know that deleting the original repository also affected the pull request. |
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.
I created a
filetype.detect
module that stores the functions usedto detect the filetypes of shell files.
The function I implemented checks is the shell name passed to it
is in the shebang table and sets filetype to that or it sets the
filetype to the shell name directly.
I also moved the
analyze_shebang
function tofiletype_detect
since it fits there more than having it in the main module.
I moved
getlines
tofiletype.util
and renamed it togetlines_as_string
The shell functions I added were taken from
vim.filetype.detect
but I modified the behaviour so that it bash, ksh, and dash do
not get converted to sh filetype and instead it is up to the user
to do so if they want.
I also fixed some broken
muttrc
lua patterns and added a mapping for.service
files.closes: #79,#34 Can correctly identify shebangs with arguments
closes: #63 Can correctly identify python3 files as python
closes: #43 Provide an option to set a default filetype
closes: #91 all
dist#ft
functions that are being used have been ported overcloses: #73 map
.service
files tosystemd
filetype