Skip to content

Commit 55f9519

Browse files
committed
Revert "Merge upstream PR sindrets#477 from sindrets/diffview.nvim"
This reverts commit 59d556e, reversing changes made to 4516612.
1 parent 59d556e commit 55f9519

File tree

6 files changed

+0
-25
lines changed

6 files changed

+0
-25
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ require("diffview").setup({
189189
use_icons = true, -- Requires nvim-web-devicons
190190
show_help_hints = true, -- Show hints for how to open the help panel
191191
watch_index = true, -- Update views and index buffers when the git index changes.
192-
delete_buffer_on_diff_exit = false, -- Delete file buffers opened by diffview that were not opened
193192
icons = { -- Only applies when use_icons is true.
194193
folder_closed = "",
195194
folder_open = "",

doc/diffview_defaults.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ DEFAULT CONFIG *diffview.defaults*
1010
use_icons = true, -- Requires nvim-web-devicons
1111
show_help_hints = true, -- Show hints for how to open the help panel
1212
watch_index = true, -- Update views and index buffers when the git index changes.
13-
delete_buffer_on_diff_exit = false, -- Delete file buffers opened by diffview that were not opened
1413
icons = { -- Only applies when use_icons is true.
1514
folder_closed = "",
1615
folder_open = "",

lua/diffview/config.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ M.defaults = {
4444
use_icons = true,
4545
show_help_hints = true,
4646
watch_index = true,
47-
delete_buffer_on_diff_exit = false,
4847
icons = {
4948
folder_closed = "",
5049
folder_open = "",

lua/diffview/scene/view.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ function View:init_layout() oop.abstract_stub() end
3838
---@abstract
3939
function View:post_open() oop.abstract_stub() end
4040

41-
---@abstract
42-
function View:pre_open() oop.abstract_stub() end
43-
4441
---@diagnostic enable unused-local
4542

4643
---View constructor
@@ -65,7 +62,6 @@ function View:init(opt)
6562
end
6663

6764
function View:open()
68-
self:pre_open()
6965
vim.cmd("tab split")
7066
self.tabpage = api.nvim_get_current_tabpage()
7167
self:init_layout()

lua/diffview/scene/views/diff/diff_view.lua

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ function DiffView:init(opt)
7777
self.attached_bufs = {}
7878
self.emitter:on("file_open_post", utils.bind(self.file_open_post, self))
7979
self.valid = true
80-
self.buffers_pre_open = {}
81-
end
82-
83-
function DiffView:pre_open()
84-
self.buffers_pre_open = vim.api.nvim_list_bufs()
8580
end
8681

8782
function DiffView:post_open()
@@ -175,16 +170,6 @@ end
175170

176171
---@override
177172
function DiffView:close()
178-
if config.get_config().delete_buffer_on_diff_exit then
179-
-- delete buffers that were opened by the view
180-
local buffers_pre_close = vim.api.nvim_list_bufs()
181-
for _, buf in ipairs(buffers_pre_close) do
182-
if not vim.tbl_contains(self.buffers_pre_open, buf) then
183-
vim.api.nvim_buf_delete(buf, { force = false})
184-
end
185-
end
186-
end
187-
188173
if not self.closing:check() then
189174
self.closing:send()
190175

lua/diffview/scene/views/file_history/file_history_view.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ function FileHistoryView:init(opt)
3939
self.valid = true
4040
end
4141

42-
function FileHistoryView:pre_open()
43-
end
44-
4542
function FileHistoryView:post_open()
4643
self.commit_log_panel = CommitLogPanel(self.adapter, {
4744
name = ("diffview://%s/log/%d/%s"):format(self.adapter.ctx.dir, self.tabpage, "commit_log"),

0 commit comments

Comments
 (0)