-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: add context * WIP: add context to previewer * WIP * todo: test * todo: test * fix: git show * todo: fix switch * fix: invalid current buffer * fix: swithc * perf: set --date=short * doc: git commits * doc: keys * doc: git
- Loading branch information
1 parent
c36e378
commit ded9623
Showing
16 changed files
with
548 additions
and
115 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
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
local SELF_PATH = vim.env._FZFX_NVIM_SELF_PATH | ||
if type(SELF_PATH) ~= "string" or string.len(SELF_PATH) == 0 then | ||
io.write( | ||
string.format( | ||
"|fzfx.bin.git_commits.previewer| error! SELF_PATH is empty!" | ||
) | ||
) | ||
end | ||
vim.opt.runtimepath:append(SELF_PATH) | ||
local shell_helpers = require("fzfx.shell_helpers") | ||
|
||
local previewer = _G.arg[1] | ||
local commit = _G.arg[2] | ||
|
||
shell_helpers.log_debug("previewer:[%s]", vim.inspect(previewer)) | ||
shell_helpers.log_debug("branch:[%s]", vim.inspect(commit)) | ||
|
||
commit = vim.fn.split(commit)[1] | ||
local cmd = shell_helpers.read_provider_command(previewer) --[[@as string]] | ||
cmd = string.format("%s %s", cmd, commit) | ||
|
||
shell_helpers.log_debug("cmd:[%s]", cmd) | ||
os.execute(cmd) |
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,48 @@ | ||
local SELF_PATH = vim.env._FZFX_NVIM_SELF_PATH | ||
if type(SELF_PATH) ~= "string" or string.len(SELF_PATH) == 0 then | ||
io.write( | ||
string.format( | ||
"|fzfx.bin.git_commits.provider| error! SELF_PATH is empty!" | ||
) | ||
) | ||
end | ||
vim.opt.runtimepath:append(SELF_PATH) | ||
local shell_helpers = require("fzfx.shell_helpers") | ||
|
||
local provider = _G.arg[1] | ||
|
||
shell_helpers.log_debug("provider:[%s]", provider) | ||
|
||
local cmd = shell_helpers.read_provider_command(provider) --[[@as string]] | ||
shell_helpers.log_debug("cmd:[%s]", cmd) | ||
|
||
local git_root_cmd = shell_helpers.GitRootCommand:run() | ||
-- shell_helpers.log_debug( | ||
-- "git_root_cmd.result.stdout:%s", | ||
-- vim.inspect(git_root_cmd.result.stdout) | ||
-- ) | ||
-- shell_helpers.log_debug( | ||
-- "git_root_cmd.result.stderr:%s", | ||
-- vim.inspect(git_root_cmd.result.stderr) | ||
-- ) | ||
-- shell_helpers.log_debug( | ||
-- "git_root_cmd.result.exitcode:%s", | ||
-- vim.inspect(git_root_cmd.result.exitcode) | ||
-- ) | ||
if git_root_cmd:wrong() then | ||
return | ||
end | ||
|
||
local p = io.popen(cmd) | ||
shell_helpers.log_ensure( | ||
p ~= nil, | ||
"error! failed to open pipe on cmd! %s", | ||
vim.inspect(cmd) | ||
) | ||
--- @diagnostic disable-next-line: need-check-nil | ||
for line in p:lines("*line") do | ||
-- shell_helpers.log_debug("line:%s", vim.inspect(line)) | ||
io.write(string.format("%s\n", line)) | ||
end | ||
--- @diagnostic disable-next-line: need-check-nil | ||
p:close() |
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
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
Oops, something went wrong.