Skip to content

Commit

Permalink
fix(git_log): use unit separator as delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
tanvirtin committed Jul 10, 2024
1 parent 54d0d4c commit 90723e8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions lua/vgit/features/screens/HistoryScreen/Store.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function Store:get_diff(index)

if lines_err then return nil, lines_err end

-- TODO(renames): If a file is renamed changes are not reflected.
local diff = Diff():generate(hunks, lines, self.shape)

self.state[id] = diff
Expand Down
2 changes: 0 additions & 2 deletions lua/vgit/features/screens/ProjectCommitsScreen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ function ProjectCommitsScreen:show(args)
local buffer = Buffer(0)
local filename = buffer:get_name()

-- TODO: Need to add an arg parser in core that takes you can
-- somehow define and then parse the input using definition.
for i = 1, #args do
local arg = args[i]

Expand Down
2 changes: 1 addition & 1 deletion lua/vgit/git/GitLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local Object = require('vgit.core.Object')
local GitLog = Object:extend()

function GitLog:constructor(line, revision_count)
local log = vim.split(line, '-')
local log = vim.split(line, '\x1F')
local parents = vim.split(log[2], ' ')
local revision = revision_count and string.format('HEAD~%s', revision_count)

Expand Down
2 changes: 1 addition & 1 deletion lua/vgit/git/git_log.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local GitLog = require('vgit.git.GitLog')
local gitcli = require('vgit.git.gitcli')

local git_log = { format = '--pretty=format:"%H-%P-%at-%an-%ae-%s"' }
local git_log = { format = '--pretty=format:"%H\x1F%P\x1F%at\x1F%an\x1F%ae\x1F%s"' }

function git_log.get(reponame, commit)
if not reponame then return nil, { 'reponame is required' } end
Expand Down
2 changes: 0 additions & 2 deletions lua/vgit/ui/components/FoldableListComponent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ function FoldableListComponent:generate_lines()
if items then icon_hl_range_offset = 3 end

if item.virtual_text then
-- TODO: add other support right now just use before
virtual_texts[#virtual_texts + 1] = {
type = 'before',
hl = item.virtual_text.before.hl,
Expand Down Expand Up @@ -234,7 +233,6 @@ function FoldableListComponent:paint()
local virtual_texts = self.state.virtual_texts
for i = 1, #virtual_texts do
local virtual_text = virtual_texts[i]
-- TODO: add other support right now just use before
if virtual_text.type == 'before' then
self.buffer:transpose_virtual_text({
text = virtual_text.text,
Expand Down

0 comments on commit 90723e8

Please sign in to comment.