mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
fix(yazi): nvim env
This commit is contained in:
@@ -403,7 +403,7 @@ local bat_command_pattern = "%f[%a]bat%f[%A]"
|
||||
--
|
||||
-- Pass true as the first parameter to get the function
|
||||
-- to merge the tables recursively.
|
||||
---@param deep_or_target table<any, any>|boolean Whether to merge recursively
|
||||
---@param deep_or_target table<any, any>|boolean|nil Recursively merge or not
|
||||
---@param target table<any, any> The target table to merge
|
||||
---@param ... table<any, any>[] The tables to merge
|
||||
---@return table<any, any> merged_table The merged table
|
||||
@@ -419,13 +419,13 @@ local function merge_tables(deep_or_target, target, ...)
|
||||
-- Initialise the recursive variable
|
||||
local recursive = false
|
||||
|
||||
-- If the deep or target variable not a table
|
||||
if type(deep_or_target) ~= "table" then
|
||||
-- If the deep or target variable is a boolean
|
||||
if type(deep_or_target) == "boolean" then
|
||||
--
|
||||
|
||||
-- Set the recursive variable to the boolean value of the
|
||||
-- deep or target variable
|
||||
recursive = not not deep_or_target
|
||||
recursive = deep_or_target
|
||||
|
||||
-- Set the target table to the target variable
|
||||
target_table = target
|
||||
@@ -433,12 +433,14 @@ local function merge_tables(deep_or_target, target, ...)
|
||||
-- Set the arguments to the rest of the arguments
|
||||
args = { ... }
|
||||
|
||||
-- Otherwise, the deep or target variable is a table
|
||||
-- Otherwise, the deep or target variable is not a boolean,
|
||||
-- and is most likely a table.
|
||||
else
|
||||
--
|
||||
|
||||
-- Set the target table to the deep or target variable
|
||||
target_table = deep_or_target
|
||||
-- if it is a table, otherwise, set it to an empty table
|
||||
target_table = type(deep_or_target) == "table" and deep_or_target or {}
|
||||
|
||||
-- Set the arguments to the target variable
|
||||
-- and the rest of the arguments
|
||||
@@ -1570,6 +1572,9 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
||||
}
|
||||
end
|
||||
|
||||
-- Clean up the extracted files
|
||||
clean_up()
|
||||
|
||||
-- Set the error message to the standard error
|
||||
error_message = output.stderr
|
||||
|
||||
@@ -1585,9 +1590,6 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
||||
then
|
||||
--
|
||||
|
||||
-- Clean up the extracted files
|
||||
clean_up()
|
||||
|
||||
-- Return the extractor function result
|
||||
return {
|
||||
successful = false,
|
||||
@@ -1627,13 +1629,10 @@ function SevenZip:retry_extractor(extractor_function, clean_up_wanted)
|
||||
if event == 1 and user_input ~= nil then
|
||||
self.password = user_input
|
||||
|
||||
-- Otherwise
|
||||
-- Otherwise, the user has cancelled the input
|
||||
else
|
||||
--
|
||||
|
||||
-- Call the clean up function
|
||||
clean_up()
|
||||
|
||||
-- Return the result of the extractor command
|
||||
return {
|
||||
successful = false,
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 yazi-rs
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,56 +0,0 @@
|
||||
# mime-ext.yazi
|
||||
|
||||
A mime-type provider based on a file extension database, replacing the [builtin `file(1)`](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/plugins/mime.lua) to speed up mime-type retrieval at the expense of accuracy.
|
||||
|
||||
See https://yazi-rs.github.io/docs/tips#make-yazi-even-faster for more information.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
ya pack -a yazi-rs/plugins:mime-ext
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Add this to your `~/.config/yazi/yazi.toml`:
|
||||
|
||||
```toml
|
||||
[[plugin.prepend_fetchers]]
|
||||
id = "mime"
|
||||
name = "*"
|
||||
run = "mime-ext"
|
||||
prio = "high"
|
||||
```
|
||||
|
||||
## Advanced
|
||||
|
||||
You can also customize it in your `~/.config/yazi/init.lua` with:
|
||||
|
||||
```lua
|
||||
require("mime-ext"):setup {
|
||||
-- Expand the existing filename database (lowercase), for example:
|
||||
with_files = {
|
||||
makefile = "text/makefile",
|
||||
-- ...
|
||||
},
|
||||
|
||||
-- Expand the existing extension database (lowercase), for example:
|
||||
with_exts = {
|
||||
mk = "text/makefile",
|
||||
-- ...
|
||||
},
|
||||
|
||||
-- If the mime-type is not in both filename and extension databases,
|
||||
-- then fallback to Yazi's preset `mime` plugin, which uses `file(1)`
|
||||
fallback_file1 = false,
|
||||
}
|
||||
```
|
||||
|
||||
## TODO
|
||||
|
||||
- Add more file types (PRs welcome!).
|
||||
- Compress mime-type tables.
|
||||
|
||||
## License
|
||||
|
||||
This plugin is MIT-licensed. For more information check the [LICENSE](LICENSE) file.
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user