Skip to content

Commit

Permalink
refactor!: system redesign
Browse files Browse the repository at this point in the history
New Features:
- Much better user interface
- Much more performant
- Users can now cycle through the table view
- Reduced bloat from project
- Split diff view in hunk preview
- Ability for users to perform existing commands across Project Diff Preview.
- VGit now recognizes git files outside of the project's working directory
- VGit will now recognize if a file has been renamed.
- New preview called `project_hunks_preview` to open a quick preview of all the hunks in your entire project which looks similar to the quickfix preview, but with the VGit `CodeComponent` baked inside it. Allowing you to quickly see all the diffs in your project in both split and unified diff views.
- Ton of quality life improvements
- Optimized diff rendering

Removed Features:
- diff base for gutter (current implementation makes the system very convoluted to use, e.g VSCode doesn't even support this)
- telescope integration (unnecessary bloat)
- Removed theming support (useless features makes makes codebase messy and complex)
- Removed layout support (too much configuration makes code harder to maintain)
- Renamed `buffer_staged_diff_preview` to `buffer_diff_staged_preview`

Closes issues:
- #120
- #119
- #100
- #79
- #145
- #155
- #154
- #135
  • Loading branch information
tanvirtin committed Dec 27, 2021
1 parent 5eee0e7 commit e43ce5e
Show file tree
Hide file tree
Showing 164 changed files with 10,293 additions and 8,241 deletions.
406 changes: 210 additions & 196 deletions README.md

Large diffs are not rendered by default.

459 changes: 247 additions & 212 deletions doc/vgit.txt

Large diffs are not rendered by default.

1,904 changes: 268 additions & 1,636 deletions lua/vgit.lua

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions lua/vgit/Command.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
local console = require('vgit.core.console')
local Object = require('vgit.core.Object')

local Command = Object:extend()

function Command:new()
return setmetatable({}, Command)
end

function Command:execute(command, ...)
local vgit = require('vgit')
if not command then
return
end
local starts_with = command:sub(1, 1)
if
starts_with == '_'
or not vgit[command]
or not type(vgit[command]) == 'function'
then
console.error(string.format('Invalid VGit command %s', command))
return
end
return vgit[command](...)
end

function Command:list(arglead, line)
local vgit = require('vgit')
local parsed_line = #vim.split(line, '%s+')
local matches = {}
if parsed_line == 2 then
for name, func in pairs(vgit) do
if
not vim.startswith(name, '_')
and vim.startswith(name, arglead)
and type(func) == 'function'
then
matches[#matches + 1] = name
end
end
end
return matches
end

return Command

0 comments on commit e43ce5e

Please sign in to comment.