FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
diffview.nvim/lua/diffview/ffi.lua at main · vramana/diffview.nvim · GitHub
vramana
/
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
/
lua
/
diffview
/
ffi.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (39 loc) · 1.16 KB
Breadcrumbs
diffview.nvim
/
lua
/
diffview
/
ffi.lua
Copy path
File metadata and controls
50 lines (39 loc) · 1.16 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
local
ffi
=
require
(
"
ffi
"
)
local
C
=
ffi
.
C
local
M
=
setmetatable
({}, {
__index
=
ffi
})
local
HAS_NVIM_0_9
=
vim
.
fn
.
has
(
"
nvim-0.9
"
)
==
1
---
Check if the |textlock| is active.
---
@return
boolean
function
M
.
nvim_is_textlocked
()
return
C
.
textlock
>
0
end
---
Check if the nvim API is locked for any reason.
---
See: |api-fast|, |textlock|
---
@return
boolean
function
M
.
nvim_is_locked
()
if
vim
.
in_fast_event
()
then
return
true
end
if
HAS_NVIM_0_9
then
return
C
.
textlock
>
0
or
C
.
allbuf_lock
>
0
or
C
.
expr_map_lock
>
0
end
return
C
.
textlock
>
0
or
C
.
allbuf_lock
>
0
or
C
.
ex_normal_lock
>
0
end
ffi
.
cdef
(
[[
/// Non-zero when changing text and jumping to another window or editing another buffer is not
/// allowed.
extern int textlock;
/// Non-zero when no buffer name can be changed, no buffer can be deleted and
/// current directory can't be changed. Used for SwapExists et al.
extern int allbuf_lock;
]]
)
if
HAS_NVIM_0_9
then
ffi
.
cdef
(
[[
/// Running expr mapping, prevent use of ex_normal() and text changes
extern int expr_map_lock;
]]
)
else
ffi
.
cdef
(
[[
/// prevent use of ex_normal()
extern int ex_normal_lock;
]]
)
end
return
M
Back
|
FazBrowse Home
|
New Git URL