-
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: stylua fixes and start to build from core
- Loading branch information
1 parent
7f6377f
commit 95ac3aa
Showing
18 changed files
with
934 additions
and
2,028 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
self = false | ||
|
||
ignore = { | ||
} | ||
read_globals = { | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 4 | ||
quote_style = "AutoPreferSingle" | ||
call_parentheses = "NoSingleTable" | ||
collapse_simple_statement = "Never" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
local M = {} | ||
|
||
---@class GitWorktreeConfig | ||
|
||
---@class GitWorktreePartialConfig | ||
---@field change_directory_command? string | ||
---@field update_on_change? boolean | ||
---@field update_on_change_command? string | ||
---@field clearjumps_on_change? boolean | ||
---@field confirm_telescope_deletions? boolean | ||
---@field autopush? boolean | ||
|
||
---@return GitWorktreeConfig | ||
function M.get_default_config() | ||
return { | ||
change_directory_command = 'cd', | ||
update_on_change = true, | ||
update_on_change_command = 'e .', | ||
clearjumps_on_change = true, | ||
confirm_telescope_deletions = true, | ||
autopush = false, | ||
} | ||
end | ||
|
||
---@param partial_config GitWorktreePartialConfig | ||
---@param latest_config GitWorktreeConfig? | ||
---@return GitWorktreeConfig | ||
function M.merge_config(partial_config, latest_config) | ||
local config = latest_config or M.get_default_config() | ||
|
||
config = vim.tbl_extend('force', config, partial_config) | ||
|
||
return config | ||
end | ||
|
||
return M |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
local Enum = function(tbl) | ||
return setmetatable(tbl, { | ||
__index = function(_, key) | ||
error(string.format("%s does not exist for this enum.", key)) | ||
end, | ||
|
||
__newindex = function(_, _, _) | ||
error("Enums are immutable. You are not able to set new values") | ||
end, | ||
}) | ||
end | ||
|
||
return { | ||
Operations = Enum({ | ||
Create = "create", | ||
Switch = "switch", | ||
Delete = "delete", | ||
}), | ||
} | ||
-- --- @class GitWorktreeOperation | ||
-- | ||
-- --- @return GitWorktreeOperation: A enum reperesenting worktree operation being performed | ||
-- local Enum = function(tbl) | ||
-- return setmetatable(tbl, { | ||
-- __index = function(_, key) | ||
-- error(string.format("%s does not exist for this enum.", key)) | ||
-- end, | ||
-- | ||
-- __newindex = function(_, _, _) | ||
-- error("Enums are immutable. You are not able to set new values") | ||
-- end, | ||
-- }) | ||
-- end | ||
-- | ||
-- return { | ||
-- Operation = Enum({ | ||
-- Create = "create", | ||
-- Switch = "switch", | ||
-- Delete = "delete", | ||
-- }), | ||
-- } |
Oops, something went wrong.