FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
diffview.nvim/plugin/diffview.lua at main · Naxdy/diffview.nvim · GitHub
Naxdy
/
diffview.nvim
Public
forked from
sindrets/diffview.nvim
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
diffview.nvim
/
plugin
/
diffview.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (43 loc) · 1.5 KB
Breadcrumbs
diffview.nvim
/
plugin
/
diffview.lua
Copy path
File metadata and controls
57 lines (43 loc) · 1.5 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
if
vim
.
g
.
diffview_nvim_loaded
or
not
require
(
"
diffview.bootstrap
"
)
then
return
end
vim
.
g
.
diffview_nvim_loaded
=
1
local
lazy
=
require
(
"
diffview.lazy
"
)
---
@module
"
diffview
"
local
arg_parser
=
lazy
.
require
(
"
diffview.arg_parser
"
)
---
@module
"
diffview.arg_parser
"
local
diffview
=
lazy
.
require
(
"
diffview
"
)
---
@module
"
diffview
"
local
api
=
vim
.
api
local
command
=
api
.
nvim_create_user_command
--
NOTE: Need this wrapper around the completion function becuase it doesn't
--
exist yet.
local
function
completion
(...)
return
diffview
.
completion
(
...
)
end
--
Create commands
command
(
"
DiffviewOpen
"
,
function
(
ctx
)
diffview
.
open
(
arg_parser
.
scan
(
ctx
.
args
).
args
)
end
, {
nargs
=
"
*
"
,
complete
=
completion
})
command
(
"
DiffviewFileHistory
"
,
function
(
ctx
)
local
range
if
ctx
.
range
>
0
then
range
=
{
ctx
.
line1
,
ctx
.
line2
}
end
diffview
.
file_history
(
range
,
arg_parser
.
scan
(
ctx
.
args
).
args
)
end
, {
nargs
=
"
*
"
,
complete
=
completion
,
range
=
true
})
command
(
"
DiffviewClose
"
,
function
()
diffview
.
close
()
end
, {
nargs
=
0
,
bang
=
true
})
command
(
"
DiffviewFocusFiles
"
,
function
()
diffview
.
emit
(
"
focus_files
"
)
end
, {
nargs
=
0
,
bang
=
true
})
command
(
"
DiffviewToggleFiles
"
,
function
()
diffview
.
emit
(
"
toggle_files
"
)
end
, {
nargs
=
0
,
bang
=
true
})
command
(
"
DiffviewRefresh
"
,
function
()
diffview
.
emit
(
"
refresh_files
"
)
end
, {
nargs
=
0
,
bang
=
true
})
command
(
"
DiffviewLog
"
,
function
()
vim
.
cmd
((
"
sp %s | norm! G
"
):
format
(
vim
.
fn
.
fnameescape
(
DiffviewGlobal
.
logger
.
outfile
)
))
end
, {
nargs
=
0
,
bang
=
true
})
Back
|
FazBrowse Home
|
New Git URL