Skip to content

Commit 478f726

Browse files
cosmicbuffalodlyongemallo
authored andcommitted
docs: add :DiffviewToggle docs (sindrets#517)
1 parent 3e27322 commit 478f726

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

doc/diffview.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ for any git rev.
1818

1919
USAGE *diffview-usage*
2020

21-
Quick-start: `:DiffviewOpen` to open a Diffview that compares against the
21+
Quick-start: `:DiffviewOpen` or `:DiffviewToggle` to open a Diffview that compares against the
2222
index.
2323

2424
You can have multiple Diffviews open, tracking different git revs. Each Diffview
25-
opens in its own tabpage. To close and dispose of a Diffview, call either
26-
`:DiffviewClose` or `:tabclose` while a Diffview is the current tabpage.
25+
opens in its own tabpage. To close and dispose of a Diffview, call
26+
`:DiffviewClose`, `:DiffviewToggle` or `:tabclose` while a Diffview is the current tabpage.
2727
Diffviews are automatically updated:
2828

2929
• Every time you enter a Diffview
@@ -370,6 +370,13 @@ COMMANDS *diffview-commands*
370370
*:DiffviewClose*
371371
:DiffviewClose Close the active Diffview.
372372

373+
*:DiffviewToggle*
374+
:DiffviewToggle [git-rev] [options] [ -- {paths...}]
375+
376+
Alias for `:DiffviewOpen` when the current tabpage is not a Diffview,
377+
otherwise acts as an alias for `:DiffviewClose`. Accepts the same
378+
arguments as `:DiffviewOpen`.
379+
373380
*:DiffviewToggleFiles*
374381
:DiffviewToggleFiles Toggles the file panel.
375382

lua/diffview/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ function M.open(args)
133133
end
134134
end
135135

136-
137136
---@param range? { [1]: integer, [2]: integer }
138137
---@param args string[]
139138
function M.file_history(range, args)

0 commit comments

Comments
 (0)