mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Compare commits
362 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e96f75a4e6 | ||
![]() |
8d420a32db | ||
![]() |
fdcdf560da | ||
![]() |
22a327a20e | ||
![]() |
d63848c918 | ||
![]() |
a6c54fdfc1 | ||
![]() |
a7392c04d9 | ||
![]() |
7908900859 | ||
![]() |
a8eddf1eb1 | ||
![]() |
938a600847 | ||
![]() |
3a50639331 | ||
![]() |
f132efaefb | ||
![]() |
46cc8a52b2 | ||
![]() |
a3cc513b67 | ||
![]() |
a986048cb0 | ||
![]() |
d7ee06124d | ||
![]() |
ca10442e01 | ||
![]() |
4b25fe09cc | ||
![]() |
baaaf6a9e7 | ||
![]() |
e477ac7c45 | ||
![]() |
3b5c2213fd | ||
![]() |
5aabe5695f | ||
![]() |
b0b383bff9 | ||
![]() |
323c43e1c4 | ||
![]() |
2bc5e1be0f | ||
![]() |
87440e7bc5 | ||
![]() |
357ee88606 | ||
![]() |
6a6c6b2658 | ||
![]() |
79030bf196 | ||
![]() |
aa2b69b178 | ||
![]() |
b36cadcb8e | ||
![]() |
d8149e5af9 | ||
![]() |
4e1b1b6fd7 | ||
![]() |
9b5ee7df4e | ||
![]() |
1a030f6e04 | ||
![]() |
bf66871113 | ||
![]() |
424a452401 | ||
![]() |
01fe4fc589 | ||
![]() |
7abc58349e | ||
![]() |
8fbe3e3941 | ||
![]() |
71faa2be88 | ||
![]() |
650dcbbafe | ||
![]() |
6a63034b51 | ||
![]() |
b5b84b806a | ||
![]() |
950048b206 | ||
![]() |
7ca0408a1f | ||
![]() |
78a36cdd55 | ||
![]() |
694c3992ea | ||
![]() |
9695650c0c | ||
![]() |
7781111fef | ||
![]() |
4007c42b77 | ||
![]() |
584b811aee | ||
![]() |
a930b2666e | ||
![]() |
c36c4ddae2 | ||
![]() |
308e9719cf | ||
![]() |
e80e8a0980 | ||
![]() |
163a532cfa | ||
![]() |
1a12dea191 | ||
![]() |
6f2786433d | ||
![]() |
085f1cc99d | ||
![]() |
3c0e1a89d9 | ||
![]() |
57b0fecd47 | ||
![]() |
f8ee92feec | ||
![]() |
98ec48eefb | ||
![]() |
34a976ec2b | ||
![]() |
6a07b199ff | ||
![]() |
6550227110 | ||
![]() |
b7f025e45b | ||
![]() |
6c12cfe18c | ||
![]() |
7774ca9107 | ||
![]() |
348a939168 | ||
![]() |
9455686b6f | ||
![]() |
1a4e78832f | ||
![]() |
fb5a0e28db | ||
![]() |
b286ba419a | ||
![]() |
94f44122ad | ||
![]() |
0b0385ea6a | ||
![]() |
84bbbd9fbe | ||
![]() |
bbefbc995e | ||
![]() |
97aaea3478 | ||
![]() |
1a02f1835f | ||
![]() |
2d1a13bdf5 | ||
![]() |
27fca9c7d2 | ||
![]() |
5480c0bd75 | ||
![]() |
c257fe5582 | ||
![]() |
ee7885aa21 | ||
![]() |
82ea8a7c3f | ||
![]() |
8b98642002 | ||
![]() |
687c0078c2 | ||
![]() |
68a2259804 | ||
![]() |
aa83d866c1 | ||
![]() |
f31e29fce4 | ||
![]() |
045afa9e8a | ||
![]() |
1fc09b0738 | ||
![]() |
28fba3bf27 | ||
![]() |
2f3c447605 | ||
![]() |
9b4e7c9a0d | ||
![]() |
6a0d1eee46 | ||
![]() |
c9d7ad4a34 | ||
![]() |
d535482ab2 | ||
![]() |
e537379641 | ||
![]() |
3a23149cfc | ||
![]() |
b380a8fe21 | ||
![]() |
6a44055a71 | ||
![]() |
2a8d80a442 | ||
![]() |
53e37391e8 | ||
![]() |
b65e978a23 | ||
![]() |
1db8824fbc | ||
![]() |
d5a0e4ec5b | ||
![]() |
983482626d | ||
![]() |
8d842a301c | ||
![]() |
e63e0a2e06 | ||
![]() |
50a021e653 | ||
![]() |
2c95d48083 | ||
![]() |
ba47b440fd | ||
![]() |
9d7711a732 | ||
![]() |
a3f9bd7f79 | ||
![]() |
017a054e82 | ||
![]() |
d63d379eec | ||
![]() |
fa4bd6994d | ||
![]() |
4abd480e8f | ||
![]() |
b4824edac1 | ||
![]() |
e464b8c90d | ||
![]() |
260ac4b3a2 | ||
![]() |
d585f3103d | ||
![]() |
f3675337f0 | ||
![]() |
b020b66005 | ||
![]() |
6f34f07a31 | ||
![]() |
23a9c67f1b | ||
![]() |
61b0816790 | ||
![]() |
1e1e4066b1 | ||
![]() |
ef05c514aa | ||
![]() |
e13564b9f4 | ||
![]() |
b55435f438 | ||
![]() |
461ed5e6bd | ||
![]() |
8611f4dcf0 | ||
![]() |
95c3fd4dc0 | ||
![]() |
59d3d76b79 | ||
![]() |
886a8b62c5 | ||
![]() |
26b72b0f91 | ||
![]() |
1fe8dc4d2c | ||
![]() |
5cb3505ab8 | ||
![]() |
0f6f5c4682 | ||
![]() |
b5a2d52a36 | ||
![]() |
797f524337 | ||
![]() |
8aea03f7b2 | ||
![]() |
974447bfc3 | ||
![]() |
6ed530baa5 | ||
![]() |
d000c56373 | ||
![]() |
2a32ec784c | ||
![]() |
c7e943a181 | ||
![]() |
d874ba319d | ||
![]() |
b18538527e | ||
![]() |
a6b2233c3e | ||
![]() |
d593b20017 | ||
![]() |
7834d80b81 | ||
![]() |
1ed493cc96 | ||
![]() |
dca6c4e92c | ||
![]() |
40671f18f7 | ||
![]() |
316fa168a1 | ||
![]() |
be831a725d | ||
![]() |
1fd86be15c | ||
![]() |
7284400a34 | ||
![]() |
3ca127063b | ||
![]() |
ca6f8ee267 | ||
![]() |
e4492677ee | ||
![]() |
1f58e27600 | ||
![]() |
b0bac2a339 | ||
![]() |
9f8a5cd022 | ||
![]() |
4552a9629a | ||
![]() |
eec37b6e6b | ||
![]() |
339067ab7e | ||
![]() |
ee57bb5a8e | ||
![]() |
dd0f6afa00 | ||
![]() |
2e1f656eb7 | ||
![]() |
05e72488b9 | ||
![]() |
187c93d7e5 | ||
![]() |
6aba2f3944 | ||
![]() |
21157459fe | ||
![]() |
5955ef0ba8 | ||
![]() |
3af1495af0 | ||
![]() |
1fda01fa55 | ||
![]() |
771b3a52c5 | ||
![]() |
7550947157 | ||
![]() |
c43dd3ef6f | ||
![]() |
a0a95edb2d | ||
![]() |
c2625b6fad | ||
![]() |
ad393c1fc1 | ||
![]() |
4ad864dd09 | ||
![]() |
bce2364f60 | ||
![]() |
006fd0304c | ||
![]() |
7e15526dd2 | ||
![]() |
85ac560947 | ||
![]() |
7e194f0d0c | ||
![]() |
70f7708cdf | ||
![]() |
0d293e4315 | ||
![]() |
ffc457a1dc | ||
![]() |
575136c178 | ||
![]() |
f77db12995 | ||
![]() |
18a9ae169e | ||
![]() |
804a94d300 | ||
![]() |
0389472961 | ||
![]() |
9fd6664ba7 | ||
![]() |
5cdf0c22bd | ||
![]() |
4150e5e6fd | ||
![]() |
8c88f402e1 | ||
![]() |
3d319092d5 | ||
![]() |
6527f5e2d2 | ||
![]() |
ad55ec350c | ||
![]() |
125b253e7b | ||
![]() |
b01202df15 | ||
![]() |
d6437e2ca5 | ||
![]() |
97be9d8563 | ||
![]() |
2fb69ccaf7 | ||
![]() |
0e81c62405 | ||
![]() |
68513c2a89 | ||
![]() |
eb53aba5af | ||
![]() |
e13f03af85 | ||
![]() |
24fa65a500 | ||
![]() |
b94b341ef2 | ||
![]() |
410f43c0ae | ||
![]() |
677eb23c38 | ||
![]() |
a03cc83bfb | ||
![]() |
a333847f6b | ||
![]() |
6136326d63 | ||
![]() |
7400f9dfe5 | ||
![]() |
2ae8bb7b96 | ||
![]() |
19787d6057 | ||
![]() |
f654a30093 | ||
![]() |
29fd7432fd | ||
![]() |
b2587a0665 | ||
![]() |
891cc78179 | ||
![]() |
94aacc2695 | ||
![]() |
ceb82a9396 | ||
![]() |
bddbbd874c | ||
![]() |
576363a0fb | ||
![]() |
c467bfeb93 | ||
![]() |
4ce293c2c3 | ||
![]() |
fde5718e62 | ||
![]() |
a430944ea7 | ||
![]() |
7c055bd74b | ||
![]() |
113e5a91de | ||
![]() |
07de890de6 | ||
![]() |
ae9aa58f9c | ||
![]() |
7582d4a7b5 | ||
![]() |
8c00651131 | ||
![]() |
ba90b54301 | ||
![]() |
46d2906332 | ||
![]() |
978b63a9f1 | ||
![]() |
cb9ccedf04 | ||
![]() |
33121f1eae | ||
![]() |
24ee2e7c74 | ||
![]() |
8fe17036ba | ||
![]() |
63ff7338ea | ||
![]() |
f39fb4c11e | ||
![]() |
b397b5672c | ||
![]() |
bc1e168e49 | ||
![]() |
c35e040b7e | ||
![]() |
ab2d243fd0 | ||
![]() |
5cad641848 | ||
![]() |
f89d4ee6ce | ||
![]() |
d6a73d7314 | ||
![]() |
2d7aab623e | ||
![]() |
28a5923aea | ||
![]() |
65776124b1 | ||
![]() |
2845d05569 | ||
![]() |
356ddb1305 | ||
![]() |
803cc08c17 | ||
![]() |
91e337a477 | ||
![]() |
f76d0dc91e | ||
![]() |
35f6425207 | ||
![]() |
9c6efd0a65 | ||
![]() |
259a620eb8 | ||
![]() |
3b8d0721af | ||
![]() |
eadc4e03a2 | ||
![]() |
17fe405adc | ||
![]() |
f82d7b8200 | ||
![]() |
b16fe558ae | ||
![]() |
34cc49bd72 | ||
![]() |
ad82e11eb7 | ||
![]() |
db65017e60 | ||
![]() |
2eafe248c4 | ||
![]() |
3725db69ef | ||
![]() |
9f2aec2629 | ||
![]() |
f7d8650616 | ||
![]() |
446b05f85a | ||
![]() |
891b235df0 | ||
![]() |
1ab52dff9a | ||
![]() |
0827279ff5 | ||
![]() |
77b0970cda | ||
![]() |
643d6af451 | ||
![]() |
4d9114d3ab | ||
![]() |
a784b901be | ||
![]() |
0608444447 | ||
![]() |
981548b7f7 | ||
![]() |
728f6c7c83 | ||
![]() |
18a36d3d9f | ||
![]() |
8a8c3ed4dc | ||
![]() |
aa1321801d | ||
![]() |
0ee3147bc7 | ||
![]() |
46c2962b3a | ||
![]() |
b6b2272573 | ||
![]() |
dfff482efe | ||
![]() |
8dece36427 | ||
![]() |
7055cd1238 | ||
![]() |
f1fba12803 | ||
![]() |
1fe1f8556e | ||
![]() |
94d8f6bde8 | ||
![]() |
f03348472d | ||
![]() |
571e54e12c | ||
![]() |
704d33634e | ||
![]() |
4c53b9c0a1 | ||
![]() |
df6ce8377f | ||
![]() |
58e1ef2f65 | ||
![]() |
c3aef56199 | ||
![]() |
d8ff216040 | ||
![]() |
89fa1ee822 | ||
![]() |
88cd7a6cdd | ||
![]() |
fdf769fa86 | ||
![]() |
b36458b363 | ||
![]() |
b98aa783f3 | ||
![]() |
039121f5a3 | ||
![]() |
e98637e8c0 | ||
![]() |
b9e540cc70 | ||
![]() |
b322c3560b | ||
![]() |
8d1467ce9a | ||
![]() |
5d9f2d7ecc | ||
![]() |
565fccbeeb | ||
![]() |
3a354bfcaa | ||
![]() |
bec397edda | ||
![]() |
4efca7cda5 | ||
![]() |
84d7bfcf16 | ||
![]() |
777e15fa61 | ||
![]() |
ebc6c38cde | ||
![]() |
bf16fe3f01 | ||
![]() |
28f03205be | ||
![]() |
7e878da7dd | ||
![]() |
21b21b94e6 | ||
![]() |
e1b6187801 | ||
![]() |
bdd5871dc5 | ||
![]() |
10a16c1311 | ||
![]() |
3a727beafd | ||
![]() |
efe8a0a520 | ||
![]() |
4f0c4c3921 | ||
![]() |
4e9864147a | ||
![]() |
89f29fcc92 | ||
![]() |
671073e714 | ||
![]() |
dffadc392e | ||
![]() |
1e62f8e15c | ||
![]() |
8e239ed9ea | ||
![]() |
6a1c0e9574 | ||
![]() |
d6756fc0a5 | ||
![]() |
c6ebb931d9 | ||
![]() |
9c91233a38 | ||
![]() |
81560bbdbf | ||
![]() |
9a2760a01f | ||
![]() |
5eaae797af | ||
![]() |
ea6b2b78bd | ||
![]() |
0cf7e2570c | ||
![]() |
902980edb9 | ||
![]() |
6802db7aa1 | ||
![]() |
d90ee70897 |
@@ -6,7 +6,7 @@ freebsd_task:
|
|||||||
name: FreeBSD
|
name: FreeBSD
|
||||||
only_if: $BRANCH != "master"
|
only_if: $BRANCH != "master"
|
||||||
freebsd_instance:
|
freebsd_instance:
|
||||||
image_family: freebsd-14-2
|
image_family: freebsd-14-0
|
||||||
timeout_in: 30m
|
timeout_in: 30m
|
||||||
install_script:
|
install_script:
|
||||||
- pkg install -y cmake gmake ninja unzip wget gettext python git
|
- pkg install -y cmake gmake ninja unzip wget gettext python git
|
||||||
|
@@ -18,7 +18,6 @@ Checks: >
|
|||||||
-bugprone-not-null-terminated-result,
|
-bugprone-not-null-terminated-result,
|
||||||
-bugprone-suspicious-memory-comparison,
|
-bugprone-suspicious-memory-comparison,
|
||||||
-bugprone-switch-missing-default-case,
|
-bugprone-switch-missing-default-case,
|
||||||
-bugprone-tagged-union-member-count,
|
|
||||||
-cert-env33-c,
|
-cert-env33-c,
|
||||||
-cert-err33-c,
|
-cert-err33-c,
|
||||||
-cert-err34-c,
|
-cert-err34-c,
|
||||||
@@ -36,7 +35,6 @@ Checks: >
|
|||||||
-modernize-macro-to-enum,
|
-modernize-macro-to-enum,
|
||||||
-readability-avoid-nested-conditional-operator,
|
-readability-avoid-nested-conditional-operator,
|
||||||
-readability-else-after-return,
|
-readability-else-after-return,
|
||||||
-readability-enum-initial-value,
|
|
||||||
-readability-function-size,
|
-readability-function-size,
|
||||||
-readability-isolate-declaration,
|
-readability-isolate-declaration,
|
||||||
|
|
||||||
@@ -58,18 +56,15 @@ Checks: >
|
|||||||
-readability-function-cognitive-complexity,
|
-readability-function-cognitive-complexity,
|
||||||
-readability-identifier-length,
|
-readability-identifier-length,
|
||||||
-readability-magic-numbers,
|
-readability-magic-numbers,
|
||||||
-readability-math-missing-parentheses,
|
|
||||||
-readability-redundant-declaration, Conflicts with our header generation scripts,
|
-readability-redundant-declaration, Conflicts with our header generation scripts,
|
||||||
-readability-suspicious-call-argument,
|
-readability-suspicious-call-argument,
|
||||||
|
|
||||||
Aliases. These are just duplicates of other warnings and should always be ignored,
|
Aliases. These are just duplicates of other warnings and should always be ignored,
|
||||||
-bugprone-narrowing-conversions,
|
-bugprone-narrowing-conversions,
|
||||||
-cert-arr39-c,
|
|
||||||
-cert-dcl37-c,
|
-cert-dcl37-c,
|
||||||
-cert-dcl51-cpp,
|
-cert-dcl51-cpp,
|
||||||
-cert-exp42-c,
|
-cert-exp42-c,
|
||||||
-cert-flp37-c,
|
-cert-flp37-c,
|
||||||
-cert-int09-c,
|
|
||||||
-cert-msc24-c,
|
-cert-msc24-c,
|
||||||
-cert-msc33-c,
|
-cert-msc33-c,
|
||||||
-cppcoreguidelines-avoid-magic-numbers,
|
-cppcoreguidelines-avoid-magic-numbers,
|
||||||
|
@@ -10,12 +10,9 @@ insert_final_newline = true
|
|||||||
[*.{c,h,in,lua}]
|
[*.{c,h,in,lua}]
|
||||||
max_line_length = 100
|
max_line_length = 100
|
||||||
|
|
||||||
[src/nvim/{eval,vvars}.lua]
|
|
||||||
max_line_length = 68
|
|
||||||
|
|
||||||
[*.py]
|
[*.py]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[{Makefile,**/Makefile,*.mk,runtime/doc/*.txt}]
|
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
indent_size = 8
|
indent_size = 8
|
||||||
|
25
.emmyrc.json
25
.emmyrc.json
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
|
|
||||||
"format": {
|
|
||||||
"externalTool": {
|
|
||||||
"program": "stylua",
|
|
||||||
"args": [
|
|
||||||
"-",
|
|
||||||
"--stdin-filepath",
|
|
||||||
"${file}"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"diagnostics": {
|
|
||||||
"disable": [
|
|
||||||
"unnecessary-if"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"codeAction": {
|
|
||||||
"insertSpace": true
|
|
||||||
},
|
|
||||||
"strict": {
|
|
||||||
"typeCall": true,
|
|
||||||
"arrayIndex": true
|
|
||||||
}
|
|
||||||
}
|
|
0
.gitattributes
vendored
Normal file → Executable file
0
.gitattributes
vendored
Normal file → Executable file
6
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
6
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: Bug Report
|
name: Bug Report
|
||||||
description: Report a problem in Nvim
|
description: Report a problem in Neovim
|
||||||
type: 'bug'
|
labels: [bug]
|
||||||
body:
|
body:
|
||||||
|
|
||||||
- type: markdown
|
- type: markdown
|
||||||
@@ -43,7 +43,7 @@ body:
|
|||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: "Nvim version (nvim -v)"
|
label: "Neovim version (nvim -v)"
|
||||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,5 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: Question
|
- name: Question
|
||||||
url: https://github.com/neovim/neovim/discussions
|
url: https://vi.stackexchange.com/
|
||||||
about: Ask about configuration and usage of Nvim
|
about: Ask questions about configuration and usage of Neovim
|
||||||
|
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: Feature request
|
name: Feature request
|
||||||
description: Request an enhancement for Nvim
|
description: Request an enhancement for Neovim
|
||||||
type: 'enhancement'
|
labels: [enhancement]
|
||||||
body:
|
body:
|
||||||
|
|
||||||
- type: markdown
|
- type: markdown
|
||||||
|
8
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
8
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@@ -1,8 +1,6 @@
|
|||||||
name: Language server (LSP) client bug
|
name: Language server (LSP) client bug
|
||||||
description: Report an issue with Nvim LSP
|
description: Report an issue with Neovim LSP
|
||||||
title: "LSP: "
|
labels: [bug, lsp]
|
||||||
type: bug
|
|
||||||
labels: [lsp]
|
|
||||||
body:
|
body:
|
||||||
|
|
||||||
- type: markdown
|
- type: markdown
|
||||||
@@ -61,7 +59,7 @@ body:
|
|||||||
|
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: "Nvim version (nvim -v)"
|
label: "Neovim version (nvim -v)"
|
||||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||||
validations:
|
validations:
|
||||||
required: true
|
required: true
|
||||||
|
5
.github/pull_request_template.md
vendored
5
.github/pull_request_template.md
vendored
@@ -1,5 +0,0 @@
|
|||||||
<!--
|
|
||||||
Thank you for contributing to Neovim!
|
|
||||||
If this is your first time, check out https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md#pull-requests-prs
|
|
||||||
for our PR guidelines.
|
|
||||||
-->
|
|
20
.github/scripts/env.ps1
vendored
20
.github/scripts/env.ps1
vendored
@@ -1,17 +1,9 @@
|
|||||||
# This script enables Developer Command Prompt
|
# This script enables Developer Command Prompt
|
||||||
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
|
# See https://github.com/microsoft/vswhere/wiki/Start-Developer-Command-Prompt#using-powershell
|
||||||
if ($env:BUILD_ARCH -eq "arm64") {
|
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||||
$arch = "arm64"
|
if ($installationPath -and (Test-Path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
||||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.arm64 -property installationPath
|
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | ForEach-Object {
|
||||||
} else {
|
$name, $value = $_ -split '=', 2
|
||||||
$arch = "x64"
|
"$name=$value" >> $env:GITHUB_ENV
|
||||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($installationPath) {
|
|
||||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=$arch -no_logo && set" |
|
|
||||||
ForEach-Object {
|
|
||||||
$name, $value = $_ -split '=', 2
|
|
||||||
"$name=$value" >> $env:GITHUB_ENV
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
21
.github/scripts/install_deps.sh
vendored
21
.github/scripts/install_deps.sh
vendored
@@ -9,9 +9,8 @@ while (($# > 0)); do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
OS=$(uname -s)
|
os=$(uname -s)
|
||||||
ARCH=$(uname -m)
|
if [[ $os == Linux ]]; then
|
||||||
if [[ $OS == Linux ]]; then
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y build-essential cmake curl gettext ninja-build
|
sudo apt-get install -y build-essential cmake curl gettext ninja-build
|
||||||
|
|
||||||
@@ -19,7 +18,7 @@ if [[ $OS == Linux ]]; then
|
|||||||
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
|
DEFAULT_CLANG_VERSION=$(echo | clang -dM -E - | grep __clang_major | awk '{print $3}')
|
||||||
CLANG_VERSION=19
|
CLANG_VERSION=19
|
||||||
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
|
if ((DEFAULT_CLANG_VERSION >= CLANG_VERSION)); then
|
||||||
echo "Default clang version is $DEFAULT_CLANG_VERSION, which is equal or larger than wanted version $CLANG_VERSION. Aborting!"
|
echo "Default clang version is $DEFAULT_CLANG_VERSION, which equal or larger than wanted version $CLANG_VERSION. Aborting!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -31,27 +30,17 @@ if [[ $OS == Linux ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $TEST ]]; then
|
if [[ -n $TEST ]]; then
|
||||||
sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb inotify-tools xdg-utils
|
sudo apt-get install -y locales-all cpanminus attr libattr1-dev gdb fswatch xdg-utils
|
||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules
|
# Use default CC to avoid compilation problems when installing Python modules
|
||||||
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
||||||
|
|
||||||
# Skip installing npm on aarch64 as it tends to cause intermittent segmentation faults.
|
|
||||||
# See https://github.com/neovim/neovim/issues/32339.
|
|
||||||
if [[ $ARCH != aarch64 ]]; then
|
|
||||||
npm install -g neovim
|
|
||||||
npm link neovim
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
elif [[ $OS == Darwin ]]; then
|
elif [[ $os == Darwin ]]; then
|
||||||
brew update --quiet
|
brew update --quiet
|
||||||
brew install ninja
|
brew install ninja
|
||||||
if [[ -n $TEST ]]; then
|
if [[ -n $TEST ]]; then
|
||||||
brew install cpanminus fswatch
|
brew install cpanminus fswatch
|
||||||
|
|
||||||
npm install -g neovim
|
|
||||||
npm link neovim
|
|
||||||
|
|
||||||
# Use default CC to avoid compilation problems when installing Python modules
|
# Use default CC to avoid compilation problems when installing Python modules
|
||||||
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
CC=cc python3 -m pip -q install --user --upgrade --break-system-packages pynvim
|
||||||
fi
|
fi
|
||||||
|
3
.github/scripts/reviewers_add.js
vendored
3
.github/scripts/reviewers_add.js
vendored
@@ -57,7 +57,7 @@ module.exports = async ({ github, context }) => {
|
|||||||
|
|
||||||
if (labels.includes("lsp")) {
|
if (labels.includes("lsp")) {
|
||||||
reviewers.add("MariaSolOs");
|
reviewers.add("MariaSolOs");
|
||||||
reviewers.add("ribru17");
|
reviewers.add("mfussenegger");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.includes("netrw")) {
|
if (labels.includes("netrw")) {
|
||||||
@@ -90,7 +90,6 @@ module.exports = async ({ github, context }) => {
|
|||||||
reviewers.add("clason");
|
reviewers.add("clason");
|
||||||
reviewers.add("lewis6991");
|
reviewers.add("lewis6991");
|
||||||
reviewers.add("wookayin");
|
reviewers.add("wookayin");
|
||||||
reviewers.add("ribru17");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (labels.includes("tui")) {
|
if (labels.includes("tui")) {
|
||||||
|
6
.github/workflows/backport.yml
vendored
6
.github/workflows/backport.yml
vendored
@@ -11,9 +11,9 @@ jobs:
|
|||||||
if: github.event.pull_request.merged
|
if: github.event.pull_request.merged
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/create-github-app-token@v2
|
- uses: actions/create-github-app-token@v1
|
||||||
id: app-token
|
id: app-token
|
||||||
with:
|
with:
|
||||||
app-id: ${{ vars.BACKPORT_APP }}
|
app-id: ${{ vars.BACKPORT_APP }}
|
||||||
@@ -29,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create failed backport label
|
- name: Create failed backport label
|
||||||
if: ${{ steps.backport.outputs.was_successful == 'false' }}
|
if: ${{ steps.backport.outputs.was_successful == 'false' }}
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
github.rest.issues.addLabels({
|
github.rest.issues.addLabels({
|
||||||
|
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@@ -21,30 +21,15 @@ env:
|
|||||||
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
INSTALL_PREFIX: ${{ github.workspace }}/nvim-install
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
wasmtime:
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
test: [ubuntu-latest, macos-latest, windows-latest]
|
|
||||||
runs-on: ${{ matrix.test }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: ./.github/actions/setup
|
|
||||||
- run: |
|
|
||||||
cmake -S cmake.deps --preset ci -D ENABLE_WASMTIME=ON
|
|
||||||
cmake --build .deps
|
|
||||||
cmake --preset ci -D ENABLE_WASMTIME=ON
|
|
||||||
cmake --build build
|
|
||||||
|
|
||||||
old-cmake:
|
old-cmake:
|
||||||
name: Test oldest supported cmake
|
name: Test oldest supported cmake
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
env:
|
env:
|
||||||
CMAKE_URL: 'https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh'
|
CMAKE_URL: 'https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.sh'
|
||||||
CMAKE_VERSION: '3.16.0'
|
CMAKE_VERSION: '3.13.0'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install minimum required version of cmake
|
- name: Install minimum required version of cmake
|
||||||
@@ -73,7 +58,7 @@ jobs:
|
|||||||
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
|
name: Test USE_EXISTING_SRC_DIR=ON builds with no network access
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Build bundled dependencies
|
- name: Build bundled dependencies
|
||||||
|
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
|||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
2
.github/workflows/coverity.yml
vendored
2
.github/workflows/coverity.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
|||||||
scan:
|
scan:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Download Coverity
|
- name: Download Coverity
|
||||||
|
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Generate docs
|
- name: Generate docs
|
||||||
|
2
.github/workflows/labeler_issue.yml
vendored
2
.github/workflows/labeler_issue.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: check issue title
|
- name: check issue title
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const title = context.payload.issue.title;
|
const title = context.payload.issue.title;
|
||||||
|
6
.github/workflows/labeler_pr.yml
vendored
6
.github/workflows/labeler_pr.yml
vendored
@@ -9,8 +9,8 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/labeler@v6
|
- uses: actions/labeler@v5
|
||||||
with:
|
with:
|
||||||
configuration-path: .github/scripts/labeler_configuration.yml
|
configuration-path: .github/scripts/labeler_configuration.yml
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- if: startsWith(github.base_ref, 'release')
|
- if: startsWith(github.base_ref, 'release')
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
github.rest.issues.addLabels({
|
github.rest.issues.addLabels({
|
||||||
|
2
.github/workflows/lintcommit.yml
vendored
2
.github/workflows/lintcommit.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
16
.github/workflows/news.yml
vendored
16
.github/workflows/news.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
|
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci:skip-news')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
@@ -19,15 +19,15 @@ jobs:
|
|||||||
message=$(git log -n1 --pretty=format:%s $commit)
|
message=$(git log -n1 --pretty=format:%s $commit)
|
||||||
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
|
type="$(echo "$message" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')"
|
||||||
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
|
breaking="$(echo "$message" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')"
|
||||||
if [[ "$type" == "feat" ]] || [[ "$type" == "perf" ]] || [[ "$breaking" == "breaking-change" ]]; then
|
if [[ "$type" == "feat" ]] || [[ "$breaking" == "breaking-change" ]]; then
|
||||||
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt runtime/doc/deprecated.txt ||
|
! git diff HEAD~${{ github.event.pull_request.commits }}..HEAD --quiet runtime/doc/news.txt ||
|
||||||
{
|
{
|
||||||
echo "
|
echo "
|
||||||
Pull request includes a new feature, performance improvement
|
Pull request includes a new feature or a breaking change, but
|
||||||
or a breaking change, but news.txt hasn't been updated yet.
|
news.txt hasn't been updated yet. This is just a reminder
|
||||||
This is just a reminder that news.txt may need to be updated.
|
that news.txt may need to be updated. You can ignore this CI
|
||||||
You can ignore this CI failure if you think the change won't
|
failure if you think the change won't be of interest to
|
||||||
be of interest to users."
|
users."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
34
.github/workflows/notes.md
vendored
34
.github/workflows/notes.md
vendored
@@ -2,28 +2,21 @@
|
|||||||
${NVIM_VERSION}
|
${NVIM_VERSION}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Release notes
|
|
||||||
|
|
||||||
- [Changelog](https://github.com/neovim/neovim/commit/${NVIM_COMMIT}) (fixes + features)
|
|
||||||
- [News](./runtime/doc/news.txt) (`:help news` in Nvim)
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
#### Zip
|
#### Zip
|
||||||
|
|
||||||
1. Download **nvim-win64.zip** (or **nvim-win-arm64.zip** for ARM)
|
1. Download **nvim-win64.zip**
|
||||||
2. Extract the zip
|
2. Extract the zip
|
||||||
3. Run `nvim.exe` in your terminal
|
3. Run `nvim.exe` on your CLI of choice
|
||||||
|
|
||||||
#### MSI
|
#### MSI
|
||||||
|
|
||||||
1. Download **nvim-win64.msi** (or **nvim-win-arm64.msi** for ARM)
|
1. Download **nvim-win64.msi**
|
||||||
2. Run the MSI
|
2. Run the MSI
|
||||||
3. Run `nvim.exe` in your terminal
|
3. Run `nvim.exe` on your CLI of choice
|
||||||
|
|
||||||
Note: On Windows "Server" you may need to [install vcruntime140.dll](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170).
|
|
||||||
|
|
||||||
### macOS (x86_64)
|
### macOS (x86_64)
|
||||||
|
|
||||||
@@ -41,7 +34,9 @@ Note: On Windows "Server" you may need to [install vcruntime140.dll](https://lea
|
|||||||
|
|
||||||
### Linux (x86_64)
|
### Linux (x86_64)
|
||||||
|
|
||||||
If your system does not have the required glibc version, try the (unsupported) [builds for older glibc](https://github.com/neovim/neovim-releases).
|
Minimum glibc version to run these releases is 2.31. People requiring releases
|
||||||
|
that work on older glibc versions can find them at
|
||||||
|
https://github.com/neovim/neovim-releases.
|
||||||
|
|
||||||
#### AppImage
|
#### AppImage
|
||||||
|
|
||||||
@@ -80,3 +75,18 @@ If your system does not have the required glibc version, try the (unsupported) [
|
|||||||
### Other
|
### Other
|
||||||
|
|
||||||
- Install by [package manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
|
- Install by [package manager](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package)
|
||||||
|
|
||||||
|
## SHA256 Checksums
|
||||||
|
|
||||||
|
```
|
||||||
|
${SHA_APPIMAGE_ARM64}
|
||||||
|
${SHA_APPIMAGE_ARM64_ZSYNC}
|
||||||
|
${SHA_LINUX_ARM64_TAR}
|
||||||
|
${SHA_APPIMAGE_X86_64}
|
||||||
|
${SHA_APPIMAGE_X86_64_ZSYNC}
|
||||||
|
${SHA_LINUX_X86_64_TAR}
|
||||||
|
${SHA_MACOS_ARM64}
|
||||||
|
${SHA_MACOS_X86_64}
|
||||||
|
${SHA_WIN_64_MSI}
|
||||||
|
${SHA_WIN_64_ZIP}
|
||||||
|
```
|
||||||
|
106
.github/workflows/release.yml
vendored
106
.github/workflows/release.yml
vendored
@@ -13,6 +13,7 @@ on:
|
|||||||
- v[0-9]+.[0-9]+.[0-9]+
|
- v[0-9]+.[0-9]+.[0-9]+
|
||||||
|
|
||||||
# Build on the oldest supported images, so we have broader compatibility
|
# Build on the oldest supported images, so we have broader compatibility
|
||||||
|
# Build with gcc-10 to prevent triggering #14150 (default is still gcc-9 on 20.04)
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -42,11 +43,12 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
runner: [ ubuntu-22.04, ubuntu-22.04-arm ]
|
runner: [ ubuntu-20.04, ubuntu-24.04-arm ]
|
||||||
include:
|
include:
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-20.04
|
||||||
arch: x86_64
|
arch: x86_64
|
||||||
- runner: ubuntu-22.04-arm
|
cc: gcc-10
|
||||||
|
- runner: ubuntu-24.04-arm
|
||||||
arch: arm64
|
arch: arm64
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
env:
|
env:
|
||||||
@@ -55,13 +57,14 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.build.outputs.version }}
|
version: ${{ steps.build.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
# Perform a full checkout #13471
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: ./.github/scripts/install_deps.sh
|
- run: ./.github/scripts/install_deps.sh
|
||||||
- run: sudo apt-get install -y libfuse2
|
|
||||||
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV
|
- run: echo "CMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}" >> $GITHUB_ENV
|
||||||
|
- if: matrix.arch == 'arm64'
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libfuse2t64
|
||||||
- name: appimage
|
- name: appimage
|
||||||
run: |
|
run: |
|
||||||
./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
|
./scripts/genappimage.sh ${{ needs.setup.outputs.appimage_tag }}
|
||||||
@@ -69,7 +72,7 @@ jobs:
|
|||||||
run: cpack --config build/CPackConfig.cmake -G TGZ
|
run: cpack --config build/CPackConfig.cmake -G TGZ
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: nvim-appimage-${{ matrix.arch }}
|
name: appimage-${{ matrix.arch }}
|
||||||
path: |
|
path: |
|
||||||
build/bin/nvim-linux-${{ matrix.arch }}.appimage
|
build/bin/nvim-linux-${{ matrix.arch }}.appimage
|
||||||
build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync
|
build/bin/nvim-linux-${{ matrix.arch }}.appimage.zsync
|
||||||
@@ -101,7 +104,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 11.0
|
MACOSX_DEPLOYMENT_TARGET: 11.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
# Perform a full checkout #13471
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -132,44 +135,27 @@ jobs:
|
|||||||
|
|
||||||
windows:
|
windows:
|
||||||
needs: setup
|
needs: setup
|
||||||
strategy:
|
runs-on: windows-2019
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- runner: windows-2022
|
|
||||||
arch: x86_64
|
|
||||||
archive_name: nvim-win64
|
|
||||||
- runner: windows-11-arm
|
|
||||||
arch: arm64
|
|
||||||
archive_name: nvim-win-arm64
|
|
||||||
runs-on: ${{ matrix.runner }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Perform a full checkout #13471
|
# Perform a full checkout #13471
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- run: .github/scripts/env.ps1
|
- run: .github/scripts/env.ps1
|
||||||
env:
|
|
||||||
BUILD_ARCH: ${{ matrix.arch }}
|
|
||||||
- name: Install Wix
|
|
||||||
run: |
|
|
||||||
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" -OutFile "wix314-binaries.zip"
|
|
||||||
Expand-Archive -Path "wix314-binaries.zip" -DestinationPath "C:/wix"
|
|
||||||
echo "C:\wix" >> $env:GITHUB_PATH
|
|
||||||
- name: Build deps
|
- name: Build deps
|
||||||
run: |
|
run: |
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
cmake -S cmake.deps -B .deps -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
- name: Build package
|
- name: build package
|
||||||
run: |
|
run: |
|
||||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ needs.setup.outputs.build_type }}
|
||||||
cmake --build build --target package
|
cmake --build build --target package
|
||||||
- name: Upload artifact
|
- uses: actions/upload-artifact@v4
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
with:
|
||||||
name: nvim-win-${{ matrix.arch }}
|
name: nvim-win64
|
||||||
path: |
|
path: |
|
||||||
build/${{ matrix.archive_name }}.zip
|
build/nvim-win64.msi
|
||||||
build/${{ matrix.archive_name }}.msi
|
build/nvim-win64.zip
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
@@ -183,9 +169,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
# Must perform checkout first, since it deletes the target directory
|
# Must perform checkout first, since it deletes the target directory
|
||||||
# before running, and would therefore delete the downloaded artifacts
|
# before running, and would therefore delete the downloaded artifacts
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- uses: actions/download-artifact@v5
|
- uses: actions/download-artifact@v4
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
run: sudo apt-get update && sudo apt-get install -y gettext-base
|
||||||
@@ -210,14 +196,62 @@ jobs:
|
|||||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
echo 'PRERELEASE=') >> $GITHUB_ENV
|
||||||
gh release delete stable --yes || true
|
gh release delete stable --yes || true
|
||||||
git push origin :stable || true
|
git push origin :stable || true
|
||||||
|
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
|
||||||
|
# containing folder from the output.
|
||||||
|
- name: Generate Linux x86_64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./nvim-linux-x86_64
|
||||||
|
sha256sum nvim-linux-x86_64.tar.gz > nvim-linux-x86_64.tar.gz.sha256sum
|
||||||
|
echo "SHA_LINUX_X86_64_TAR=$(cat nvim-linux-x86_64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate Linux arm64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./nvim-linux-arm64
|
||||||
|
sha256sum nvim-linux-arm64.tar.gz > nvim-linux-arm64.tar.gz.sha256sum
|
||||||
|
echo "SHA_LINUX_ARM64_TAR=$(cat nvim-linux-arm64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate AppImage x64_64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./appimage-x86_64
|
||||||
|
sha256sum nvim-linux-x86_64.appimage > nvim-linux-x86_64.appimage.sha256sum
|
||||||
|
echo "SHA_APPIMAGE_X86_64=$(cat nvim-linux-x86_64.appimage.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate AppImage x86_64 Zsync SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./appimage-x86_64
|
||||||
|
sha256sum nvim-linux-x86_64.appimage.zsync > nvim-linux-x86_64.appimage.zsync.sha256sum
|
||||||
|
echo "SHA_APPIMAGE_X86_64_ZSYNC=$(cat nvim-linux-x86_64.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate AppImage x64_64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./appimage-arm64
|
||||||
|
sha256sum nvim-linux-arm64.appimage > nvim-linux-arm64.appimage.sha256sum
|
||||||
|
echo "SHA_APPIMAGE_ARM64=$(cat nvim-linux-arm64.appimage.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate AppImage arm64 Zsync SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./appimage-arm64
|
||||||
|
sha256sum nvim-linux-arm64.appimage.zsync > nvim-linux-arm64.appimage.zsync.sha256sum
|
||||||
|
echo "SHA_APPIMAGE_ARM64_ZSYNC=$(cat nvim-linux-arm64.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate macos x86_64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./nvim-macos-x86_64
|
||||||
|
sha256sum nvim-macos-x86_64.tar.gz > nvim-macos-x86_64.tar.gz.sha256sum
|
||||||
|
echo "SHA_MACOS_X86_64=$(cat nvim-macos-x86_64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate macos arm64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./nvim-macos-arm64
|
||||||
|
sha256sum nvim-macos-arm64.tar.gz > nvim-macos-arm64.tar.gz.sha256sum
|
||||||
|
echo "SHA_MACOS_ARM64=$(cat nvim-macos-arm64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||||
|
- name: Generate Win64 SHA256 checksums
|
||||||
|
run: |
|
||||||
|
cd ./nvim-win64
|
||||||
|
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
||||||
|
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
||||||
|
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
||||||
|
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
||||||
- name: Publish release
|
- name: Publish release
|
||||||
env:
|
env:
|
||||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||||
NVIM_COMMIT: ${{ github.sha }}
|
|
||||||
DEBUG: api
|
DEBUG: api
|
||||||
run: |
|
run: |
|
||||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
||||||
if [ "$TAG_NAME" != "nightly" ]; then
|
if [ "$TAG_NAME" != "nightly" ]; then
|
||||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/*
|
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* appimage-x86_64/* appimage-arm64/* nvim-win64/*
|
||||||
fi
|
fi
|
||||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* nvim-appimage-x86_64/* nvim-appimage-arm64/* nvim-win-x86_64/* nvim-win-arm64/*
|
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos-x86_64/* nvim-macos-arm64/* nvim-linux-x86_64/* nvim-linux-arm64/* appimage-x86_64/* appimage-arm64/* nvim-win64/*
|
||||||
|
8
.github/workflows/response.yml
vendored
8
.github/workflows/response.yml
vendored
@@ -13,8 +13,8 @@ jobs:
|
|||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/github-script@v8
|
- uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/close_unresponsive.js')
|
const script = require('./.github/scripts/close_unresponsive.js')
|
||||||
@@ -27,8 +27,8 @@ jobs:
|
|||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/github-script@v8
|
- uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/remove_response_label.js')
|
const script = require('./.github/scripts/remove_response_label.js')
|
||||||
|
4
.github/workflows/reviewers_add.yml
vendored
4
.github/workflows/reviewers_add.yml
vendored
@@ -10,9 +10,9 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- name: 'Request reviewers'
|
- name: 'Request reviewers'
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/reviewers_add.js')
|
const script = require('./.github/scripts/reviewers_add.js')
|
||||||
|
4
.github/workflows/reviewers_remove.yml
vendored
4
.github/workflows/reviewers_remove.yml
vendored
@@ -8,9 +8,9 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- name: 'Remove reviewers'
|
- name: 'Remove reviewers'
|
||||||
uses: actions/github-script@v8
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const script = require('./.github/scripts/reviewers_remove.js')
|
const script = require('./.github/scripts/reviewers_remove.js')
|
||||||
|
55
.github/workflows/test.yml
vendored
55
.github/workflows/test.yml
vendored
@@ -28,17 +28,17 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
CC: clang
|
CC: clang
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install stylua
|
- name: Install stylua
|
||||||
run: |
|
run: |
|
||||||
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-aarch64.zip
|
wget --directory-prefix="$BIN_DIR" https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip
|
||||||
(cd "$BIN_DIR"; unzip stylua*.zip)
|
(cd "$BIN_DIR"; unzip stylua*.zip)
|
||||||
|
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
@@ -57,10 +57,6 @@ jobs:
|
|||||||
name: stylua
|
name: stylua
|
||||||
run: cmake --build build --target lintlua-stylua
|
run: cmake --build build --target lintlua-stylua
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
|
||||||
name: luals
|
|
||||||
run: cmake --build build --target luals
|
|
||||||
|
|
||||||
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
- if: success() || failure() && steps.abort_job.outputs.status == 'success'
|
||||||
name: luacheck
|
name: luacheck
|
||||||
run: cmake --build build --target lintlua-luacheck
|
run: cmake --build build --target lintlua-luacheck
|
||||||
@@ -82,12 +78,12 @@ jobs:
|
|||||||
run: cmake --build build --target lintc-uncrustify
|
run: cmake --build build --target lintc-uncrustify
|
||||||
|
|
||||||
clang-analyzer:
|
clang-analyzer:
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
env:
|
env:
|
||||||
CC: clang
|
CC: clang
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
- name: Build third-party deps
|
- name: Build third-party deps
|
||||||
run: |
|
run: |
|
||||||
@@ -110,8 +106,8 @@ jobs:
|
|||||||
[
|
[
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
|
{ runner: ubuntu-24.04, os: ubuntu, flavor: asan, cc: clang, flags: -D ENABLE_ASAN_UBSAN=ON },
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
|
{ runner: ubuntu-24.04, os: ubuntu, flavor: tsan, cc: clang, flags: -D ENABLE_TSAN=ON },
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: release, cc: gcc, flags: -D CMAKE_BUILD_TYPE=Release -D ENABLE_TRANSLATIONS=ON },
|
{ runner: ubuntu-24.04, os: ubuntu, flavor: release, cc: gcc, flags: -D CMAKE_BUILD_TYPE=Release },
|
||||||
{ runner: ubuntu-24.04-arm, os: ubuntu, flavor: arm, cc: clang, flags: -D CMAKE_BUILD_TYPE=RelWithDebInfo },
|
{ runner: ubuntu-24.04-arm, os: ubuntu, flavor: arm, cc: gcc, flags: -D CMAKE_BUILD_TYPE=RelWithDebInfo },
|
||||||
{ runner: macos-13, os: macos, flavor: intel, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
{ runner: macos-13, os: macos, flavor: intel, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
||||||
{ runner: macos-15, os: macos, flavor: arm, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
{ runner: macos-15, os: macos, flavor: arm, cc: clang, flags: -D CMAKE_FIND_FRAMEWORK=NEVER, deps_flags: -D CMAKE_FIND_FRAMEWORK=NEVER },
|
||||||
{ runner: ubuntu-24.04, os: ubuntu, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
|
{ runner: ubuntu-24.04, os: ubuntu, flavor: puc-lua, cc: gcc, deps_flags: -D USE_BUNDLED_LUAJIT=OFF -D USE_BUNDLED_LUA=ON, flags: -D PREFER_LUA=ON },
|
||||||
@@ -124,17 +120,12 @@ jobs:
|
|||||||
build: { flavor: puc-lua }
|
build: { flavor: puc-lua }
|
||||||
- test: oldtest
|
- test: oldtest
|
||||||
build: { flavor: tsan }
|
build: { flavor: tsan }
|
||||||
- test: unittest
|
|
||||||
build: { runner: ubuntu-24.04-arm }
|
|
||||||
- test: oldtest
|
|
||||||
build: { runner: ubuntu-24.04-arm }
|
|
||||||
runs-on: ${{ matrix.build.runner }}
|
runs-on: ${{ matrix.build.runner }}
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
env:
|
env:
|
||||||
CC: ${{ matrix.build.cc }}
|
CC: ${{ matrix.build.cc }}
|
||||||
NVIM_TEST_INTEG: ${{ matrix.build.flavor == 'release' && '1' || '0' }}
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
with:
|
with:
|
||||||
install_flags: "--test"
|
install_flags: "--test"
|
||||||
@@ -148,6 +139,10 @@ jobs:
|
|||||||
echo "Install neovim RubyGem."
|
echo "Install neovim RubyGem."
|
||||||
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
|
gem install --no-document --bindir "$BIN_DIR" --user-install --pre neovim
|
||||||
|
|
||||||
|
echo "Install neovim npm package"
|
||||||
|
npm install -g neovim
|
||||||
|
npm link neovim
|
||||||
|
|
||||||
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
||||||
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
||||||
|
|
||||||
@@ -206,35 +201,16 @@ jobs:
|
|||||||
name: Show logs
|
name: Show logs
|
||||||
run: cat $(find "$LOG_DIR" -type f)
|
run: cat $(find "$LOG_DIR" -type f)
|
||||||
|
|
||||||
zig-build:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
timeout-minutes: 45
|
|
||||||
name: build using zig build (linux)
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: mlugg/setup-zig@v2
|
|
||||||
with:
|
|
||||||
version: 0.14.1
|
|
||||||
- run: sudo apt-get install -y inotify-tools
|
|
||||||
- run: zig build test_nlua0
|
|
||||||
- run: zig build nvim && ./zig-out/bin/nvim --version
|
|
||||||
- run: zig build unittest
|
|
||||||
- run: zig build functionaltest
|
|
||||||
# `zig build nvim` uses a lua script for doctags in order to support cross-compiling
|
|
||||||
# compare with the builtin generator that they match
|
|
||||||
- run: cd runtime; ../zig-out/bin/nvim -u NONE -i NONE -e --headless -c "helptags ++t doc" -c quit
|
|
||||||
- run: diff -u runtime/doc/tags zig-out/runtime/doc/tags
|
|
||||||
|
|
||||||
windows:
|
windows:
|
||||||
uses: ./.github/workflows/test_windows.yml
|
uses: ./.github/workflows/test_windows.yml
|
||||||
|
|
||||||
with-external-deps:
|
with-external-deps:
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
env:
|
env:
|
||||||
CC: gcc
|
CC: gcc
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -242,6 +218,8 @@ jobs:
|
|||||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||||
sudo apt-get install -y \
|
sudo apt-get install -y \
|
||||||
libluajit-5.1-dev \
|
libluajit-5.1-dev \
|
||||||
|
libmsgpack-dev \
|
||||||
|
libtermkey-dev \
|
||||||
libunibilium-dev \
|
libunibilium-dev \
|
||||||
libuv1-dev \
|
libuv1-dev \
|
||||||
lua-filesystem \
|
lua-filesystem \
|
||||||
@@ -249,6 +227,7 @@ jobs:
|
|||||||
luajit \
|
luajit \
|
||||||
lua-luv-dev
|
lua-luv-dev
|
||||||
# libtree-sitter-dev \
|
# libtree-sitter-dev \
|
||||||
|
# libvterm-dev
|
||||||
|
|
||||||
# Remove comments from packages once we start using these external
|
# Remove comments from packages once we start using these external
|
||||||
# dependencies.
|
# dependencies.
|
||||||
|
10
.github/workflows/test_windows.yml
vendored
10
.github/workflows/test_windows.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
test: [functional, old]
|
test: [functional, old]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
- uses: ./.github/actions/setup
|
- uses: ./.github/actions/setup
|
||||||
|
|
||||||
- name: Build deps
|
- name: Build deps
|
||||||
@@ -31,6 +31,13 @@ jobs:
|
|||||||
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' ${{ inputs.build_flags }}
|
cmake --preset ci -D CMAKE_BUILD_TYPE='RelWithDebInfo' ${{ inputs.build_flags }}
|
||||||
cmake --build build
|
cmake --build build
|
||||||
|
|
||||||
|
# FIXME(dundargoc): this workaround is needed as the python3 provider
|
||||||
|
# tests suddenly started to become extremely flaky, and this removes the
|
||||||
|
# flakiness for some reason.
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.13'
|
||||||
|
|
||||||
- name: Install test deps
|
- name: Install test deps
|
||||||
run: |
|
run: |
|
||||||
$PSNativeCommandArgumentPassing = 'Legacy'
|
$PSNativeCommandArgumentPassing = 'Legacy'
|
||||||
@@ -60,7 +67,6 @@ jobs:
|
|||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
update: true
|
update: true
|
||||||
install: unzip
|
|
||||||
pacboy: >-
|
pacboy: >-
|
||||||
make:p gcc:p diffutils:p
|
make:p gcc:p diffutils:p
|
||||||
release: false
|
release: false
|
||||||
|
12
.github/workflows/vim_patches.yml
vendored
12
.github/workflows/vim_patches.yml
vendored
@@ -15,11 +15,11 @@ jobs:
|
|||||||
VERSION_BRANCH: marvim/ci-version-update
|
VERSION_BRANCH: marvim/ci-version-update
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: vim/vim
|
repository: vim/vim
|
||||||
path: ${{ env.VIM_SOURCE_DIR }}
|
path: ${{ env.VIM_SOURCE_DIR }}
|
||||||
@@ -28,10 +28,10 @@ jobs:
|
|||||||
- run: sudo apt-get install libfuse2
|
- run: sudo apt-get install libfuse2
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
gh release download -R neovim/neovim -p nvim-linux-x86_64.appimage
|
gh release download -R neovim/neovim -p nvim.appimage
|
||||||
chmod a+x nvim-linux-x86_64.appimage
|
chmod a+x nvim.appimage
|
||||||
mkdir -p $HOME/.local/bin
|
mkdir -p $HOME/.local/bin
|
||||||
mv nvim-linux-x86_64.appimage $HOME/.local/bin/nvim
|
mv nvim.appimage $HOME/.local/bin/nvim
|
||||||
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
|
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Set up git config
|
- name: Set up git config
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
id: update-version
|
id: update-version
|
||||||
run: |
|
run: |
|
||||||
git checkout -b ${VERSION_BRANCH}
|
git checkout -b ${VERSION_BRANCH}
|
||||||
nvim -l scripts/vimpatch.lua
|
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
||||||
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Automatic PR
|
- name: Automatic PR
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -10,8 +10,7 @@ compile_commands.json
|
|||||||
/.idea/
|
/.idea/
|
||||||
|
|
||||||
# Build/deps dir
|
# Build/deps dir
|
||||||
/.zig-cache/
|
/build/
|
||||||
/zig-out/
|
|
||||||
/.deps/
|
/.deps/
|
||||||
/tmp/
|
/tmp/
|
||||||
/.clangd/
|
/.clangd/
|
||||||
@@ -45,7 +44,6 @@ compile_commands.json
|
|||||||
/test/old/testdir/messages
|
/test/old/testdir/messages
|
||||||
/test/old/testdir/starttime
|
/test/old/testdir/starttime
|
||||||
/test/old/testdir/viminfo
|
/test/old/testdir/viminfo
|
||||||
/test/old/testdir/opt_test.vim
|
|
||||||
/test/old/testdir/test.ok
|
/test/old/testdir/test.ok
|
||||||
/test/old/testdir/*.failed
|
/test/old/testdir/*.failed
|
||||||
/test/old/testdir/X*
|
/test/old/testdir/X*
|
||||||
|
@@ -38,18 +38,15 @@ globals = {
|
|||||||
"vim.bo",
|
"vim.bo",
|
||||||
"vim.wo",
|
"vim.wo",
|
||||||
"vim.go",
|
"vim.go",
|
||||||
"vim.env",
|
"vim.env"
|
||||||
"_",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exclude_files = {
|
exclude_files = {
|
||||||
'test/_meta.lua',
|
|
||||||
'test/functional/fixtures/lua/syntax_error.lua',
|
'test/functional/fixtures/lua/syntax_error.lua',
|
||||||
'runtime/lua/vim/treesitter/_meta.lua',
|
'runtime/lua/vim/treesitter/_meta.lua',
|
||||||
'runtime/lua/vim/_meta/vimfn.lua',
|
'runtime/lua/vim/_meta/vimfn.lua',
|
||||||
'runtime/lua/vim/_meta/api.lua',
|
'runtime/lua/vim/_meta/api.lua',
|
||||||
'runtime/lua/vim/re.lua',
|
'runtime/lua/vim/re.lua',
|
||||||
'runtime/lua/uv/_meta.lua',
|
|
||||||
'runtime/lua/coxpcall.lua',
|
'runtime/lua/coxpcall.lua',
|
||||||
'src/nvim/eval.lua',
|
'src/nvim/eval.lua',
|
||||||
}
|
}
|
||||||
|
@@ -5,11 +5,11 @@
|
|||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"library": [
|
"library": [
|
||||||
"${3rd}/busted/library"
|
"runtime/lua",
|
||||||
|
"${3rd}/busted/library",
|
||||||
|
"${3rd}/luv/library"
|
||||||
],
|
],
|
||||||
"ignoreDir": [
|
"ignoreDir": [
|
||||||
".deps",
|
|
||||||
"build",
|
|
||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
"checkThirdParty": "Disable"
|
"checkThirdParty": "Disable"
|
||||||
|
1
.mailmap
1
.mailmap
@@ -18,7 +18,6 @@ Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
|||||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
||||||
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
||||||
Famiu Haque <famiuhaque@proton.me> <famiuhaque@protonmail.com>
|
|
||||||
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
||||||
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
||||||
Gaelan Steele <gbs@canishe.com> Gaelan
|
Gaelan Steele <gbs@canishe.com> Gaelan
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
# Alternative settings for special snowflakes like: decorations_spec.lua, multigrid_spec.lua, etc.
|
|
||||||
|
|
||||||
column_width = 140
|
|
||||||
line_endings = "Unix"
|
|
||||||
indent_type = "Spaces"
|
|
||||||
indent_width = 2
|
|
||||||
quote_style = "AutoPreferSingle"
|
|
||||||
call_parentheses = "Input"
|
|
@@ -1,15 +1,14 @@
|
|||||||
build/
|
/build/
|
||||||
.deps/
|
/.deps/
|
||||||
runtime/lua/coxpcall.lua
|
/runtime/lua/coxpcall.lua
|
||||||
runtime/lua/uv/_meta.lua
|
/runtime/lua/vim/_meta
|
||||||
runtime/lua/vim/_meta
|
/runtime/lua/vim/re.lua
|
||||||
runtime/lua/vim/re.lua
|
|
||||||
|
|
||||||
# These are formatted explicitly by the "formatlua2" build task.
|
|
||||||
test/functional/ui/decorations_spec.lua
|
test/functional/ui/decorations_spec.lua
|
||||||
test/functional/ui/float_spec.lua
|
test/functional/ui/float_spec.lua
|
||||||
test/functional/ui/multigrid_spec.lua
|
test/functional/ui/multigrid_spec.lua
|
||||||
test/functional/fixtures/lua/syntax_error.lua
|
/test/functional/fixtures/lua/syntax_error.lua
|
||||||
test/functional/legacy/030_fileformats_spec.lua
|
/test/functional/legacy/030_fileformats_spec.lua
|
||||||
test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
|
/test/functional/legacy/044_099_regexp_multibyte_magic_spec.lua
|
||||||
test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua
|
/test/functional/legacy/093_mksession_cursor_cols_latin1_spec.lua
|
||||||
|
/test/functional/lua/luaeval_spec.lua
|
||||||
|
110
BUILD.md
110
BUILD.md
@@ -5,13 +5,12 @@
|
|||||||
|
|
||||||
1. Install [build prerequisites](#build-prerequisites) on your system
|
1. Install [build prerequisites](#build-prerequisites) on your system
|
||||||
2. `git clone https://github.com/neovim/neovim`
|
2. `git clone https://github.com/neovim/neovim`
|
||||||
3. `cd neovim`
|
3. `cd neovim && make CMAKE_BUILD_TYPE=RelWithDebInfo`
|
||||||
- If you want the **stable release**, also run `git checkout stable`.
|
- If you want the **stable release**, also run `git checkout stable`.
|
||||||
4. `make CMAKE_BUILD_TYPE=RelWithDebInfo`
|
|
||||||
- If you want to install to a custom location, set `CMAKE_INSTALL_PREFIX`. See also [INSTALL.md](./INSTALL.md#install-from-source).
|
- If you want to install to a custom location, set `CMAKE_INSTALL_PREFIX`. See also [INSTALL.md](./INSTALL.md#install-from-source).
|
||||||
- On BSD, use `gmake` instead of `make`.
|
- On BSD, use `gmake` instead of `make`.
|
||||||
- To build on Windows, see the [Building on Windows](#building-on-windows) section. _MSVC (Visual Studio) is recommended._
|
- To build on Windows, see the [Building on Windows](#building-on-windows) section. _MSVC (Visual Studio) is recommended._
|
||||||
5. `sudo make install`
|
4. `sudo make install`
|
||||||
- Default install location is `/usr/local`
|
- Default install location is `/usr/local`
|
||||||
- On Debian/Ubuntu, instead of `sudo make install`, you can try `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb` (with `<arch>` either `x86_64` or `arm64`) to build DEB-package and install it. This helps ensure clean removal of installed files. Note: This is an unsupported, "best-effort" feature of the Nvim build.
|
- On Debian/Ubuntu, instead of `sudo make install`, you can try `cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb` (with `<arch>` either `x86_64` or `arm64`) to build DEB-package and install it. This helps ensure clean removal of installed files. Note: This is an unsupported, "best-effort" feature of the Nvim build.
|
||||||
|
|
||||||
@@ -85,7 +84,7 @@ make deps
|
|||||||
- Right-click _CMakeLists.txt → Delete Cache_.
|
- Right-click _CMakeLists.txt → Delete Cache_.
|
||||||
- Right-click _CMakeLists.txt → Generate Cache_.
|
- Right-click _CMakeLists.txt → Generate Cache_.
|
||||||
- If you see an "access violation" from `ntdll`, you can ignore it and continue.
|
- If you see an "access violation" from `ntdll`, you can ignore it and continue.
|
||||||
4. If you see an error like `uv.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
|
4. If you set an error like `msgpackc.dll not found`, try the `nvim.exe (Install)` target. Then switch back to `nvim.exe (bin\nvim.exe)`.
|
||||||
|
|
||||||
### Windows / MSVC PowerShell
|
### Windows / MSVC PowerShell
|
||||||
|
|
||||||
@@ -132,13 +131,12 @@ https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv
|
|||||||
1. From the MSYS2 shell, install these packages:
|
1. From the MSYS2 shell, install these packages:
|
||||||
```
|
```
|
||||||
pacman -S \
|
pacman -S \
|
||||||
mingw-w64-ucrt-x86_64-gcc \
|
mingw-w64-x86_64-{gcc,cmake,make,ninja,diffutils}
|
||||||
mingw-w64-x86_64-{cmake,make,ninja,diffutils}
|
|
||||||
```
|
```
|
||||||
2. From the Windows Command Prompt (`cmd.exe`), set up the `PATH` and build.
|
2. From the Windows Command Prompt (`cmd.exe`), set up the `PATH` and build.
|
||||||
|
|
||||||
```cmd
|
```cmd
|
||||||
set PATH=c:\msys64\ucrt64\bin;c:\msys64\usr\bin;%PATH%
|
set PATH=c:\msys64\mingw64\bin;c:\msys64\usr\bin;%PATH%
|
||||||
```
|
```
|
||||||
3. You have two options:
|
3. You have two options:
|
||||||
- Build using `cmake` and `Ninja` generator:
|
- Build using `cmake` and `Ninja` generator:
|
||||||
@@ -165,40 +163,11 @@ https://github.com/cascent/neovim-cygwin was built on Cygwin 2.9.0. Newer `libuv
|
|||||||
mingw32-make install
|
mingw32-make install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows WSL
|
|
||||||
|
|
||||||
Build Ubuntu/Debian linux binary on [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) (Windows Subsystem for Linux).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Install build prerequisites
|
|
||||||
sudo apt-get install ninja-build gettext cmake build-essential
|
|
||||||
|
|
||||||
# Build the linux binary in WSL
|
|
||||||
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
|
|
||||||
# Install the linux binary in WSL (with `<arch>` either `x86_64` or `arm64`)
|
|
||||||
cd build && cpack -G DEB && sudo dpkg -i nvim-linux-<arch>.deb
|
|
||||||
|
|
||||||
# Verify the installation
|
|
||||||
nvim --version && which nvim # should be debug build in /usr/bin/nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note**: If you encounter linker errors or segfaults during the build, Windows libraries in your PATH may be interfering. Use a clean PATH to avoid conflicts:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" make CMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
```
|
|
||||||
|
|
||||||
## Localization
|
## Localization
|
||||||
|
|
||||||
### Localization build
|
### Localization build
|
||||||
|
|
||||||
Translations are turned off by default. Enable by building Nvim with the CMake flag `ENABLE_TRANSLATIONS=ON`.
|
A normal build will create `.mo` files in `build/src/nvim/po`.
|
||||||
Doing this will create `.mo` files in `build/src/nvim/po`. Example:
|
|
||||||
|
|
||||||
```
|
|
||||||
make CMAKE_EXTRA_FLAGS="-DENABLE_TRANSLATIONS=ON"
|
|
||||||
```
|
|
||||||
|
|
||||||
* If you see `msgfmt: command not found`, you need to install [`gettext`](http://en.wikipedia.org/wiki/Gettext). On most systems, the package is just called `gettext`.
|
* If you see `msgfmt: command not found`, you need to install [`gettext`](http://en.wikipedia.org/wiki/Gettext). On most systems, the package is just called `gettext`.
|
||||||
|
|
||||||
@@ -252,7 +221,7 @@ rebuild:
|
|||||||
|
|
||||||
## Third-party dependencies
|
## Third-party dependencies
|
||||||
|
|
||||||
Reference the [Debian package](https://packages.debian.org/sid/source/neovim) (or alternatively, the [Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/n/neovim.rb)) for the precise list of dependencies/versions.
|
Reference the [Debian package](https://packages.debian.org/sid/source/neovim) (or alternatively, the [Homebrew formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/neovim.rb)) for the precise list of dependencies/versions.
|
||||||
|
|
||||||
To build the bundled dependencies using CMake:
|
To build the bundled dependencies using CMake:
|
||||||
|
|
||||||
@@ -271,7 +240,7 @@ cmake --build build
|
|||||||
### How to build without "bundled" dependencies
|
### How to build without "bundled" dependencies
|
||||||
|
|
||||||
1. Manually install the dependencies:
|
1. Manually install the dependencies:
|
||||||
- libuv libluv libutf8proc luajit lua-lpeg tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
|
- libuv libluv libvterm luajit lua-lpeg lua-mpack msgpack-c tree-sitter tree-sitter-c tree-sitter-lua tree-sitter-markdown tree-sitter-query tree-sitter-vim tree-sitter-vimdoc unibilium
|
||||||
2. Run CMake:
|
2. Run CMake:
|
||||||
```sh
|
```sh
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
@@ -279,7 +248,7 @@ cmake --build build
|
|||||||
```
|
```
|
||||||
If all the dependencies are not available in the package, you can use only some of the bundled dependencies as follows (example of using `ninja`):
|
If all the dependencies are not available in the package, you can use only some of the bundled dependencies as follows (example of using `ninja`):
|
||||||
```sh
|
```sh
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_TS=ON
|
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
|
||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
cmake --build build
|
cmake --build build
|
||||||
@@ -288,34 +257,11 @@ cmake --build build
|
|||||||
- Using `ninja` is strongly recommended.
|
- Using `ninja` is strongly recommended.
|
||||||
4. If treesitter parsers are not bundled, they need to be available in a `parser/` runtime directory (e.g. `/usr/share/nvim/runtime/parser/`).
|
4. If treesitter parsers are not bundled, they need to be available in a `parser/` runtime directory (e.g. `/usr/share/nvim/runtime/parser/`).
|
||||||
|
|
||||||
### How to build static binary (on Linux)
|
|
||||||
|
|
||||||
1. Use a linux distribution which uses musl C. We will use Alpine Linux but any distro with musl should work. (glibc does not support static linking)
|
|
||||||
2. Run make passing the `STATIC_BUILD` variable: `make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"`
|
|
||||||
|
|
||||||
In case you are not using Alpine Linux you can use a container to do the build the binary:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
podman run \
|
|
||||||
--rm \
|
|
||||||
-it \
|
|
||||||
-v "$PWD:/workdir" \
|
|
||||||
-w /workdir \
|
|
||||||
alpine:latest \
|
|
||||||
bash -c 'apk add build-base cmake coreutils curl gettext-tiny-dev git && make CMAKE_EXTRA_FLAGS="-DSTATIC_BUILD=1"'
|
|
||||||
```
|
|
||||||
|
|
||||||
The resulting binary in `build/bin/nvim` will have all the dependencies statically linked:
|
|
||||||
|
|
||||||
```
|
|
||||||
build/bin/nvim: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, BuildID[sha1]=b93fa8e678d508ac0a76a2e3da20b119105f1b2d, with debug_info, not stripped
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Debian 10 (Buster) example:
|
#### Debian 10 (Buster) example:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt install luajit libluajit-5.1-dev lua-lpeg libunibilium-dev
|
sudo apt install luajit libluajit-5.1-dev lua-mpack lua-lpeg libunibilium-dev libmsgpack-dev
|
||||||
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_UTF8PROC=ON
|
cmake -S cmake.deps -B .deps -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_BUNDLED=OFF -DUSE_BUNDLED_LIBUV=ON -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_TS=ON
|
||||||
cmake --build .deps
|
cmake --build .deps
|
||||||
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
cmake -B build -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
cmake --build build
|
cmake --build build
|
||||||
@@ -329,7 +275,7 @@ cmake --build build
|
|||||||
```
|
```
|
||||||
- Example of using a package with some dependencies:
|
- Example of using a package with some dependencies:
|
||||||
```
|
```
|
||||||
make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_LIBUV=ON"
|
make BUNDLED_CMAKE_FLAG="-DUSE_BUNDLED=OFF -DUSE_BUNDLED_LUV=ON -DUSE_BUNDLED_TS=ON -DUSE_BUNDLED_LIBVTERM=ON -DUSE_BUNDLED_LIBUV=ON"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build prerequisites
|
## Build prerequisites
|
||||||
@@ -337,40 +283,39 @@ cmake --build build
|
|||||||
General requirements (see [#1469](https://github.com/neovim/neovim/issues/1469#issuecomment-63058312)):
|
General requirements (see [#1469](https://github.com/neovim/neovim/issues/1469#issuecomment-63058312)):
|
||||||
|
|
||||||
- Clang or GCC version 4.9+
|
- Clang or GCC version 4.9+
|
||||||
- CMake version 3.16+, built with TLS/SSL support
|
- CMake version 3.13+, built with TLS/SSL support
|
||||||
- Optional: Get the latest CMake from https://cmake.org/download/
|
- Optional: Get the latest CMake from an [installer](https://github.com/Kitware/CMake/releases) or the [Python package](https://pypi.org/project/cmake/) (`pip install cmake`)
|
||||||
- Provides a shell script which works on most Linux systems. After running it, ensure the resulting `cmake` binary is in your $PATH so the the Nvim build will find it.
|
|
||||||
|
|
||||||
Platform-specific requirements are listed below.
|
Platform-specific requirements are listed below.
|
||||||
|
|
||||||
### Ubuntu / Debian
|
### Ubuntu / Debian
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get install ninja-build gettext cmake curl build-essential git
|
sudo apt-get install ninja-build gettext cmake unzip curl build-essential
|
||||||
```
|
```
|
||||||
|
|
||||||
### RHEL / Fedora
|
### RHEL / Fedora
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo dnf -y install ninja-build cmake gcc make gettext curl glibc-gconv-extra git
|
sudo dnf -y install ninja-build cmake gcc make unzip gettext curl glibc-gconv-extra
|
||||||
```
|
```
|
||||||
|
|
||||||
### openSUSE
|
### openSUSE
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo zypper install ninja cmake gcc-c++ gettext-tools curl git
|
sudo zypper install ninja cmake gcc-c++ gettext-tools curl
|
||||||
```
|
```
|
||||||
|
|
||||||
### Arch Linux
|
### Arch Linux
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo pacman -S base-devel cmake ninja curl git
|
sudo pacman -S base-devel cmake unzip ninja curl
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alpine Linux
|
### Alpine Linux
|
||||||
|
|
||||||
```
|
```
|
||||||
apk add build-base cmake coreutils curl gettext-tiny-dev git
|
apk add build-base cmake coreutils curl unzip gettext-tiny-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Void Linux
|
### Void Linux
|
||||||
@@ -420,21 +365,18 @@ and replacing `neovim-unwrapped` with `neovim-dev`:
|
|||||||
nix-shell '<nixpkgs>' -A neovim-dev
|
nix-shell '<nixpkgs>' -A neovim-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
A flake for Neovim is hosted at [nix-community/neovim-nightly-overlay](https://github.com/nix-community/neovim-nightly-overlay/), with 3 packages:
|
Neovim contains a Nix flake in the `contrib` folder, with 3 packages:
|
||||||
- `neovim` to run the nightly
|
- `neovim` to run the nightly
|
||||||
- `neovim-debug` to run the package with debug symbols
|
- `neovim-debug` to run the package with debug symbols
|
||||||
- `neovim-developer` to get all the tools to develop on `neovim`
|
- `neovim-developer` to get all the tools to develop on `neovim`
|
||||||
|
|
||||||
Thus you can run Neovim nightly with `nix run github:nix-community/neovim-nightly-overlay`.
|
Thus you can run Neovim nightly with `nix run github:neovim/neovim?dir=contrib`.
|
||||||
Similarly to develop on Neovim: `nix run github:nix-community/neovim-nightly-overlay#neovim-developer`.
|
Similarly to develop on Neovim: `nix develop github:neovim/neovim?dir=contrib#neovim-developer`.
|
||||||
|
|
||||||
To use a specific version of Neovim, you can pass `--override-input neovim-src .` to use your current directory,
|
|
||||||
or a specific SHA1 like `--override-input neovim-src github:neovim/neovim/89dc8f8f4e754e70cbe1624f030fb61bded41bc2`.
|
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo pkg install cmake gmake sha wget gettext curl git
|
sudo pkg install cmake gmake sha unzip wget gettext curl
|
||||||
```
|
```
|
||||||
|
|
||||||
If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 hash is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`, then this is your issue (that's the `sha256sum` of an empty file).
|
If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 hash is `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`, then this is your issue (that's the `sha256sum` of an empty file).
|
||||||
@@ -442,7 +384,7 @@ If you get an error regarding a `sha256sum` mismatch, where the actual SHA-256 h
|
|||||||
### OpenBSD
|
### OpenBSD
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
doas pkg_add gmake cmake curl gettext-tools git
|
doas pkg_add gmake cmake unzip curl gettext-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
Build can sometimes fail when using the top level `Makefile`, apparently due to some third-party component (see [#2445-comment](https://github.com/neovim/neovim/issues/2445#issuecomment-108124236)). The following instructions use CMake:
|
Build can sometimes fail when using the top level `Makefile`, apparently due to some third-party component (see [#2445-comment](https://github.com/neovim/neovim/issues/2445#issuecomment-108124236)). The following instructions use CMake:
|
||||||
@@ -467,7 +409,7 @@ gmake
|
|||||||
2. Install [Homebrew](http://brew.sh)
|
2. Install [Homebrew](http://brew.sh)
|
||||||
3. Install Neovim build dependencies:
|
3. Install Neovim build dependencies:
|
||||||
```
|
```
|
||||||
brew install ninja cmake gettext curl git
|
brew install ninja cmake gettext curl
|
||||||
```
|
```
|
||||||
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
||||||
```sh
|
```sh
|
||||||
@@ -485,7 +427,7 @@ gmake
|
|||||||
2. Install [MacPorts](http://www.macports.org)
|
2. Install [MacPorts](http://www.macports.org)
|
||||||
3. Install Neovim build dependencies:
|
3. Install Neovim build dependencies:
|
||||||
```
|
```
|
||||||
sudo port install ninja cmake gettext git
|
sudo port install ninja cmake gettext
|
||||||
```
|
```
|
||||||
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
- **Note**: If you see Wget certificate errors (for older macOS versions less than 10.10):
|
||||||
```sh
|
```sh
|
||||||
|
108
CMakeLists.txt
108
CMakeLists.txt
@@ -4,10 +4,14 @@
|
|||||||
# - pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
# - pitfalls: https://izzys.casa/2019/02/everything-you-never-wanted-to-know-about-cmake/
|
||||||
# - troubleshooting:
|
# - troubleshooting:
|
||||||
# - variable_watch https://cmake.org/cmake/help/latest/command/variable_watch.html
|
# - variable_watch https://cmake.org/cmake/help/latest/command/variable_watch.html
|
||||||
# - verbose output: cmake --build build --verbose
|
|
||||||
|
|
||||||
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
|
# Version should match the tested CMAKE_URL in .github/workflows/build.yml.
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
|
# Can be removed once minimum version is at least 3.15
|
||||||
|
if(POLICY CMP0092)
|
||||||
|
cmake_policy(SET CMP0092 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
project(nvim C)
|
project(nvim C)
|
||||||
|
|
||||||
@@ -35,11 +39,6 @@ include(InstallHelpers)
|
|||||||
include(PreventInTreeBuilds)
|
include(PreventInTreeBuilds)
|
||||||
include(Util)
|
include(Util)
|
||||||
|
|
||||||
if(NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR)
|
|
||||||
# Auto-create a .gitignore in the specified "build" directory.
|
|
||||||
file(GENERATE OUTPUT .gitignore CONTENT "*")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# User settings
|
# User settings
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@@ -51,7 +50,6 @@ set(DEPS_IGNORE_SHA FALSE)
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
|
set(FUNCS_DATA ${PROJECT_BINARY_DIR}/funcs_data.mpack)
|
||||||
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
set(TOUCHES_DIR ${PROJECT_BINARY_DIR}/touches)
|
||||||
set(VTERM_TEST_FILE ${PROJECT_BINARY_DIR}/test/vterm_test_output)
|
|
||||||
|
|
||||||
file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
file(GLOB DOCFILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||||
|
|
||||||
@@ -117,8 +115,10 @@ if(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 OR APPLE)
|
if(WIN32 OR APPLE)
|
||||||
# Handle case-insensitive filenames for Windows and Mac.
|
# Ignore case when comparing filenames on Windows and Mac.
|
||||||
set(CASE_INSENSITIVE_FILENAME TRUE)
|
set(CASE_INSENSITIVE_FILENAME TRUE)
|
||||||
|
# Enable fixing case-insensitive filenames for Windows and Mac.
|
||||||
|
set(USE_FNAME_CASE TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MINGW)
|
if (MINGW)
|
||||||
@@ -130,34 +130,38 @@ else()
|
|||||||
option(ENABLE_LTO "enable link time optimization" ON)
|
option(ENABLE_LTO "enable link time optimization" ON)
|
||||||
endif()
|
endif()
|
||||||
option(ENABLE_LIBINTL "enable libintl" ON)
|
option(ENABLE_LIBINTL "enable libintl" ON)
|
||||||
option(ENABLE_WASMTIME "enable wasmtime" OFF)
|
|
||||||
|
|
||||||
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
message(STATUS "CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
set_default_buildtype(Debug)
|
set_default_buildtype(Debug)
|
||||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
if(NOT isMultiConfig)
|
if(NOT isMultiConfig)
|
||||||
# Unlike build dependencies in cmake.deps, we want dev dependencies such as
|
# Unlike build dependencies in cmake.deps, we assume we want dev dependencies
|
||||||
# Uncrustify to always be built with Release.
|
# such as Uncrustify to always be built with Release.
|
||||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release)
|
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_BUILD_TYPE=Release)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||||
# version string, else they are combined with the result of `git describe`.
|
# version string, else they are combined with the result of `git describe`.
|
||||||
set(NVIM_VERSION_MAJOR 0)
|
set(NVIM_VERSION_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 12)
|
set(NVIM_VERSION_MINOR 10)
|
||||||
set(NVIM_VERSION_PATCH 0)
|
set(NVIM_VERSION_PATCH 4)
|
||||||
set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
# API level
|
# API level
|
||||||
set(NVIM_API_LEVEL 14) # Bump this after any API/stdlib change.
|
set(NVIM_API_LEVEL 12) # Bump this after any API change.
|
||||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||||
set(NVIM_API_PRERELEASE true)
|
set(NVIM_API_PRERELEASE false)
|
||||||
|
|
||||||
|
# Build-type: RelWithDebInfo
|
||||||
|
# /Og means something different in MSVC
|
||||||
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g")
|
||||||
|
endif()
|
||||||
# We _want_ assertions in RelWithDebInfo build-type.
|
# We _want_ assertions in RelWithDebInfo build-type.
|
||||||
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG)
|
||||||
string(REPLACE "-DNDEBUG" "-DRELDEBUG" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
string(REPLACE "/DNDEBUG" "/DRELDEBUG" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
string(REPLACE "/DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||||
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
|
string(REPLACE " " " " CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") # Remove duplicate whitespace
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -187,7 +191,6 @@ if(NOT PREFER_LUA)
|
|||||||
find_program(LUA_PRG NAMES luajit)
|
find_program(LUA_PRG NAMES luajit)
|
||||||
endif()
|
endif()
|
||||||
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
|
find_program(LUA_PRG NAMES lua5.1 lua5.2 lua)
|
||||||
mark_as_advanced(LUA_PRG)
|
|
||||||
if(NOT LUA_PRG)
|
if(NOT LUA_PRG)
|
||||||
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
message(FATAL_ERROR "Failed to find a Lua 5.1-compatible interpreter")
|
||||||
endif()
|
endif()
|
||||||
@@ -201,7 +204,6 @@ message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
|||||||
if(NOT LUA_GEN_PRG)
|
if(NOT LUA_GEN_PRG)
|
||||||
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
|
set(LUA_GEN_PRG "${LUA_PRG}" CACHE FILEPATH "Path to the lua used for code generation.")
|
||||||
endif()
|
endif()
|
||||||
mark_as_advanced(LUA_GEN_PRG)
|
|
||||||
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
|
message(STATUS "Using Lua interpreter for code generation: ${LUA_GEN_PRG}")
|
||||||
|
|
||||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
||||||
@@ -221,7 +223,6 @@ if(COMPILE_LUA AND NOT WIN32)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
mark_as_advanced(LUAC_PRG)
|
|
||||||
if(LUAC_PRG)
|
if(LUAC_PRG)
|
||||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
||||||
endif()
|
endif()
|
||||||
@@ -232,16 +233,14 @@ if(CI_LINT)
|
|||||||
set(LINT_REQUIRED "REQUIRED")
|
set(LINT_REQUIRED "REQUIRED")
|
||||||
endif()
|
endif()
|
||||||
find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED})
|
find_program(SHELLCHECK_PRG shellcheck ${LINT_REQUIRED})
|
||||||
mark_as_advanced(SHELLCHECK_PRG)
|
|
||||||
find_program(STYLUA_PRG stylua ${LINT_REQUIRED})
|
find_program(STYLUA_PRG stylua ${LINT_REQUIRED})
|
||||||
mark_as_advanced(STYLUA_PRG)
|
|
||||||
|
|
||||||
set(STYLUA_DIRS runtime scripts src test contrib)
|
set(STYLUA_DIRS runtime scripts src test contrib)
|
||||||
|
|
||||||
add_glob_target(
|
add_glob_target(
|
||||||
TARGET lintlua-luacheck
|
TARGET lintlua-luacheck
|
||||||
COMMAND $<TARGET_FILE:nvim_bin>
|
COMMAND $<TARGET_FILE:nvim_bin>
|
||||||
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr/share/lua/5.1 luacheck -q
|
FLAGS -ll ${PROJECT_SOURCE_DIR}/test/lua_runner.lua ${CMAKE_BINARY_DIR}/usr luacheck -q
|
||||||
GLOB_DIRS runtime scripts src test
|
GLOB_DIRS runtime scripts src test
|
||||||
GLOB_PAT *.lua
|
GLOB_PAT *.lua
|
||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY PER_DIR)
|
||||||
@@ -254,16 +253,6 @@ add_glob_target(
|
|||||||
GLOB_DIRS ${STYLUA_DIRS}
|
GLOB_DIRS ${STYLUA_DIRS}
|
||||||
GLOB_PAT *.lua
|
GLOB_PAT *.lua
|
||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY PER_DIR)
|
||||||
# Special handling of some files (which are ignored in .styluaignore).
|
|
||||||
# Workaround because stylua doesn't(?) support file-specific settings.
|
|
||||||
add_custom_target(lintlua-stylua2
|
|
||||||
COMMAND ${STYLUA_PRG} --config-path "${PROJECT_SOURCE_DIR}/.stylua2.toml"
|
|
||||||
--color=always --check
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/decorations_spec.lua"
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/float_spec.lua"
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/multigrid_spec.lua"
|
|
||||||
)
|
|
||||||
add_dependencies(lintlua-stylua lintlua-stylua2)
|
|
||||||
|
|
||||||
add_custom_target(lintlua)
|
add_custom_target(lintlua)
|
||||||
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
add_dependencies(lintlua lintlua-luacheck lintlua-stylua)
|
||||||
@@ -277,11 +266,11 @@ add_glob_target(
|
|||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY PER_DIR)
|
||||||
|
|
||||||
add_custom_target(lintcommit
|
add_custom_target(lintcommit
|
||||||
COMMAND $<TARGET_FILE:nvim_bin> --clean -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
|
COMMAND $<TARGET_FILE:nvim_bin> -u NONE -l ${PROJECT_SOURCE_DIR}/scripts/lintcommit.lua main)
|
||||||
add_dependencies(lintcommit nvim_bin)
|
add_dependencies(lintcommit nvim_bin)
|
||||||
|
|
||||||
add_custom_target(lint)
|
add_custom_target(lint)
|
||||||
add_dependencies(lint lintc lintlua lintsh)
|
add_dependencies(lint lintc lintlua lintsh lintcommit)
|
||||||
|
|
||||||
# Format
|
# Format
|
||||||
add_glob_target(
|
add_glob_target(
|
||||||
@@ -291,15 +280,7 @@ add_glob_target(
|
|||||||
GLOB_DIRS ${STYLUA_DIRS}
|
GLOB_DIRS ${STYLUA_DIRS}
|
||||||
GLOB_PAT *.lua
|
GLOB_PAT *.lua
|
||||||
TOUCH_STRATEGY PER_DIR)
|
TOUCH_STRATEGY PER_DIR)
|
||||||
# Special handling of some files (which are ignored in .styluaignore).
|
|
||||||
# Workaround because stylua doesn't(?) support file-specific settings.
|
|
||||||
add_custom_target(formatlua2
|
|
||||||
COMMAND ${STYLUA_PRG} --config-path "${PROJECT_SOURCE_DIR}/.stylua2.toml"
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/decorations_spec.lua"
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/float_spec.lua"
|
|
||||||
"${PROJECT_SOURCE_DIR}/test/functional/ui/multigrid_spec.lua"
|
|
||||||
)
|
|
||||||
add_dependencies(formatlua formatlua2)
|
|
||||||
add_custom_target(format)
|
add_custom_target(format)
|
||||||
add_dependencies(format formatc formatlua)
|
add_dependencies(format formatc formatlua)
|
||||||
|
|
||||||
@@ -326,8 +307,6 @@ get_externalproject_options(uncrustify ${DEPS_IGNORE_SHA})
|
|||||||
ExternalProject_Add(uncrustify
|
ExternalProject_Add(uncrustify
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/uncrustify
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/uncrustify
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||||
-D CMAKE_RUNTIME_OUTPUT_DIRECTORY=${DEPS_BIN_DIR}
|
|
||||||
-D CMAKE_SKIP_RPATH=true
|
|
||||||
EXCLUDE_FROM_ALL TRUE
|
EXCLUDE_FROM_ALL TRUE
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
${EXTERNALPROJECT_OPTIONS})
|
||||||
|
|
||||||
@@ -345,36 +324,3 @@ if(USE_BUNDLED_BUSTED)
|
|||||||
else()
|
else()
|
||||||
add_custom_target(lua_dev_deps)
|
add_custom_target(lua_dev_deps)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch")
|
|
||||||
set(LUALS_ARCH arm64)
|
|
||||||
else()
|
|
||||||
set(LUALS_ARCH x64)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(LUALS_VERSION 3.15.0)
|
|
||||||
set(LUALS "lua-language-server-${LUALS_VERSION}-${CMAKE_SYSTEM_NAME}-${LUALS_ARCH}")
|
|
||||||
set(LUALS_TARBALL ${LUALS}.tar.gz)
|
|
||||||
set(LUALS_URL https://github.com/LuaLS/lua-language-server/releases/download/${LUALS_VERSION}/${LUALS_TARBALL})
|
|
||||||
|
|
||||||
ExternalProject_Add(download_luals
|
|
||||||
URL ${LUALS_URL}
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/luals
|
|
||||||
SOURCE_DIR ${DEPS_BIN_DIR}/luals
|
|
||||||
CONFIGURE_COMMAND ""
|
|
||||||
BUILD_COMMAND ""
|
|
||||||
INSTALL_COMMAND ""
|
|
||||||
EXCLUDE_FROM_ALL TRUE
|
|
||||||
DOWNLOAD_NO_PROGRESS TRUE
|
|
||||||
CMAKE_CACHE_ARGS ${DEPS_CMAKE_CACHE_ARGS})
|
|
||||||
|
|
||||||
file(GLOB_RECURSE LUAFILES runtime/*.lua)
|
|
||||||
add_target(luals
|
|
||||||
COMMAND ${DEPS_BIN_DIR}/luals/bin/lua-language-server
|
|
||||||
--configpath=${PROJECT_SOURCE_DIR}/.luarc.json
|
|
||||||
--check=${PROJECT_SOURCE_DIR}/runtime
|
|
||||||
--checklevel=Hint
|
|
||||||
DEPENDS ${LUAFILES}
|
|
||||||
CUSTOM_COMMAND_ARGS USES_TERMINAL)
|
|
||||||
|
|
||||||
add_dependencies(luals download_luals)
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
{
|
{
|
||||||
"name": "default",
|
"name": "default",
|
||||||
"displayName": "RelWithDebInfo",
|
"displayName": "RelWithDebInfo",
|
||||||
"description": "Enables optimizations with debug information",
|
"description": "Enables optimizations (-Og or -O2) with debug information",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
},
|
},
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
{
|
{
|
||||||
"name": "debug",
|
"name": "debug",
|
||||||
"displayName": "Debug",
|
"displayName": "Debug",
|
||||||
"description": "No optimizations, enables debug information",
|
"description": "Disables optimizations (-O0), enables debug information",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug"
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
},
|
},
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
{
|
{
|
||||||
"name": "release",
|
"name": "release",
|
||||||
"displayName": "Release",
|
"displayName": "Release",
|
||||||
"description": "Optimized for performance, disables debug information",
|
"description": "Same as RelWithDebInfo, but disables debug information",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Release"
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
},
|
},
|
||||||
|
@@ -42,10 +42,10 @@ Developer guidelines
|
|||||||
make distclean
|
make distclean
|
||||||
make # Nvim build system uses ninja automatically, if available.
|
make # Nvim build system uses ninja automatically, if available.
|
||||||
```
|
```
|
||||||
- Install `ccache` or `sccache` for faster rebuilds of Nvim. Nvim will use one
|
- Install `ccache` for faster rebuilds of Nvim. Nvim will use it automatically
|
||||||
of these automatically if it's found. To disable caching use:
|
if it's found. To disable caching use:
|
||||||
```bash
|
```bash
|
||||||
cmake -B build -D CACHE_PRG=OFF
|
CCACHE_DISABLE=true make
|
||||||
```
|
```
|
||||||
|
|
||||||
Pull requests (PRs)
|
Pull requests (PRs)
|
||||||
@@ -83,7 +83,7 @@ a comment.
|
|||||||
### Commit messages
|
### Commit messages
|
||||||
|
|
||||||
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
||||||
the VCS/git logs more valuable (try `make lintcommit`). The structure of a commit message is:
|
the VCS/git logs more valuable. The structure of a commit message is:
|
||||||
|
|
||||||
type(scope): subject
|
type(scope): subject
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ Each pull request must pass the automated builds on [Cirrus CI] and [GitHub Acti
|
|||||||
passes various linter checks.
|
passes various linter checks.
|
||||||
- CI for FreeBSD runs on [Cirrus CI].
|
- CI for FreeBSD runs on [Cirrus CI].
|
||||||
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
|
- To see CI results faster in your PR, you can temporarily set `TEST_FILE` in
|
||||||
[test.yml](https://github.com/neovim/neovim/blob/ad8e0cfc1dfd937c2577dc032e524c799a772693/.github/workflows/test.yml#L26).
|
[test.yml](https://github.com/neovim/neovim/blob/e35b9020b16985eee26e942f9a3f6b045bc3809b/.github/workflows/test.yml#L29).
|
||||||
|
|
||||||
### Coverity
|
### Coverity
|
||||||
|
|
||||||
@@ -256,24 +256,24 @@ make lintdoc
|
|||||||
```
|
```
|
||||||
|
|
||||||
If you need to modify or debug the documentation flow, these are the main files:
|
If you need to modify or debug the documentation flow, these are the main files:
|
||||||
- `./src/gen/gen_vimdoc.lua`:
|
- `./scripts/gen_vimdoc.lua`:
|
||||||
Main doc generator. Parses C and Lua files to render vimdoc files.
|
Main doc generator. Parses C and Lua files to render vimdoc files.
|
||||||
- `./src/gen/luacats_parser.lua`:
|
- `./scripts/luacats_parser.lua`:
|
||||||
Documentation parser for Lua files.
|
Documentation parser for Lua files.
|
||||||
- `./src/gen/cdoc_parser.lua`:
|
- `./scripts/cdoc_parser.lua`:
|
||||||
Documentation parser for C files.
|
Documentation parser for C files.
|
||||||
- `./src/gen/luacats_grammar.lua`:
|
- `./scripts/luacats_grammar.lua`:
|
||||||
Lpeg grammar for LuaCATS
|
Lpeg grammar for LuaCATS
|
||||||
- `./src/gen/cdoc_grammar.lua`:
|
- `./scripts/cdoc_grammar.lua`:
|
||||||
Lpeg grammar for C doc comments
|
Lpeg grammar for C doc comments
|
||||||
- `./src/gen/gen_eval_files.lua`:
|
- `./scripts/gen_eval_files.lua`:
|
||||||
Generates documentation and Lua type files from metadata files:
|
Generates documentation and Lua type files from metadata files:
|
||||||
```
|
```
|
||||||
runtime/lua/vim/* => runtime/doc/lua.txt
|
runtime/lua/vim/* => runtime/doc/lua.txt
|
||||||
runtime/lua/vim/* => runtime/doc/lua.txt
|
runtime/lua/vim/* => runtime/doc/lua.txt
|
||||||
runtime/lua/vim/lsp/ => runtime/doc/lsp.txt
|
runtime/lua/vim/lsp/ => runtime/doc/lsp.txt
|
||||||
src/nvim/api/* => runtime/doc/api.txt
|
src/nvim/api/* => runtime/doc/api.txt
|
||||||
src/nvim/eval.lua => runtime/doc/vimfn.txt
|
src/nvim/eval.lua => runtime/doc/builtin.txt
|
||||||
src/nvim/options.lua => runtime/doc/options.txt
|
src/nvim/options.lua => runtime/doc/options.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ types, etc. See [:help dev-lua-doc][dev-lua-doc].
|
|||||||
- If possible, add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
|
- If possible, add type information (`table`, `string`, `number`, ...). Multiple valid types are separated by a bar (`string|table`). Indicate optional parameters via `type|nil`.
|
||||||
- If a function in your Lua module should _not_ be documented, add `@nodoc`.
|
- If a function in your Lua module should _not_ be documented, add `@nodoc`.
|
||||||
- If the function is internal or otherwise non-public add `@private`.
|
- If the function is internal or otherwise non-public add `@private`.
|
||||||
- Private functions usually should be underscore-prefixed (named "_foo", not "foo"). Prefixing with an underscore implies `@nodoc`.
|
- Private functions usually should be underscore-prefixed (named "_foo", not "foo").
|
||||||
- Mark deprecated functions with `@deprecated`.
|
- Mark deprecated functions with `@deprecated`.
|
||||||
|
|
||||||
Third-party dependencies
|
Third-party dependencies
|
||||||
|
28
INSTALL.md
28
INSTALL.md
@@ -62,17 +62,15 @@ Several Neovim GUIs are available from scoop (extras): [scoop.sh/#/apps?q=neovim
|
|||||||
|
|
||||||
- Add the `bin` folder (e.g. `C:\Program Files\nvim\bin`) to your PATH.
|
- Add the `bin` folder (e.g. `C:\Program Files\nvim\bin`) to your PATH.
|
||||||
- This makes it easy to run `nvim` from anywhere.
|
- This makes it easy to run `nvim` from anywhere.
|
||||||
- If `:set spell` does not work, create the `%LOCALAPPDATA%/nvim-data/site/spell` folder.
|
- If `:set spell` does not work, create the `C:/Users/foo/AppData/Local/nvim/site/spell` folder.
|
||||||
You can then copy your spell files over (for English, located
|
You can then copy your spell files over (for English, located
|
||||||
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.spl) and
|
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.spl) and
|
||||||
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.sug));
|
[here](https://github.com/vim/vim/blob/master/runtime/spell/en.utf-8.sug));
|
||||||
- For Python plugins you need the `pynvim` module. Installation via uv
|
- For Python plugins you need the `pynvim` module. "Virtual envs" are recommended. After activating the virtual env do `pip install pynvim` (in *both*). Edit your `init.vim` so that it contains the path to the env's Python executable:
|
||||||
(https://docs.astral.sh/uv/) is recommended; the `--upgrade` switch ensures
|
```vim
|
||||||
installation of the latest version:
|
let g:python3_host_prog='C:/Users/foo/Envs/neovim3/Scripts/python.exe'
|
||||||
```
|
```
|
||||||
uv tool install --upgrade pynvim
|
- Run `:checkhealth` and read `:help provider-python`.
|
||||||
```
|
|
||||||
- Run `:checkhealth` and read `:help provider-python` for more details.
|
|
||||||
- **init.vim ("vimrc"):** If you already have Vim installed you can copy `%userprofile%\_vimrc` to `%userprofile%\AppData\Local\nvim\init.vim` to use your Vim config with Neovim.
|
- **init.vim ("vimrc"):** If you already have Vim installed you can copy `%userprofile%\_vimrc` to `%userprofile%\AppData\Local\nvim\init.vim` to use your Vim config with Neovim.
|
||||||
|
|
||||||
|
|
||||||
@@ -110,20 +108,20 @@ For arm64:
|
|||||||
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for Linux systems.
|
The [Releases](https://github.com/neovim/neovim/releases) page provides pre-built binaries for Linux systems.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.tar.gz
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
|
||||||
sudo rm -rf /opt/nvim
|
sudo rm -rf /opt/nvim
|
||||||
sudo tar -C /opt -xzf nvim-linux-x86_64.tar.gz
|
sudo tar -C /opt -xzf nvim-linux64.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
Then add this to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
|
After this step add this to `~/.bashrc`:
|
||||||
|
|
||||||
export PATH="$PATH:/opt/nvim-linux-x86_64/bin"
|
export PATH="$PATH:/opt/nvim-linux64/bin"
|
||||||
|
|
||||||
### AppImage ("universal" Linux package)
|
### AppImage ("universal" Linux package)
|
||||||
|
|
||||||
The [Releases](https://github.com/neovim/neovim/releases) page provides an [AppImage](https://appimage.org) that runs on most Linux systems. No installation is needed, just download `nvim-linux-x86_64.appimage` and run it. (It might not work if your Linux distribution is more than 4 years old.) The following instructions assume an `x86_64` architecture; on ARM Linux replace with `arm64`.
|
The [Releases](https://github.com/neovim/neovim/releases) page provides an [AppImage](https://appimage.org) that runs on most Linux systems. No installation is needed, just download `nvim-linux-x86_64.appimage` and run it. (It might not work if your Linux distribution is more than 4 years old.) The following instructions assume an `x86_64` architecture; on ARM Linux replace with `arm64`.
|
||||||
|
|
||||||
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-x86_64.appimage
|
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux-86_64.appimage
|
||||||
chmod u+x nvim-linux-x86_64.appimage
|
chmod u+x nvim-linux-x86_64.appimage
|
||||||
./nvim-linux-x86_64.appimage
|
./nvim-linux-x86_64.appimage
|
||||||
|
|
||||||
@@ -132,7 +130,7 @@ To expose nvim globally:
|
|||||||
mkdir -p /opt/nvim
|
mkdir -p /opt/nvim
|
||||||
mv nvim-linux-x86_64.appimage /opt/nvim/nvim
|
mv nvim-linux-x86_64.appimage /opt/nvim/nvim
|
||||||
|
|
||||||
And the following line to your shell config (`~/.bashrc`, `~/.zshrc`, ...):
|
And the following line to `~/.bashrc`:
|
||||||
|
|
||||||
export PATH="$PATH:/opt/nvim/"
|
export PATH="$PATH:/opt/nvim/"
|
||||||
|
|
||||||
@@ -207,7 +205,7 @@ You can also get nightly builds of git master from the [Copr automated build sys
|
|||||||
dnf copr enable agriffis/neovim-nightly
|
dnf copr enable agriffis/neovim-nightly
|
||||||
dnf install -y neovim python3-neovim
|
dnf install -y neovim python3-neovim
|
||||||
|
|
||||||
See the [blog post](https://arongriffis.com/2019-03-02-neovim-nightly-builds) for information on how these are built.
|
See the [blog post](https://arongriffis.com/2019/03/02/neovim-nightly-builds) for information on how these are built.
|
||||||
|
|
||||||
### Flatpak
|
### Flatpak
|
||||||
|
|
||||||
@@ -305,7 +303,7 @@ Neovim nightly and stable are available on the [snap store](https://snapcraft.io
|
|||||||
**Stable Builds**
|
**Stable Builds**
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo snap install nvim --classic
|
sudo snap install --beta nvim --classic
|
||||||
```
|
```
|
||||||
|
|
||||||
**Nightly Builds**
|
**Nightly Builds**
|
||||||
|
@@ -289,8 +289,3 @@ IV) It is not allowed to remove this license from the distribution of the Vim
|
|||||||
license for previous Vim releases instead of the license that they came
|
license for previous Vim releases instead of the license that they came
|
||||||
with, at your option.
|
with, at your option.
|
||||||
|
|
||||||
====
|
|
||||||
|
|
||||||
In addition, different license conditions may apply to some runtime files
|
|
||||||
included with Vim; these will be specified in the header of each respective
|
|
||||||
file.
|
|
||||||
|
28
MAINTAIN.md
28
MAINTAIN.md
@@ -79,9 +79,7 @@ When a (non-experimental) feature is slated to be removed it should:
|
|||||||
`v0.10.0-dev-1957+gd676746c33` then use `0.12`.
|
`v0.10.0-dev-1957+gd676746c33` then use `0.12`.
|
||||||
- For Vimscript features, use `v:lua.vim.deprecate()`. Use the same version
|
- For Vimscript features, use `v:lua.vim.deprecate()`. Use the same version
|
||||||
as described for Lua features.
|
as described for Lua features.
|
||||||
- `vim.deprecate(…, 'x.y.z')` where major version `x` is greater than the
|
2. Be _hard_ deprecated in a following a release in which it was soft deprecated.
|
||||||
current Nvim major version, is always treated as _soft_ deprecation.
|
|
||||||
2. Be _hard_ deprecated in a release following the release in which it was soft deprecated.
|
|
||||||
- Use of the deprecated feature will still work but should issue a warning.
|
- Use of the deprecated feature will still work but should issue a warning.
|
||||||
- Features implemented in C will need bespoke implementations to communicate
|
- Features implemented in C will need bespoke implementations to communicate
|
||||||
to users that the feature is deprecated.
|
to users that the feature is deprecated.
|
||||||
@@ -127,12 +125,12 @@ Some can be auto-bumped by `scripts/bump_deps.lua`.
|
|||||||
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
* [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||||
* [Lua](https://www.lua.org/download.html)
|
* [Lua](https://www.lua.org/download.html)
|
||||||
* [Luv](https://github.com/luvit/luv)
|
* [Luv](https://github.com/luvit/luv)
|
||||||
* When bumping, also sync
|
* When bumping, also sync [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs.md).
|
||||||
- [our bundled meta file](https://github.com/neovim/neovim/blob/master/runtime/lua/uv/_meta.lua) with [the upstream meta file](https://github.com/luvit/luv/blob/master/docs/meta.lua);
|
|
||||||
- [our bundled documentation](https://github.com/neovim/neovim/blob/master/runtime/doc/luvref.txt) with [the upstream documentation](https://github.com/luvit/luv/blob/master/docs/docs.md).
|
|
||||||
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
* [gettext](https://ftp.gnu.org/pub/gnu/gettext/)
|
||||||
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
* [libiconv](https://ftp.gnu.org/pub/gnu/libiconv)
|
||||||
* [libuv](https://github.com/libuv/libuv)
|
* [libuv](https://github.com/libuv/libuv)
|
||||||
|
* [libvterm](https://www.leonerd.org.uk/code/libvterm/)
|
||||||
|
* Downloading from the original source is unreliable, so we use our [mirror](https://github.com/neovim/libvterm) instead.
|
||||||
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
* [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||||
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
* [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||||
* [unibilium](https://github.com/neovim/unibilium)
|
* [unibilium](https://github.com/neovim/unibilium)
|
||||||
@@ -145,8 +143,6 @@ These dependencies are "vendored" (inlined), we must update the sources manually
|
|||||||
|
|
||||||
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
* `src/mpack/`: [libmpack](https://github.com/libmpack/libmpack)
|
||||||
* send improvements upstream!
|
* send improvements upstream!
|
||||||
* `src/mpack/lmpack.c`: [libmpack-lua](https://github.com/libmpack/libmpack-lua)
|
|
||||||
* send improvements upstream!
|
|
||||||
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
* `src/xdiff/`: [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||||
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
* `src/cjson/`: [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||||
* `src/klib/`: [Klib](https://github.com/attractivechaos/klib)
|
* `src/klib/`: [Klib](https://github.com/attractivechaos/klib)
|
||||||
@@ -154,7 +150,7 @@ These dependencies are "vendored" (inlined), we must update the sources manually
|
|||||||
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
* `src/nvim/tui/terminfo_defs.h`: terminfo definitions
|
||||||
* Run `scripts/update_terminfo.sh` to update these definitions.
|
* Run `scripts/update_terminfo.sh` to update these definitions.
|
||||||
* `runtime/lua/vim/lsp/_meta/protocol.lua`: LSP specification
|
* `runtime/lua/vim/lsp/_meta/protocol.lua`: LSP specification
|
||||||
* Run `src/gen/gen_lsp.lua` to update.
|
* Run `scripts/gen_lsp.lua` to update.
|
||||||
* `runtime/lua/vim/_meta/lpeg.lua`: LPeg definitions.
|
* `runtime/lua/vim/_meta/lpeg.lua`: LPeg definitions.
|
||||||
* Refer to [`LuaCATS/lpeg`](https://github.com/LuaCATS/lpeg) for updates.
|
* Refer to [`LuaCATS/lpeg`](https://github.com/LuaCATS/lpeg) for updates.
|
||||||
* Update the git SHA revision from which the documentation was taken.
|
* Update the git SHA revision from which the documentation was taken.
|
||||||
@@ -164,6 +160,7 @@ These dependencies are "vendored" (inlined), we must update the sources manually
|
|||||||
* Needs to be updated when LPeg is updated.
|
* Needs to be updated when LPeg is updated.
|
||||||
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
|
* `src/bit.c`: only for PUC lua: port of `require'bit'` from luajit https://bitop.luajit.org/
|
||||||
* `runtime/lua/coxpcall.lua`: coxpcall (only needed for PUC lua, builtin to luajit)
|
* `runtime/lua/coxpcall.lua`: coxpcall (only needed for PUC lua, builtin to luajit)
|
||||||
|
* `src/termkey`: [libtermkey](https://github.com/neovim/libtermkey)
|
||||||
|
|
||||||
Other dependencies
|
Other dependencies
|
||||||
--------------------------
|
--------------------------
|
||||||
@@ -173,9 +170,6 @@ Other dependencies
|
|||||||
* https://github.com/nvim-winget
|
* https://github.com/nvim-winget
|
||||||
* Org secrets/tokens:
|
* Org secrets/tokens:
|
||||||
* `CODECOV_TOKEN`
|
* `CODECOV_TOKEN`
|
||||||
* `BACKPORT_KEY`
|
|
||||||
* Org/repo variables:
|
|
||||||
* `BACKPORT_APP`
|
|
||||||
* Domain names (held in https://namecheap.com):
|
* Domain names (held in https://namecheap.com):
|
||||||
* neovim.org
|
* neovim.org
|
||||||
* neovim.io
|
* neovim.io
|
||||||
@@ -191,10 +185,10 @@ Refactoring
|
|||||||
|
|
||||||
Refactoring Vim structurally and aesthetically is an important goal of Neovim.
|
Refactoring Vim structurally and aesthetically is an important goal of Neovim.
|
||||||
But there are some modules that should not be changed significantly, because
|
But there are some modules that should not be changed significantly, because
|
||||||
they are maintained by Vim, at present. Until someone takes "ownership" of
|
they are maintained Vim, at present. Until someone takes "ownership" of these
|
||||||
these modules, the cost of any significant changes (including style or
|
modules, the cost of any significant changes (including style or structural
|
||||||
structural changes that re-arrange the code) to these modules outweighs the
|
changes that re-arrange the code) to these modules outweighs the benefit. The
|
||||||
benefit. The modules are:
|
modules are:
|
||||||
|
|
||||||
- `regexp.c`
|
- `regexp.c`
|
||||||
- `indent_c.c`
|
- `indent_c.c`
|
||||||
@@ -243,4 +237,4 @@ See also
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
* https://github.com/neovim/neovim/issues/862
|
* https://github.com/neovim/neovim/issues/862
|
||||||
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.adoc
|
* https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt
|
||||||
|
24
Makefile
24
Makefile
@@ -1,14 +1,4 @@
|
|||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
ifeq '$(findstring ;,$(PATH))' ';'
|
|
||||||
UNIX_LIKE := FALSE
|
|
||||||
else
|
|
||||||
UNIX_LIKE := TRUE
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
UNIX_LIKE := TRUE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(UNIX_LIKE),FALSE)
|
|
||||||
SHELL := powershell.exe
|
SHELL := powershell.exe
|
||||||
.SHELLFLAGS := -NoProfile -NoLogo
|
.SHELLFLAGS := -NoProfile -NoLogo
|
||||||
MKDIR := @$$null = new-item -itemtype directory -force
|
MKDIR := @$$null = new-item -itemtype directory -force
|
||||||
@@ -25,6 +15,7 @@ else
|
|||||||
RM := rm -rf
|
RM := rm -rf
|
||||||
CMAKE := $(shell (command -v cmake3 || command -v cmake || echo cmake))
|
CMAKE := $(shell (command -v cmake3 || command -v cmake || echo cmake))
|
||||||
CMAKE_GENERATOR ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || echo "Unix Makefiles")"
|
CMAKE_GENERATOR ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || echo "Unix Makefiles")"
|
||||||
|
GENERATOR_CMD ?= "$(shell (command -v ninja > /dev/null 2>&1 && echo "ninja") || echo "make")"
|
||||||
define rmdir
|
define rmdir
|
||||||
rm -rf $1
|
rm -rf $1
|
||||||
endef
|
endef
|
||||||
@@ -136,16 +127,13 @@ functionaltest-lua: | nvim
|
|||||||
$(CMAKE) --build build --target functionaltest
|
$(CMAKE) --build build --target functionaltest
|
||||||
|
|
||||||
FORMAT=formatc formatlua format
|
FORMAT=formatc formatlua format
|
||||||
LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint luals
|
LINT=lintlua lintsh lintc clang-analyzer lintcommit lintdoc lint
|
||||||
TEST=functionaltest unittest
|
TEST=functionaltest unittest
|
||||||
generated-sources benchmark $(FORMAT) $(LINT) $(TEST) doc: | build/.ran-cmake
|
generated-sources benchmark $(FORMAT) $(LINT) $(TEST) doc: | build/.ran-cmake
|
||||||
$(CMAKE) --build build --target $@
|
$(CMAKE) --build build --target $@
|
||||||
|
|
||||||
test: $(TEST)
|
test: $(TEST)
|
||||||
|
|
||||||
# iwyu-fix-includes can be downloaded from
|
|
||||||
# https://github.com/include-what-you-use/include-what-you-use/blob/master/fix_includes.py.
|
|
||||||
# Create a iwyu-fix-includes shell script in your $PATH that invokes the python script.
|
|
||||||
iwyu: build/.ran-cmake
|
iwyu: build/.ran-cmake
|
||||||
$(CMAKE) --preset iwyu
|
$(CMAKE) --preset iwyu
|
||||||
$(CMAKE) --build build > build/iwyu.log
|
$(CMAKE) --build build > build/iwyu.log
|
||||||
@@ -170,7 +158,7 @@ distclean:
|
|||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
|
|
||||||
install: checkprefix nvim
|
install: checkprefix nvim
|
||||||
$(CMAKE) --install build
|
$(GENERATOR_CMD) -C build install
|
||||||
|
|
||||||
appimage:
|
appimage:
|
||||||
bash scripts/genappimage.sh
|
bash scripts/genappimage.sh
|
||||||
@@ -182,9 +170,3 @@ appimage-%:
|
|||||||
bash scripts/genappimage.sh $*
|
bash scripts/genappimage.sh $*
|
||||||
|
|
||||||
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark $(FORMAT) $(LINT) $(TEST)
|
.PHONY: test clean distclean nvim libnvim cmake deps install appimage checkprefix benchmark $(FORMAT) $(LINT) $(TEST)
|
||||||
|
|
||||||
.PHONY: emmylua-check
|
|
||||||
emmylua-check:
|
|
||||||
-emmylua_check runtime/lua \
|
|
||||||
--config .luarc.json \
|
|
||||||
--config .emmyrc.json
|
|
||||||
|
@@ -27,7 +27,7 @@ Features
|
|||||||
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
- [API access](https://github.com/neovim/neovim/wiki/Related-projects#api-clients)
|
||||||
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin,
|
from any language including C/C++, C#, Clojure, D, Elixir, Go, Haskell, Java/Kotlin,
|
||||||
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
|
JavaScript/Node.js, Julia, Lisp, Lua, Perl, Python, Racket, Ruby, Rust
|
||||||
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/terminal.html)
|
- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html)
|
||||||
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
- Asynchronous [job control](https://github.com/neovim/neovim/pull/2247)
|
||||||
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
- [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances
|
||||||
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
- [XDG base directories](https://github.com/neovim/neovim/pull/3470) support
|
||||||
|
462
build.zig
462
build.zig
@@ -1,462 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
const LazyPath = std.Build.LazyPath;
|
|
||||||
const build_lua = @import("src/build_lua.zig");
|
|
||||||
const gen = @import("src/gen/gen_steps.zig");
|
|
||||||
const runtime = @import("runtime/gen_runtime.zig");
|
|
||||||
const tests = @import("test/run_tests.zig");
|
|
||||||
|
|
||||||
const version = struct {
|
|
||||||
const major = 0;
|
|
||||||
const minor = 12;
|
|
||||||
const patch = 0;
|
|
||||||
const prerelease = "-dev";
|
|
||||||
|
|
||||||
const api_level = 14;
|
|
||||||
const api_level_compat = 0;
|
|
||||||
const api_prerelease = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO(bfredl): this is for an upstream issue
|
|
||||||
pub fn lazyArtifact(d: *std.Build.Dependency, name: []const u8) ?*std.Build.Step.Compile {
|
|
||||||
var found: ?*std.Build.Step.Compile = null;
|
|
||||||
for (d.builder.install_tls.step.dependencies.items) |dep_step| {
|
|
||||||
const inst = dep_step.cast(std.Build.Step.InstallArtifact) orelse continue;
|
|
||||||
if (std.mem.eql(u8, inst.artifact.name, name)) {
|
|
||||||
if (found != null) std.debug.panic("artifact name '{s}' is ambiguous", .{name});
|
|
||||||
found = inst.artifact;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return found;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
|
||||||
const target = b.standardTargetOptions(.{});
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
const t = target.result;
|
|
||||||
const os_tag = t.os.tag;
|
|
||||||
const is_windows = (os_tag == .windows);
|
|
||||||
const is_linux = (os_tag == .linux);
|
|
||||||
const is_darwin = os_tag.isDarwin();
|
|
||||||
const modern_unix = is_darwin or os_tag.isBSD() or is_linux;
|
|
||||||
|
|
||||||
const cross_compiling = b.option(bool, "cross", "cross compile") orelse false;
|
|
||||||
// TODO(bfredl): option to set nlua0 target explicitly when cross compiling?
|
|
||||||
const target_host = if (cross_compiling) b.graph.host else target;
|
|
||||||
const optimize_host = .ReleaseSafe;
|
|
||||||
|
|
||||||
// puc lua 5.1 is not ReleaseSafe "safe"
|
|
||||||
const optimize_lua = if (optimize == .Debug or optimize == .ReleaseSafe) .ReleaseSmall else optimize;
|
|
||||||
|
|
||||||
const arch = t.cpu.arch;
|
|
||||||
const default_luajit = (is_linux and arch == .x86_64) or (is_darwin and arch == .aarch64);
|
|
||||||
const use_luajit = b.option(bool, "luajit", "use luajit") orelse default_luajit;
|
|
||||||
const host_use_luajit = if (cross_compiling) false else use_luajit;
|
|
||||||
const E = enum { luajit, lua51 };
|
|
||||||
|
|
||||||
const ziglua = b.dependency("zlua", .{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize_lua,
|
|
||||||
.lang = if (use_luajit) E.luajit else E.lua51,
|
|
||||||
.shared = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const ziglua_host = if (cross_compiling) b.dependency("zlua", .{
|
|
||||||
.target = target_host,
|
|
||||||
.optimize = optimize_lua,
|
|
||||||
.lang = if (host_use_luajit) E.luajit else E.lua51,
|
|
||||||
.shared = false,
|
|
||||||
}) else ziglua;
|
|
||||||
|
|
||||||
const lpeg = b.dependency("lpeg", .{});
|
|
||||||
|
|
||||||
const iconv = if (is_windows or is_darwin) b.lazyDependency("libiconv", .{ .target = target, .optimize = optimize }) else null;
|
|
||||||
|
|
||||||
// this is currently not necessary, as ziglua currently doesn't use lazy dependencies
|
|
||||||
// to circumvent ziglua.artifact() failing in a bad way.
|
|
||||||
const lua = lazyArtifact(ziglua, "lua") orelse return;
|
|
||||||
if (cross_compiling) {
|
|
||||||
_ = lazyArtifact(ziglua_host, "lua") orelse return;
|
|
||||||
}
|
|
||||||
// const lua = ziglua.artifact("lua");
|
|
||||||
|
|
||||||
const libuv_dep = b.dependency("libuv", .{ .target = target, .optimize = optimize });
|
|
||||||
const libuv = libuv_dep.artifact("uv");
|
|
||||||
const libluv = try build_lua.build_libluv(b, target, optimize, lua, libuv);
|
|
||||||
|
|
||||||
const libluv_host = if (cross_compiling) libluv_host: {
|
|
||||||
const libuv_dep_host = b.dependency("libuv", .{ .target = target_host, .optimize = optimize_host });
|
|
||||||
const libuv_host = libuv_dep_host.artifact("uv");
|
|
||||||
break :libluv_host try build_lua.build_libluv(b, target_host, optimize_host, ziglua_host.artifact("lua"), libuv_host);
|
|
||||||
} else libluv;
|
|
||||||
|
|
||||||
const utf8proc = b.dependency("utf8proc", .{ .target = target, .optimize = optimize });
|
|
||||||
const unibilium = b.dependency("unibilium", .{ .target = target, .optimize = optimize });
|
|
||||||
// TODO(bfredl): fix upstream bugs with UBSAN
|
|
||||||
const treesitter = b.dependency("treesitter", .{ .target = target, .optimize = .ReleaseFast });
|
|
||||||
|
|
||||||
const nlua0 = build_lua.build_nlua0(b, target_host, optimize_host, host_use_luajit, ziglua_host, lpeg, libluv_host);
|
|
||||||
|
|
||||||
// usual caveat emptor: might need to force a rebuild if the only change is
|
|
||||||
// addition of new .c files, as those are not seen by any hash
|
|
||||||
const subdirs = [_][]const u8{
|
|
||||||
"", // src/nvim itself
|
|
||||||
"os/",
|
|
||||||
"api/",
|
|
||||||
"api/private/",
|
|
||||||
"msgpack_rpc/",
|
|
||||||
"tui/",
|
|
||||||
"tui/termkey/",
|
|
||||||
"event/",
|
|
||||||
"eval/",
|
|
||||||
"lib/",
|
|
||||||
"lua/",
|
|
||||||
"viml/",
|
|
||||||
"viml/parser/",
|
|
||||||
"vterm/",
|
|
||||||
};
|
|
||||||
|
|
||||||
// source names _relative_ src/nvim/, not including other src/ subdircs
|
|
||||||
var nvim_sources = try std.ArrayList(gen.SourceItem).initCapacity(b.allocator, 100);
|
|
||||||
var nvim_headers = try std.ArrayList([]u8).initCapacity(b.allocator, 100);
|
|
||||||
|
|
||||||
// both source headers and the {module}.h.generated.h files
|
|
||||||
var api_headers = try std.ArrayList(std.Build.LazyPath).initCapacity(b.allocator, 10);
|
|
||||||
|
|
||||||
// TODO(bfredl): these should just become subdirs..
|
|
||||||
const windows_only = [_][]const u8{ "pty_proc_win.c", "pty_proc_win.h", "pty_conpty_win.c", "pty_conpty_win.h", "os_win_console.c", "win_defs.h" };
|
|
||||||
const unix_only = [_][]const u8{ "unix_defs.h", "pty_proc_unix.c", "pty_proc_unix.h" };
|
|
||||||
const exclude_list = if (is_windows) &unix_only else &windows_only;
|
|
||||||
|
|
||||||
const src_dir = b.build_root.handle;
|
|
||||||
for (subdirs) |s| {
|
|
||||||
var dir = try src_dir.openDir(b.fmt("src/nvim/{s}", .{s}), .{ .iterate = true });
|
|
||||||
defer dir.close();
|
|
||||||
var it = dir.iterateAssumeFirstIteration();
|
|
||||||
const api_export = std.mem.eql(u8, s, "api/");
|
|
||||||
const os_check = std.mem.eql(u8, s, "os/");
|
|
||||||
entries: while (try it.next()) |entry| {
|
|
||||||
if (entry.name.len < 3) continue;
|
|
||||||
if (entry.name[0] < 'a' or entry.name[0] > 'z') continue;
|
|
||||||
if (os_check) {
|
|
||||||
for (exclude_list) |name| {
|
|
||||||
if (std.mem.eql(u8, name, entry.name)) {
|
|
||||||
continue :entries;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (std.mem.eql(u8, ".c", entry.name[entry.name.len - 2 ..])) {
|
|
||||||
try nvim_sources.append(.{ .name = b.fmt("{s}{s}", .{ s, entry.name }), .api_export = api_export });
|
|
||||||
}
|
|
||||||
if (std.mem.eql(u8, ".h", entry.name[entry.name.len - 2 ..])) {
|
|
||||||
try nvim_headers.append(b.fmt("{s}{s}", .{ s, entry.name }));
|
|
||||||
if (api_export and !std.mem.eql(u8, "ui_events.in.h", entry.name)) {
|
|
||||||
try api_headers.append(b.path(b.fmt("src/nvim/{s}{s}", .{ s, entry.name })));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const support_unittests = use_luajit;
|
|
||||||
|
|
||||||
const gen_config = b.addWriteFiles();
|
|
||||||
|
|
||||||
const version_lua = gen_config.add("nvim_version.lua", lua_version_info(b));
|
|
||||||
|
|
||||||
var config_str = b.fmt("zig build -Doptimize={s}", .{@tagName(optimize)});
|
|
||||||
if (cross_compiling) {
|
|
||||||
config_str = b.fmt("{s} -Dcross -Dtarget={s} (host: {s})", .{ config_str, try t.linuxTriple(b.allocator), try b.graph.host.result.linuxTriple(b.allocator) });
|
|
||||||
}
|
|
||||||
|
|
||||||
const versiondef_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("cmake.config/versiondef.h.in") } }, .{
|
|
||||||
.NVIM_VERSION_MAJOR = version.major,
|
|
||||||
.NVIM_VERSION_MINOR = version.minor,
|
|
||||||
.NVIM_VERSION_PATCH = version.patch,
|
|
||||||
.NVIM_VERSION_PRERELEASE = version.prerelease,
|
|
||||||
.NVIM_VERSION_MEDIUM = "",
|
|
||||||
.VERSION_STRING = "TODO", // TODO(bfredl): not sure what to put here. summary already in "config_str"
|
|
||||||
.CONFIG = config_str,
|
|
||||||
});
|
|
||||||
_ = gen_config.addCopyFile(versiondef_step.getOutput(), "auto/versiondef.h"); // run_preprocessor() workaronnd
|
|
||||||
|
|
||||||
const ptrwidth = t.ptrBitWidth() / 8;
|
|
||||||
const sysconfig_step = b.addConfigHeader(.{ .style = .{ .cmake = b.path("cmake.config/config.h.in") } }, .{
|
|
||||||
.SIZEOF_INT = t.cTypeByteSize(.int),
|
|
||||||
.SIZEOF_INTMAX_T = t.cTypeByteSize(.longlong), // TODO
|
|
||||||
.SIZEOF_LONG = t.cTypeByteSize(.long),
|
|
||||||
.SIZEOF_SIZE_T = ptrwidth,
|
|
||||||
.SIZEOF_VOID_PTR = ptrwidth,
|
|
||||||
|
|
||||||
.PROJECT_NAME = "nvim",
|
|
||||||
|
|
||||||
.HAVE__NSGETENVIRON = is_darwin,
|
|
||||||
.HAVE_FD_CLOEXEC = modern_unix,
|
|
||||||
.HAVE_FSEEKO = modern_unix,
|
|
||||||
.HAVE_LANGINFO_H = modern_unix,
|
|
||||||
.HAVE_NL_LANGINFO_CODESET = modern_unix,
|
|
||||||
.HAVE_NL_MSG_CAT_CNTR = t.isGnuLibC(),
|
|
||||||
.HAVE_PWD_FUNCS = modern_unix,
|
|
||||||
.HAVE_READLINK = modern_unix,
|
|
||||||
.HAVE_STRNLEN = modern_unix,
|
|
||||||
.HAVE_STRCASECMP = modern_unix,
|
|
||||||
.HAVE_STRINGS_H = modern_unix,
|
|
||||||
.HAVE_STRNCASECMP = modern_unix,
|
|
||||||
.HAVE_STRPTIME = modern_unix,
|
|
||||||
.HAVE_XATTR = is_linux,
|
|
||||||
.HAVE_SYS_SDT_H = false,
|
|
||||||
.HAVE_SYS_UTSNAME_H = modern_unix,
|
|
||||||
.HAVE_SYS_WAIT_H = false, // unused
|
|
||||||
.HAVE_TERMIOS_H = modern_unix,
|
|
||||||
.HAVE_WORKING_LIBINTL = t.isGnuLibC(),
|
|
||||||
.UNIX = modern_unix,
|
|
||||||
.CASE_INSENSITIVE_FILENAME = is_darwin or is_windows,
|
|
||||||
.HAVE_SYS_UIO_H = modern_unix,
|
|
||||||
.HAVE_READV = modern_unix,
|
|
||||||
.HAVE_DIRFD_AND_FLOCK = modern_unix,
|
|
||||||
.HAVE_FORKPTY = modern_unix and !is_darwin, // also on Darwin but we lack the headers :(
|
|
||||||
.HAVE_BE64TOH = modern_unix and !is_darwin,
|
|
||||||
.ORDER_BIG_ENDIAN = t.cpu.arch.endian() == .big,
|
|
||||||
.ENDIAN_INCLUDE_FILE = "endian.h",
|
|
||||||
.HAVE_EXECINFO_BACKTRACE = modern_unix and !t.isMuslLibC(),
|
|
||||||
.HAVE_BUILTIN_ADD_OVERFLOW = true,
|
|
||||||
.HAVE_WIMPLICIT_FALLTHROUGH_FLAG = true,
|
|
||||||
.HAVE_BITSCANFORWARD64 = null,
|
|
||||||
|
|
||||||
.VTERM_TEST_FILE = "test/vterm_test_output", // TODO(bfredl): revisit when porting libvterm tests
|
|
||||||
});
|
|
||||||
|
|
||||||
_ = gen_config.addCopyFile(sysconfig_step.getOutput(), "auto/config.h"); // run_preprocessor() workaronnd
|
|
||||||
_ = gen_config.add("auto/pathdef.h", b.fmt(
|
|
||||||
\\char *default_vim_dir = "/usr/local/share/nvim";
|
|
||||||
\\char *default_vimruntime_dir = "";
|
|
||||||
\\char *default_lib_dir = "/usr/local/lib/nvim";
|
|
||||||
, .{}));
|
|
||||||
|
|
||||||
// TODO(bfredl): include git version when available
|
|
||||||
const medium = b.fmt("v{}.{}.{}{s}+zig", .{ version.major, version.minor, version.patch, version.prerelease });
|
|
||||||
const versiondef_git = gen_config.add("auto/versiondef_git.h", b.fmt(
|
|
||||||
\\#define NVIM_VERSION_MEDIUM "{s}"
|
|
||||||
\\#define NVIM_VERSION_BUILD "???"
|
|
||||||
\\
|
|
||||||
, .{medium}));
|
|
||||||
|
|
||||||
// TODO(zig): using getEmittedIncludeTree() is ugly af. we want unittests
|
|
||||||
// to reuse the std.build.Module include_path thing
|
|
||||||
const unittest_include_path = [_]LazyPath{
|
|
||||||
b.path("src/"),
|
|
||||||
gen_config.getDirectory(),
|
|
||||||
lua.getEmittedIncludeTree(),
|
|
||||||
libuv.getEmittedIncludeTree(),
|
|
||||||
libluv.getEmittedIncludeTree(),
|
|
||||||
utf8proc.artifact("utf8proc").getEmittedIncludeTree(),
|
|
||||||
unibilium.artifact("unibilium").getEmittedIncludeTree(),
|
|
||||||
treesitter.artifact("tree-sitter").getEmittedIncludeTree(),
|
|
||||||
if (iconv) |dep| dep.artifact("iconv").getEmittedIncludeTree() else b.path("UNUSED_PATH/"),
|
|
||||||
};
|
|
||||||
|
|
||||||
const gen_headers, const funcs_data = try gen.nvim_gen_sources(b, nlua0, &nvim_sources, &nvim_headers, &api_headers, versiondef_git, version_lua);
|
|
||||||
|
|
||||||
const test_config_step = b.addWriteFiles();
|
|
||||||
_ = test_config_step.add("test/cmakeconfig/paths.lua", try test_config(b));
|
|
||||||
|
|
||||||
const test_gen_step = b.step("gen_headers", "debug: output generated headers");
|
|
||||||
const config_install = b.addInstallDirectory(.{ .source_dir = gen_config.getDirectory(), .install_dir = .prefix, .install_subdir = "config/" });
|
|
||||||
test_gen_step.dependOn(&config_install.step);
|
|
||||||
test_gen_step.dependOn(&b.addInstallDirectory(.{ .source_dir = gen_headers.getDirectory(), .install_dir = .prefix, .install_subdir = "headers/" }).step);
|
|
||||||
|
|
||||||
const nvim_exe = b.addExecutable(.{
|
|
||||||
.name = "nvim",
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
nvim_exe.rdynamic = true; // -E
|
|
||||||
|
|
||||||
nvim_exe.linkLibrary(lua);
|
|
||||||
nvim_exe.linkLibrary(libuv);
|
|
||||||
nvim_exe.linkLibrary(libluv);
|
|
||||||
if (iconv) |dep| nvim_exe.linkLibrary(dep.artifact("iconv"));
|
|
||||||
nvim_exe.linkLibrary(utf8proc.artifact("utf8proc"));
|
|
||||||
nvim_exe.linkLibrary(unibilium.artifact("unibilium"));
|
|
||||||
nvim_exe.linkLibrary(treesitter.artifact("tree-sitter"));
|
|
||||||
if (is_windows) {
|
|
||||||
nvim_exe.linkSystemLibrary("netapi32");
|
|
||||||
}
|
|
||||||
nvim_exe.addIncludePath(b.path("src"));
|
|
||||||
nvim_exe.addIncludePath(gen_config.getDirectory());
|
|
||||||
nvim_exe.addIncludePath(gen_headers.getDirectory());
|
|
||||||
build_lua.add_lua_modules(nvim_exe.root_module, lpeg, use_luajit, false);
|
|
||||||
|
|
||||||
var unit_test_sources = try std.ArrayList([]u8).initCapacity(b.allocator, 10);
|
|
||||||
if (support_unittests) {
|
|
||||||
var unit_test_fixtures = try src_dir.openDir("test/unit/fixtures/", .{ .iterate = true });
|
|
||||||
defer unit_test_fixtures.close();
|
|
||||||
var it = unit_test_fixtures.iterateAssumeFirstIteration();
|
|
||||||
while (try it.next()) |entry| {
|
|
||||||
if (entry.name.len < 3) continue;
|
|
||||||
if (std.mem.eql(u8, ".c", entry.name[entry.name.len - 2 ..])) {
|
|
||||||
try unit_test_sources.append(b.fmt("test/unit/fixtures/{s}", .{entry.name}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const src_paths = try b.allocator.alloc([]u8, nvim_sources.items.len + unit_test_sources.items.len);
|
|
||||||
for (nvim_sources.items, 0..) |s, i| {
|
|
||||||
src_paths[i] = b.fmt("src/nvim/{s}", .{s.name});
|
|
||||||
}
|
|
||||||
@memcpy(src_paths[nvim_sources.items.len..], unit_test_sources.items);
|
|
||||||
|
|
||||||
const flags = [_][]const u8{
|
|
||||||
"-std=gnu99",
|
|
||||||
"-DZIG_BUILD",
|
|
||||||
"-D_GNU_SOURCE",
|
|
||||||
if (support_unittests) "-DUNIT_TESTING" else "",
|
|
||||||
if (use_luajit) "" else "-DNVIM_VENDOR_BIT",
|
|
||||||
if (is_windows) "-DMSWIN" else "",
|
|
||||||
if (is_windows) "-DWIN32_LEAN_AND_MEAN" else "",
|
|
||||||
if (is_windows) "-DUTF8PROC_STATIC" else "",
|
|
||||||
};
|
|
||||||
nvim_exe.addCSourceFiles(.{ .files = src_paths, .flags = &flags });
|
|
||||||
|
|
||||||
nvim_exe.addCSourceFiles(.{ .files = &.{
|
|
||||||
"src/xdiff/xdiffi.c",
|
|
||||||
"src/xdiff/xemit.c",
|
|
||||||
"src/xdiff/xhistogram.c",
|
|
||||||
"src/xdiff/xpatience.c",
|
|
||||||
"src/xdiff/xprepare.c",
|
|
||||||
"src/xdiff/xutils.c",
|
|
||||||
"src/cjson/lua_cjson.c",
|
|
||||||
"src/cjson/fpconv.c",
|
|
||||||
"src/cjson/strbuf.c",
|
|
||||||
}, .flags = &flags });
|
|
||||||
|
|
||||||
const nvim_exe_step = b.step("nvim_bin", "only the binary (not a fully working install!)");
|
|
||||||
const nvim_exe_install = b.addInstallArtifact(nvim_exe, .{});
|
|
||||||
|
|
||||||
nvim_exe_step.dependOn(&nvim_exe_install.step);
|
|
||||||
|
|
||||||
const gen_runtime = try runtime.nvim_gen_runtime(b, nlua0, funcs_data);
|
|
||||||
const runtime_install = b.addInstallDirectory(.{ .source_dir = gen_runtime.getDirectory(), .install_dir = .prefix, .install_subdir = "runtime/" });
|
|
||||||
|
|
||||||
const nvim = b.step("nvim", "build the editor");
|
|
||||||
|
|
||||||
nvim.dependOn(&nvim_exe_install.step);
|
|
||||||
nvim.dependOn(&runtime_install.step);
|
|
||||||
|
|
||||||
const lua_dev_deps = b.dependency("lua_dev_deps", .{});
|
|
||||||
|
|
||||||
const test_deps = b.step("test_deps", "test prerequisites");
|
|
||||||
test_deps.dependOn(&nvim_exe_install.step);
|
|
||||||
test_deps.dependOn(&runtime_install.step);
|
|
||||||
|
|
||||||
test_deps.dependOn(test_fixture(b, "shell-test", null, target, optimize));
|
|
||||||
test_deps.dependOn(test_fixture(b, "tty-test", libuv, target, optimize));
|
|
||||||
test_deps.dependOn(test_fixture(b, "pwsh-test", null, target, optimize));
|
|
||||||
test_deps.dependOn(test_fixture(b, "printargs-test", null, target, optimize));
|
|
||||||
test_deps.dependOn(test_fixture(b, "printenv-test", null, target, optimize));
|
|
||||||
test_deps.dependOn(test_fixture(b, "streams-test", libuv, target, optimize));
|
|
||||||
|
|
||||||
const parser_c = b.dependency("treesitter_c", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "c", parser_c.path("."), false, target, optimize));
|
|
||||||
const parser_markdown = b.dependency("treesitter_markdown", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "markdown", parser_markdown.path("tree-sitter-markdown/"), true, target, optimize));
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "markdown_inline", parser_markdown.path("tree-sitter-markdown-inline/"), true, target, optimize));
|
|
||||||
const parser_vim = b.dependency("treesitter_vim", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "vim", parser_vim.path("."), true, target, optimize));
|
|
||||||
const parser_vimdoc = b.dependency("treesitter_vimdoc", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "vimdoc", parser_vimdoc.path("."), false, target, optimize));
|
|
||||||
const parser_lua = b.dependency("treesitter_lua", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "lua", parser_lua.path("."), true, target, optimize));
|
|
||||||
const parser_query = b.dependency("treesitter_query", .{ .target = target, .optimize = optimize });
|
|
||||||
test_deps.dependOn(add_ts_parser(b, "query", parser_query.path("."), false, target, optimize));
|
|
||||||
|
|
||||||
const unit_headers: ?[]const LazyPath = if (support_unittests) &(unittest_include_path ++ .{gen_headers.getDirectory()}) else null;
|
|
||||||
|
|
||||||
try tests.test_steps(b, nvim_exe, test_deps, lua_dev_deps.path("."), test_config_step.getDirectory(), unit_headers);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn test_fixture(
|
|
||||||
b: *std.Build,
|
|
||||||
name: []const u8,
|
|
||||||
libuv: ?*std.Build.Step.Compile,
|
|
||||||
target: std.Build.ResolvedTarget,
|
|
||||||
optimize: std.builtin.OptimizeMode,
|
|
||||||
) *std.Build.Step {
|
|
||||||
const fixture = b.addExecutable(.{
|
|
||||||
.name = name,
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
const source = if (std.mem.eql(u8, name, "pwsh-test")) "shell-test" else name;
|
|
||||||
fixture.addCSourceFile(.{ .file = b.path(b.fmt("./test/functional/fixtures/{s}.c", .{source})) });
|
|
||||||
fixture.linkLibC();
|
|
||||||
if (libuv) |uv| fixture.linkLibrary(uv);
|
|
||||||
return &b.addInstallArtifact(fixture, .{}).step;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn add_ts_parser(
|
|
||||||
b: *std.Build,
|
|
||||||
name: []const u8,
|
|
||||||
parser_dir: LazyPath,
|
|
||||||
scanner: bool,
|
|
||||||
target: std.Build.ResolvedTarget,
|
|
||||||
optimize: std.builtin.OptimizeMode,
|
|
||||||
) *std.Build.Step {
|
|
||||||
const parser = b.addLibrary(.{
|
|
||||||
.name = name,
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
}),
|
|
||||||
.linkage = .dynamic,
|
|
||||||
});
|
|
||||||
parser.addCSourceFile(.{ .file = parser_dir.path(b, "src/parser.c") });
|
|
||||||
if (scanner) parser.addCSourceFile(.{ .file = parser_dir.path(b, "src/scanner.c") });
|
|
||||||
parser.addIncludePath(parser_dir.path(b, "src"));
|
|
||||||
parser.linkLibC();
|
|
||||||
|
|
||||||
const parser_install = b.addInstallArtifact(parser, .{ .dest_sub_path = b.fmt("parser/{s}.so", .{name}) });
|
|
||||||
return &parser_install.step;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn lua_version_info(b: *std.Build) []u8 {
|
|
||||||
const v = version;
|
|
||||||
return b.fmt(
|
|
||||||
\\return {{
|
|
||||||
\\ {{"major", {}}},
|
|
||||||
\\ {{"minor", {}}},
|
|
||||||
\\ {{"patch", {}}},
|
|
||||||
\\ {{"prerelease", {}}},
|
|
||||||
\\ {{"api_level", {}}},
|
|
||||||
\\ {{"api_compatible", {}}},
|
|
||||||
\\ {{"api_prerelease", {}}},
|
|
||||||
\\}}
|
|
||||||
, .{ v.major, v.minor, v.patch, v.prerelease.len > 0, v.api_level, v.api_level_compat, v.api_prerelease });
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn test_config(b: *std.Build) ![]u8 {
|
|
||||||
var buf: [std.fs.max_path_bytes]u8 = undefined;
|
|
||||||
const src_path = try b.build_root.handle.realpath(".", &buf);
|
|
||||||
|
|
||||||
// we don't use test/cmakeconfig/paths.lua.in because it contains cmake specific logic
|
|
||||||
return b.fmt(
|
|
||||||
\\local M = {{}}
|
|
||||||
\\
|
|
||||||
\\M.apple_sysroot = ""
|
|
||||||
\\M.translations_enabled = "$ENABLE_TRANSLATIONS" == "ON"
|
|
||||||
\\M.is_asan = "$ENABLE_ASAN_UBSAN" == "ON"
|
|
||||||
\\M.is_zig_build = true
|
|
||||||
\\M.vterm_test_file = "test/vterm_test_output"
|
|
||||||
\\M.test_build_dir = "{[bin_dir]s}" -- bull
|
|
||||||
\\M.test_source_path = "{[src_path]s}"
|
|
||||||
\\M.test_lua_prg = ""
|
|
||||||
\\M.test_luajit_prg = ""
|
|
||||||
\\ -- include path passed on the cmdline, see test/lua_runner.lua
|
|
||||||
\\M.include_paths = _G.c_include_path or {{}}
|
|
||||||
\\
|
|
||||||
\\return M
|
|
||||||
, .{ .bin_dir = b.install_path, .src_path = src_path });
|
|
||||||
}
|
|
@@ -1,72 +0,0 @@
|
|||||||
.{
|
|
||||||
.name = .neovim,
|
|
||||||
.fingerprint = 0x66eb090879307a38,
|
|
||||||
.version = "0.12.0",
|
|
||||||
.minimum_zig_version = "0.14.0",
|
|
||||||
|
|
||||||
.dependencies = .{
|
|
||||||
.zlua = .{
|
|
||||||
.url = "git+https://github.com/natecraddock/ziglua#6889b2d90ee6ae96810a9f04ec7c62d9aa91d088",
|
|
||||||
.hash = "zlua-0.1.0-hGRpCxctBQDEQgDArJ0Kc4RDIsD-Hw3pw9pPPw_kGmmY",
|
|
||||||
},
|
|
||||||
.lpeg = .{
|
|
||||||
.url = "https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz",
|
|
||||||
.hash = "N-V-__8AAMnaAwCEutreuREG3QayBVEZqUTDQFY1Nsrv2OIt",
|
|
||||||
},
|
|
||||||
.luv = .{
|
|
||||||
.url = "git+https://github.com/luvit/luv?ref=1.51.0-1#4c9fbc6cf6f3338bb0e0426710cf885ee557b540",
|
|
||||||
.hash = "N-V-__8AAMlNDwCY07jUoMiq3iORXdZy0uFWKiHsy8MaDBJA",
|
|
||||||
},
|
|
||||||
.lua_compat53 = .{
|
|
||||||
.url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.13.tar.gz",
|
|
||||||
.hash = "N-V-__8AADi-AwDnVoXwDCQvv2wcYOmN0bJLqZ44J3lwoQY2",
|
|
||||||
},
|
|
||||||
.treesitter = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter/tree-sitter#d87921bb9c39b0b06c811f2082f9a9991cdca027",
|
|
||||||
.hash = "tree_sitter-0.26.0-Tw2sRxO7CwC0NyDrSygSi7UXRHMNUFEF8GRq6dK81lRF",
|
|
||||||
},
|
|
||||||
.libuv = .{
|
|
||||||
.url = "git+https://github.com/allyourcodebase/libuv#a2dfd385bd2a00d6d290fda85a40a55a9d6cffc5",
|
|
||||||
.hash = "libuv-1.51.0-htqqv6liAADxBLIBCZT-qUh_3nRRwtNYsOFQOUmrd_sx",
|
|
||||||
},
|
|
||||||
.utf8proc = .{ .path = "./deps/utf8proc/" },
|
|
||||||
.unibilium = .{ .path = "./deps/unibilium/" },
|
|
||||||
.libiconv = .{
|
|
||||||
.url = "git+https://github.com/allyourcodebase/libiconv#9def4c8a1743380e85bcedb80f2c15b455e236f3",
|
|
||||||
.hash = "libiconv-1.18.0-p9sJwWnqAACzVYeWgXB5r5lOQ74XwTPlptixV0JPRO28",
|
|
||||||
.lazy = true,
|
|
||||||
},
|
|
||||||
.lua_dev_deps = .{
|
|
||||||
.url = "https://github.com/neovim/deps/raw/06ef2b58b0876f8de1a3f5a710473dcd7afff251/opt/lua-dev-deps.tar.gz",
|
|
||||||
.hash = "N-V-__8AAGevEQCHAkCozca5AIdN9DFc3Luf3g3r2AcbyOrm",
|
|
||||||
},
|
|
||||||
.treesitter_c = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter/tree-sitter-c?ref=v0.24.1#7fa1be1b694b6e763686793d97da01f36a0e5c12",
|
|
||||||
.hash = "N-V-__8AANxPSABzw3WBTSH_YkwaGAfrK6PBqAMqQedkDDim",
|
|
||||||
},
|
|
||||||
.treesitter_markdown = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-markdown?ref=v0.5.0#afaa4138517363362f54c89330c9d79391e81168",
|
|
||||||
.hash = "N-V-__8AAIIZUwD3CGdyI2DiHu7Suj2jIF_EAVlM6REFGwju",
|
|
||||||
},
|
|
||||||
.treesitter_lua = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-lua?ref=v0.4.0#4569d1c361129e71a205b94a05e158bd71b1709f",
|
|
||||||
.hash = "N-V-__8AAEF5CABqSL9zqc03aQsT6Nni54ZCcL98pnuDL2D3",
|
|
||||||
},
|
|
||||||
.treesitter_vim = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-vim?ref=v0.7.0#3dd4747082d1b717b8978211c06ef7b6cd16125b",
|
|
||||||
.hash = "N-V-__8AAMArVAB4uo2wg2XRs8HBviQ4Pq366cC_iRolX4Vc",
|
|
||||||
},
|
|
||||||
.treesitter_vimdoc = .{
|
|
||||||
.url = "git+https://github.com/neovim/tree-sitter-vimdoc?ref=v4.0.0#9f6191a98702edc1084245abd5523279d4b681fb",
|
|
||||||
.hash = "N-V-__8AAI4YCgD7OqxCEAmz2RqT_ohl6eA4F0fGMtLIe7nb",
|
|
||||||
},
|
|
||||||
.treesitter_query = .{
|
|
||||||
.url = "git+https://github.com/tree-sitter-grammars/tree-sitter-query?ref=v0.6.2#8a43889f89fd0667289936341bff3a77bafade17",
|
|
||||||
.hash = "N-V-__8AAARLBACBLGiXGFTijEzLv8AwiqT_kJpmVjir1BgX",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
.paths = .{
|
|
||||||
// TODO(bfredl): explicitly list the subdirs which actually are used
|
|
||||||
"",
|
|
||||||
},
|
|
||||||
}
|
|
@@ -173,7 +173,9 @@ function(append_target_expression)
|
|||||||
${ARGN})
|
${ARGN})
|
||||||
|
|
||||||
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
|
set(TARGET_EXPRESSION "$<TARGET_PROPERTY:nvim_bin,${ARG_PROPERTY}>")
|
||||||
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.15)
|
||||||
|
set(TARGET_EXPRESSION "$<REMOVE_DUPLICATES:${TARGET_EXPRESSION}>")
|
||||||
|
endif()
|
||||||
set(TARGET_EXPRESSION "${ARG_PREFIX}$<JOIN:${TARGET_EXPRESSION}, ${ARG_PREFIX}>")
|
set(TARGET_EXPRESSION "${ARG_PREFIX}$<JOIN:${TARGET_EXPRESSION}, ${ARG_PREFIX}>")
|
||||||
|
|
||||||
set(VERSION_STRING "${VERSION_STRING} ${TARGET_EXPRESSION} " PARENT_SCOPE)
|
set(VERSION_STRING "${VERSION_STRING} ${TARGET_EXPRESSION} " PARENT_SCOPE)
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#cmakedefine HAVE_WORKING_LIBINTL
|
#cmakedefine HAVE_WORKING_LIBINTL
|
||||||
#cmakedefine UNIX
|
#cmakedefine UNIX
|
||||||
#cmakedefine CASE_INSENSITIVE_FILENAME
|
#cmakedefine CASE_INSENSITIVE_FILENAME
|
||||||
|
#cmakedefine USE_FNAME_CASE
|
||||||
#cmakedefine HAVE_SYS_UIO_H
|
#cmakedefine HAVE_SYS_UIO_H
|
||||||
#ifdef HAVE_SYS_UIO_H
|
#ifdef HAVE_SYS_UIO_H
|
||||||
#cmakedefine HAVE_READV
|
#cmakedefine HAVE_READV
|
||||||
@@ -52,5 +53,3 @@
|
|||||||
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
||||||
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
||||||
#cmakedefine HAVE_BITSCANFORWARD64
|
#cmakedefine HAVE_BITSCANFORWARD64
|
||||||
|
|
||||||
#define VTERM_TEST_FILE "@VTERM_TEST_FILE@"
|
|
||||||
|
@@ -12,10 +12,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
|
#define NVIM_VERSION_CFLAGS "${VERSION_STRING}"
|
||||||
#ifdef ZIG_BUILD
|
#define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
|
||||||
# define NVIM_VERSION_BUILD_TYPE "${CONFIG}"
|
|
||||||
#else
|
|
||||||
# define NVIM_VERSION_BUILD_TYPE "$<CONFIG>"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // AUTO_VERSIONDEF_H
|
#endif // AUTO_VERSIONDEF_H
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
# This is not meant to be included by the top-level.
|
# This is not meant to be included by the top-level.
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required (VERSION 3.13)
|
||||||
project(NVIM_DEPS C)
|
project(NVIM_DEPS C)
|
||||||
|
|
||||||
if(POLICY CMP0135)
|
if(POLICY CMP0135)
|
||||||
@@ -27,16 +27,16 @@ set(DEPS_IGNORE_SHA FALSE)
|
|||||||
option(USE_BUNDLED "Use bundled dependencies." ON)
|
option(USE_BUNDLED "Use bundled dependencies." ON)
|
||||||
|
|
||||||
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
|
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_LIBVTERM "Use the bundled libvterm." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
|
option(USE_BUNDLED_LPEG "Use the bundled lpeg." ${USE_BUNDLED})
|
||||||
# PUC Lua is only used for tests, unless explicitly requested.
|
# PUC Lua is only used for tests, unless explicitly requested.
|
||||||
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
|
option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF)
|
||||||
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
|
option(USE_BUNDLED_LUAJIT "Use the bundled version of luajit." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
|
option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED})
|
||||||
|
option(USE_BUNDLED_MSGPACK "Use the bundled msgpack." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
|
option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
|
option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
|
option(USE_BUNDLED_UNIBILIUM "Use the bundled unibilium." ${USE_BUNDLED})
|
||||||
option(USE_BUNDLED_UTF8PROC "Use the bundled utf8proc library." ${USE_BUNDLED})
|
|
||||||
|
|
||||||
if(USE_BUNDLED AND MSVC)
|
if(USE_BUNDLED AND MSVC)
|
||||||
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON)
|
||||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." ON)
|
||||||
@@ -45,19 +45,6 @@ else()
|
|||||||
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
|
option(USE_BUNDLED_LIBICONV "Use the bundled version of libiconv." OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option(ENABLE_WASMTIME "Use treesitter with wasmtime support." OFF)
|
|
||||||
if(ENABLE_WASMTIME)
|
|
||||||
if(USE_BUNDLED)
|
|
||||||
option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." ON)
|
|
||||||
else()
|
|
||||||
option(USE_BUNDLED_WASMTIME "Use the bundled wasmtime." OFF)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(NOT ENABLE_WASMTIME AND USE_BUNDLED_WASMTIME)
|
|
||||||
message(FATAL_ERROR "ENABLE_WASMTIME is set to OFF while USE_BUNDLED_WASMTIME is set to ON.\
|
|
||||||
You need set ENABLE_WASMTIME to ON if you want to use wasmtime.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
option(USE_EXISTING_SRC_DIR "Skip download of deps sources in case of existing source directory." OFF)
|
||||||
|
|
||||||
set_default_buildtype(Release)
|
set_default_buildtype(Release)
|
||||||
@@ -73,7 +60,7 @@ if(HAS_OG_FLAG)
|
|||||||
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
set(DEFAULT_MAKE_CFLAGS CFLAGS+=-Og ${DEFAULT_MAKE_CFLAGS})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(DEPS_INCLUDE_FLAGS "-I\"${DEPS_INSTALL_DIR}/include\" -I\"${DEPS_INSTALL_DIR}/include/luajit-2.1\"")
|
set(DEPS_INCLUDE_FLAGS "-I${DEPS_INSTALL_DIR}/include -I${DEPS_INSTALL_DIR}/include/luajit-2.1")
|
||||||
|
|
||||||
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
# If the macOS deployment target is not set manually (via $MACOSX_DEPLOYMENT_TARGET),
|
||||||
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
|
# fall back to local system version. Needs to be done here and in top-level CMakeLists.txt.
|
||||||
@@ -96,10 +83,10 @@ else()
|
|||||||
find_package(Lua 5.1 EXACT)
|
find_package(Lua 5.1 EXACT)
|
||||||
if(LUAJIT_FOUND)
|
if(LUAJIT_FOUND)
|
||||||
set(LUA_ENGINE LuaJit)
|
set(LUA_ENGINE LuaJit)
|
||||||
string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUAJIT_INCLUDE_DIR}\"")
|
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUAJIT_INCLUDE_DIR}")
|
||||||
elseif(LUA_FOUND)
|
elseif(LUA_FOUND)
|
||||||
set(LUA_ENGINE Lua)
|
set(LUA_ENGINE Lua)
|
||||||
string(APPEND DEPS_INCLUDE_FLAGS " -I\"${LUA_INCLUDE_DIR}\"")
|
string(APPEND DEPS_INCLUDE_FLAGS " -I${LUA_INCLUDE_DIR}")
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Could not find system lua or luajit")
|
message(FATAL_ERROR "Could not find system lua or luajit")
|
||||||
endif()
|
endif()
|
||||||
@@ -109,10 +96,18 @@ if(USE_BUNDLED_UNIBILIUM)
|
|||||||
include(BuildUnibilium)
|
include(BuildUnibilium)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_BUNDLED_LIBVTERM)
|
||||||
|
include(BuildLibvterm)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LIBUV)
|
if(USE_BUNDLED_LIBUV)
|
||||||
include(BuildLibuv)
|
include(BuildLibuv)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(USE_BUNDLED_MSGPACK)
|
||||||
|
include(BuildMsgpack)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_LUAJIT)
|
if(USE_BUNDLED_LUAJIT)
|
||||||
include(BuildLuajit)
|
include(BuildLuajit)
|
||||||
endif()
|
endif()
|
||||||
@@ -141,21 +136,15 @@ if(USE_BUNDLED_TS_PARSERS)
|
|||||||
include(BuildTreesitterParsers)
|
include(BuildTreesitterParsers)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_WASMTIME)
|
|
||||||
include(BuildWasmtime)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_BUNDLED_TS)
|
if(USE_BUNDLED_TS)
|
||||||
include(BuildTreesitter)
|
include(BuildTreesitter)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_BUNDLED_UTF8PROC)
|
|
||||||
include(BuildUTF8proc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
include(GetBinaryDeps)
|
include(GetBinaryDeps)
|
||||||
|
|
||||||
|
GetExecutable(TARGET cat)
|
||||||
|
GetExecutable(TARGET tee)
|
||||||
GetExecutable(TARGET xxd)
|
GetExecutable(TARGET xxd)
|
||||||
|
|
||||||
GetBinaryDep(TARGET win32yank_X86_64
|
GetBinaryDep(TARGET win32yank_X86_64
|
||||||
|
@@ -16,9 +16,8 @@
|
|||||||
"description": "Build neovim with external deps on ubuntu",
|
"description": "Build neovim with external deps on ubuntu",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"USE_BUNDLED":"OFF",
|
"USE_BUNDLED":"OFF",
|
||||||
"USE_BUNDLED_TS":"ON",
|
"USE_BUNDLED_LIBVTERM":"ON",
|
||||||
"USE_BUNDLED_UTF8PROC":"ON",
|
"USE_BUNDLED_TS":"ON"
|
||||||
"ENABLE_WASMTIME":"OFF"
|
|
||||||
},
|
},
|
||||||
"inherits": ["base"]
|
"inherits": ["base"]
|
||||||
}
|
}
|
||||||
|
8
cmake.deps/cmake/BuildLibvterm.cmake
Normal file
8
cmake.deps/cmake/BuildLibvterm.cmake
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
get_externalproject_options(libvterm ${DEPS_IGNORE_SHA})
|
||||||
|
ExternalProject_Add(libvterm
|
||||||
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/libvterm
|
||||||
|
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LibvtermCMakeLists.txt
|
||||||
|
${DEPS_BUILD_DIR}/src/libvterm/CMakeLists.txt
|
||||||
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||||
|
${EXTERNALPROJECT_OPTIONS})
|
@@ -42,7 +42,7 @@ if(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
BuildLuajit(INSTALL_COMMAND ${BUILDCMD_UNIX}
|
BuildLuaJit(INSTALL_COMMAND ${BUILDCMD_UNIX}
|
||||||
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
|
CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR}
|
||||||
${DEPLOYMENT_TARGET} install)
|
${DEPLOYMENT_TARGET} install)
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ elseif(MINGW)
|
|||||||
else()
|
else()
|
||||||
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
|
set(LUAJIT_MAKE_PRG ${CMAKE_MAKE_PROGRAM})
|
||||||
endif()
|
endif()
|
||||||
BuildLuajit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
|
BuildLuaJit(BUILD_COMMAND ${LUAJIT_MAKE_PRG} CC=${DEPS_C_COMPILER}
|
||||||
PREFIX=${DEPS_INSTALL_DIR}
|
PREFIX=${DEPS_INSTALL_DIR}
|
||||||
CFLAGS+=-DLUA_USE_APICHECK
|
CFLAGS+=-DLUA_USE_APICHECK
|
||||||
CFLAGS+=-funwind-tables
|
CFLAGS+=-funwind-tables
|
||||||
@@ -75,7 +75,7 @@ elseif(MINGW)
|
|||||||
)
|
)
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
|
|
||||||
BuildLuajit(
|
BuildLuaJit(
|
||||||
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
|
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir ${DEPS_BUILD_DIR}/src/luajit/src ${DEPS_BUILD_DIR}/src/luajit/src/msvcbuild.bat
|
||||||
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_BIN_DIR}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
|
COMMAND ${CMAKE_COMMAND} -E copy ${DEPS_BUILD_DIR}/src/luajit/src/luajit.exe ${DEPS_BIN_DIR}
|
||||||
|
7
cmake.deps/cmake/BuildMsgpack.cmake
Normal file
7
cmake.deps/cmake/BuildMsgpack.cmake
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
get_externalproject_options(msgpack ${DEPS_IGNORE_SHA})
|
||||||
|
ExternalProject_Add(msgpack
|
||||||
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/msgpack
|
||||||
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||||
|
-D MSGPACK_BUILD_TESTS=OFF
|
||||||
|
-D MSGPACK_BUILD_EXAMPLES=OFF
|
||||||
|
${EXTERNALPROJECT_OPTIONS})
|
@@ -1,14 +1,8 @@
|
|||||||
if(ENABLE_WASMTIME)
|
|
||||||
set(TREESITTER_ARGS -D TREE_SITTER_FEATURE_WASM=ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_externalproject_options(treesitter ${DEPS_IGNORE_SHA})
|
get_externalproject_options(treesitter ${DEPS_IGNORE_SHA})
|
||||||
ExternalProject_Add(treesitter
|
ExternalProject_Add(treesitter
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
|
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
|
||||||
SOURCE_SUBDIR lib
|
PATCH_COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${TREESITTER_ARGS}
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
|
||||||
|
${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
|
||||||
|
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
${EXTERNALPROJECT_OPTIONS})
|
||||||
|
|
||||||
if(USE_BUNDLED_WASMTIME)
|
|
||||||
add_dependencies(treesitter wasmtime)
|
|
||||||
endif()
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
get_externalproject_options(utf8proc ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(utf8proc
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/utf8proc
|
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
@@ -1,12 +0,0 @@
|
|||||||
# wasmtime is a chungus -- optimize _extra hard_ to keep nvim svelte
|
|
||||||
get_externalproject_options(wasmtime ${DEPS_IGNORE_SHA})
|
|
||||||
ExternalProject_Add(wasmtime
|
|
||||||
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/wasmtime
|
|
||||||
SOURCE_SUBDIR crates/c-api
|
|
||||||
CMAKE_ARGS ${DEPS_CMAKE_ARGS}
|
|
||||||
-D WASMTIME_FASTEST_RUNTIME=ON # build with full LTO
|
|
||||||
-D WASMTIME_DISABLE_ALL_FEATURES=ON # don't need all that crap...
|
|
||||||
-D WASMTIME_FEATURE_CRANELIFT=ON # ...except this one (compiles wasm to platform code)
|
|
||||||
-D WASMTIME_FEATURE_GC_DRC=ON # ...and this one (needed by ts to create engines)
|
|
||||||
USES_TERMINAL_BUILD TRUE
|
|
||||||
${EXTERNALPROJECT_OPTIONS})
|
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(gettext C)
|
project(gettext C)
|
||||||
|
|
||||||
add_compile_options(-w)
|
add_compile_options(-w)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(libiconv C)
|
project(libiconv C)
|
||||||
|
|
||||||
add_compile_options(-w)
|
add_compile_options(-w)
|
||||||
|
28
cmake.deps/cmake/LibvtermCMakeLists.txt
Normal file
28
cmake.deps/cmake/LibvtermCMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(libvterm C)
|
||||||
|
|
||||||
|
add_compile_options(-w)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
include_directories(${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
file(GLOB VTERM_SOURCES ${CMAKE_SOURCE_DIR}/src/*.c)
|
||||||
|
add_library(vterm ${VTERM_SOURCES})
|
||||||
|
install(TARGETS vterm ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
|
install(FILES include/vterm.h include/vterm_keycodes.h
|
||||||
|
DESTINATION include)
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
file(GLOB BIN_SOURCES ${CMAKE_SOURCE_DIR}/bin/*.c)
|
||||||
|
foreach(EXE_C ${BIN_SOURCES})
|
||||||
|
get_filename_component(target_name ${EXE_C} NAME_WE)
|
||||||
|
add_executable(${target_name} ${EXE_C})
|
||||||
|
target_link_libraries(${target_name} vterm)
|
||||||
|
install(TARGETS ${target_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# vim: set ft=cmake:
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project (lpeg C)
|
project (lpeg C)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(${PARSERLANG} C)
|
project(${PARSERLANG} C)
|
||||||
|
|
||||||
add_compile_options(-w)
|
add_compile_options(-w)
|
||||||
|
17
cmake.deps/cmake/TreesitterCMakeLists.txt
Normal file
17
cmake.deps/cmake/TreesitterCMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
project(treesitter C)
|
||||||
|
|
||||||
|
add_compile_options(-w)
|
||||||
|
|
||||||
|
add_library(tree-sitter lib/src/lib.c)
|
||||||
|
target_include_directories(tree-sitter
|
||||||
|
PRIVATE lib/src lib/include)
|
||||||
|
|
||||||
|
install(FILES
|
||||||
|
lib/include/tree_sitter/api.h
|
||||||
|
DESTINATION include/tree_sitter)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
install(TARGETS tree-sitter DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
|
# vim: set ft=cmake:
|
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
project(parser C)
|
project(parser C)
|
||||||
|
|
||||||
add_compile_options(-w)
|
add_compile_options(-w)
|
||||||
|
@@ -1,17 +1,23 @@
|
|||||||
LIBUV_URL https://github.com/libuv/libuv/archive/v1.51.0.tar.gz
|
LIBUV_URL https://github.com/libuv/libuv/archive/v1.48.0.tar.gz
|
||||||
LIBUV_SHA256 27e55cf7083913bfb6826ca78cde9de7647cded648d35f24163f2d31bb9f51cd
|
LIBUV_SHA256 8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33
|
||||||
|
|
||||||
LUAJIT_URL https://github.com/luajit/luajit/archive/871db2c84ecefd70a850e03a6c340214a81739f0.tar.gz
|
MSGPACK_URL https://github.com/msgpack/msgpack-c/archive/c-6.0.1.tar.gz
|
||||||
LUAJIT_SHA256 ab3f16d82df6946543565cfb0d2810d387d79a3a43e0431695b03466188e2680
|
MSGPACK_SHA256 58d5fe49d0ee2b374d60a61aabf8028b2c92004e6f11bff04e74b639fc8ad541
|
||||||
|
|
||||||
|
LUAJIT_URL https://github.com/LuaJIT/LuaJIT/archive/75e92777988017fe47c5eb290998021bbf972d1f.tar.gz
|
||||||
|
LUAJIT_SHA256 0f69288190024d732c67645e40ed5b137d67aa950fedf0f44a9ad0f3dba6d5d2
|
||||||
|
|
||||||
LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz
|
LUA_URL https://www.lua.org/ftp/lua-5.1.5.tar.gz
|
||||||
LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
|
LUA_SHA256 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
|
||||||
|
|
||||||
UNIBILIUM_URL https://github.com/neovim/unibilium/archive/v2.1.2.tar.gz
|
UNIBILIUM_URL https://github.com/neovim/unibilium/archive/d72c3598e7ac5d1ebf86ee268b8b4ed95c0fa628.tar.gz
|
||||||
UNIBILIUM_SHA256 370ecb07fbbc20d91d1b350c55f1c806b06bf86797e164081ccc977fc9b3af7a
|
UNIBILIUM_SHA256 9c4747c862ab5e3076dcf8fa8f0ea7a6b50f20ec5905618b9536655596797487
|
||||||
|
|
||||||
LUV_URL https://github.com/luvit/luv/archive/1.51.0-1.tar.gz
|
LIBVTERM_URL https://github.com/neovim/libvterm/archive/0a15c6e983b0db7ef8276e0792414a805d01bdaf.tar.gz
|
||||||
LUV_SHA256 d4a11178ae8e16ba5886799ea91905dd9b0b479c75aebd67866d37373e41526f
|
LIBVTERM_SHA256 c4683e7a2d71c04781fd0ab7719a94202800e97a9e091514c16983bb732b0fa7
|
||||||
|
|
||||||
|
LUV_URL https://github.com/luvit/luv/releases/download/1.48.0-2/luv-1.48.0-2.tar.gz
|
||||||
|
LUV_SHA256 2c3a1ddfebb4f6550293a40ee789f7122e97647eede51511f57203de48c03b7a
|
||||||
|
|
||||||
LPEG_URL https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz
|
LPEG_URL https://github.com/neovim/deps/raw/d495ee6f79e7962a53ad79670cb92488abe0b9b4/opt/lpeg-1.1.0.tar.gz
|
||||||
LPEG_SHA256 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
|
LPEG_SHA256 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
|
||||||
@@ -19,6 +25,10 @@ LPEG_SHA256 4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a
|
|||||||
LUA_COMPAT53_URL https://github.com/lunarmodules/lua-compat-5.3/archive/v0.13.tar.gz
|
LUA_COMPAT53_URL https://github.com/lunarmodules/lua-compat-5.3/archive/v0.13.tar.gz
|
||||||
LUA_COMPAT53_SHA256 f5dc30e7b1fda856ee4d392be457642c1f0c259264a9b9bfbcb680302ce88fc2
|
LUA_COMPAT53_SHA256 f5dc30e7b1fda856ee4d392be457642c1f0c259264a9b9bfbcb680302ce88fc2
|
||||||
|
|
||||||
|
CAT_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/cat.exe
|
||||||
|
CAT_SHA256 93b8d307bb15af3968920bdea3beb869a49d166f9164853c58a4e6ffdcae61c6
|
||||||
|
TEE_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/tee.exe
|
||||||
|
TEE_SHA256 950eea4e17fa3a7e89fa2c55374037b5797b3f1a54fea1304634884ab42ec14d
|
||||||
XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe
|
XXD_URL https://github.com/neovim/deps/raw/21c5e8bdda33521a6ed497b315e03265a2785cbc/opt/xxd.exe
|
||||||
XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c
|
XXD_SHA256 7a581e3882d28161cc52850f9a11d634b3eaf2c029276f093c1ed4c90e45a10c
|
||||||
|
|
||||||
@@ -31,28 +41,22 @@ GETTEXT_SHA256 66415634c6e8c3fa8b71362879ec7575e27da43da562c798a8a2f223e6e47f5c
|
|||||||
LIBICONV_URL https://github.com/neovim/deps/raw/b9bf36eb31f27e8136d907da38fa23518927737e/opt/libiconv-1.17.tar.gz
|
LIBICONV_URL https://github.com/neovim/deps/raw/b9bf36eb31f27e8136d907da38fa23518927737e/opt/libiconv-1.17.tar.gz
|
||||||
LIBICONV_SHA256 8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
|
LIBICONV_SHA256 8f74213b56238c85a50a5329f77e06198771e70dd9a739779f4c02f65d971313
|
||||||
|
|
||||||
UTF8PROC_URL https://github.com/JuliaStrings/utf8proc/archive/v2.10.0.tar.gz
|
TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.21.3.tar.gz
|
||||||
UTF8PROC_SHA256 6f4f1b639daa6dca9f80bc5db1233e9cbaa31a67790887106160b33ef743f136
|
TREESITTER_C_SHA256 75a3780df6114cd37496761c4a7c9fd900c78bee3a2707f590d78c0ca3a24368
|
||||||
|
TREESITTER_LUA_URL https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/v0.1.0.tar.gz
|
||||||
|
TREESITTER_LUA_SHA256 230cfcbfa74ed1f7b8149e9a1f34c2efc4c589a71fe0f5dc8560622f8020d722
|
||||||
|
TREESITTER_VIM_URL https://github.com/neovim/tree-sitter-vim/archive/v0.4.0.tar.gz
|
||||||
|
TREESITTER_VIM_SHA256 9f856f8b4a10ab43348550fa2d3cb2846ae3d8e60f45887200549c051c66f9d5
|
||||||
|
TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v3.0.0.tar.gz
|
||||||
|
TREESITTER_VIMDOC_SHA256 a639bf92bf57bfa1cdc90ca16af27bfaf26a9779064776dd4be34c1ef1453f6c
|
||||||
|
TREESITTER_QUERY_URL https://github.com/tree-sitter-grammars/tree-sitter-query/archive/v0.4.0.tar.gz
|
||||||
|
TREESITTER_QUERY_SHA256 d3a423ab66dc62b2969625e280116678a8a22582b5ff087795222108db2f6a6e
|
||||||
|
TREESITTER_MARKDOWN_URL https://github.com/MDeiml/tree-sitter-markdown/archive/v0.2.3.tar.gz
|
||||||
|
TREESITTER_MARKDOWN_SHA256 4909d6023643f1afc3ab219585d4035b7403f3a17849782ab803c5f73c8a31d5
|
||||||
|
TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.22.6.tar.gz
|
||||||
|
TREESITTER_SHA256 e2b687f74358ab6404730b7fb1a1ced7ddb3780202d37595ecd7b20a8f41861f
|
||||||
|
|
||||||
TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/v0.24.1.tar.gz
|
UNCRUSTIFY_URL https://github.com/uncrustify/uncrustify/archive/uncrustify-0.79.0.tar.gz
|
||||||
TREESITTER_C_SHA256 25dd4bb3dec770769a407e0fc803f424ce02c494a56ce95fedc525316dcf9b48
|
UNCRUSTIFY_SHA256 e7afaeabf636b7f0ce4e3e9747b95f7bd939613a8db49579755dddf44fedca5f
|
||||||
TREESITTER_LUA_URL https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/v0.4.0.tar.gz
|
LUA_DEV_DEPS_URL https://github.com/neovim/deps/raw/5a1f71cceb24990a0b15fd9a472a5f549f019248/opt/lua-dev-deps.tar.gz
|
||||||
TREESITTER_LUA_SHA256 b0977aced4a63bb75f26725787e047b8f5f4a092712c840ea7070765d4049559
|
LUA_DEV_DEPS_SHA256 27db2495f5eddc7fc191701ec9b291486853530c6125609d3197d03481e8d5a2
|
||||||
TREESITTER_VIM_URL https://github.com/tree-sitter-grammars/tree-sitter-vim/archive/v0.7.0.tar.gz
|
|
||||||
TREESITTER_VIM_SHA256 44eabc31127c4feacda19f2a05a5788272128ff561ce01093a8b7a53aadcc7b2
|
|
||||||
TREESITTER_VIMDOC_URL https://github.com/neovim/tree-sitter-vimdoc/archive/v4.0.0.tar.gz
|
|
||||||
TREESITTER_VIMDOC_SHA256 8096794c0f090b2d74b7bff94548ac1be3285b929ec74f839bd9b3ff4f4c6a0b
|
|
||||||
TREESITTER_QUERY_URL https://github.com/tree-sitter-grammars/tree-sitter-query/archive/v0.6.2.tar.gz
|
|
||||||
TREESITTER_QUERY_SHA256 90682e128d048fbf2a2a17edca947db71e326fa0b3dba4136e041e096538b4eb
|
|
||||||
TREESITTER_MARKDOWN_URL https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/v0.5.0.tar.gz
|
|
||||||
TREESITTER_MARKDOWN_SHA256 14c2c948ccf0e9b606eec39b09286c59dddf28307849f71b7ce2b1d1ef06937e
|
|
||||||
TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/v0.25.8.tar.gz
|
|
||||||
TREESITTER_SHA256 178b575244d967f4920a4642408dc4edf6de96948d37d7f06e5b78acee9c0b4e
|
|
||||||
|
|
||||||
WASMTIME_URL https://github.com/bytecodealliance/wasmtime/archive/v29.0.1.tar.gz
|
|
||||||
WASMTIME_SHA256 b94b6c6fd6aebaf05d4c69c1b12b5dc217b0d42c1a95f435b33af63dddfa5304
|
|
||||||
|
|
||||||
UNCRUSTIFY_URL https://github.com/uncrustify/uncrustify/archive/uncrustify-0.81.0.tar.gz
|
|
||||||
UNCRUSTIFY_SHA256 484623dc16b92206adc6ac0770077c6c67c6e441102148c2a121a19549330ff9
|
|
||||||
LUA_DEV_DEPS_URL https://github.com/neovim/deps/raw/06ef2b58b0876f8de1a3f5a710473dcd7afff251/opt/lua-dev-deps.tar.gz
|
|
||||||
LUA_DEV_DEPS_SHA256 49f8399e453103064a23c65534f266f3067cda716b6502f016bfafeed5799354
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|ARM64|aarch64)$")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||||
set(CMAKE_SYSTEM_PROCESSOR arm64)
|
set(CMAKE_SYSTEM_PROCESSOR arm64)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -27,13 +27,9 @@ set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
|||||||
|
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win-arm64")
|
|
||||||
else()
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CPACK_GENERATOR ZIP WIX)
|
set(CPACK_GENERATOR ZIP WIX)
|
||||||
|
|
||||||
# WIX
|
# WIX
|
||||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
||||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
||||||
@@ -48,10 +44,6 @@ if(WIN32)
|
|||||||
set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim")
|
set(CPACK_PACKAGE_EXECUTABLES "nvim" "Neovim")
|
||||||
set(CPACK_WIX_INSTALL_SCOPE "perMachine")
|
set(CPACK_WIX_INSTALL_SCOPE "perMachine")
|
||||||
|
|
||||||
set(CPACK_WIX_UI_REF "WixUI_CustomInstallDir")
|
|
||||||
list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/WixUI_CustomInstallDir.wxs)
|
|
||||||
list(APPEND CPACK_WIX_EXTRA_SOURCES ${CMAKE_CURRENT_LIST_DIR}/CustomInstallDirDlg.wxs)
|
|
||||||
|
|
||||||
# We use a wix patch to add further options to the installer.
|
# We use a wix patch to add further options to the installer.
|
||||||
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
||||||
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
||||||
|
@@ -1,41 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
|
|
||||||
|
|
||||||
|
|
||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
|
||||||
<Fragment>
|
|
||||||
<UI>
|
|
||||||
<Dialog Id="CustomInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
|
|
||||||
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
|
|
||||||
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
|
|
||||||
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
|
|
||||||
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
|
|
||||||
</Control>
|
|
||||||
|
|
||||||
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
|
|
||||||
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgTitle)" />
|
|
||||||
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
|
|
||||||
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
|
|
||||||
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
|
|
||||||
|
|
||||||
<Control Id="Note" Type="Text" X="20" Y="45" Width="290" Height="45" NoPrefix="yes">
|
|
||||||
<Text>Note: besides its installation folder, [ProductName] stores configuration, data, and logs in standard locations. These can be further configured by the $NVIM_APPNAME environment variable. Also, the "base" (root) directories conform to the XDG Base Directory Specification. For more information see:</Text>
|
|
||||||
</Control>
|
|
||||||
<Control Id="Link1" Type="Hyperlink" X="20" Y="90" Width="290" Height="15">
|
|
||||||
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#standard-path">https://neovim.io/doc/user/starting.html#standard-path</a>]]></Text>
|
|
||||||
</Control>
|
|
||||||
<Control Id="Link2" Type="Hyperlink" X="20" Y="105" Width="290" Height="15">
|
|
||||||
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#base-directories">https://neovim.io/doc/user/starting.html#base-directories</a>]]></Text>
|
|
||||||
</Control>
|
|
||||||
<Control Id="Link3" Type="Hyperlink" X="20" Y="120" Width="290" Height="15">
|
|
||||||
<Text><![CDATA[<a href="https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME">https://neovim.io/doc/user/starting.html#$NVIM_APPNAME</a>]]></Text>
|
|
||||||
</Control>
|
|
||||||
<Control Id="FolderLabel" Type="Hyperlink" X="20" Y="135" Width="290" Height="15">
|
|
||||||
<Text>Install [ProductName] to:</Text>
|
|
||||||
</Control>
|
|
||||||
<Control Id="Folder" Type="PathEdit" X="20" Y="150" Width="320" Height="18" Property="WIXUI_INSTALLDIR" Indirect="yes" />
|
|
||||||
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="180" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
|
|
||||||
</Dialog>
|
|
||||||
</UI>
|
|
||||||
</Fragment>
|
|
||||||
</Wix>
|
|
@@ -1,81 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
First-time install dialog sequence:
|
|
||||||
- WixUI_WelcomeDlg
|
|
||||||
- WixUI_LicenseAgreementDlg
|
|
||||||
- WixUI_InstallDirDlg
|
|
||||||
- WixUI_VerifyReadyDlg
|
|
||||||
- WixUI_DiskCostDlg
|
|
||||||
|
|
||||||
Maintenance dialog sequence:
|
|
||||||
- WixUI_MaintenanceWelcomeDlg
|
|
||||||
- WixUI_MaintenanceTypeDlg
|
|
||||||
- WixUI_InstallDirDlg
|
|
||||||
- WixUI_VerifyReadyDlg
|
|
||||||
|
|
||||||
Patch dialog sequence:
|
|
||||||
- WixUI_WelcomeDlg
|
|
||||||
- WixUI_VerifyReadyDlg
|
|
||||||
|
|
||||||
-->
|
|
||||||
|
|
||||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
|
||||||
<Fragment>
|
|
||||||
<UI Id="WixUI_CustomInstallDir">
|
|
||||||
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
|
|
||||||
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
|
|
||||||
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
|
|
||||||
|
|
||||||
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
|
|
||||||
<Property Id="WixUI_Mode" Value="InstallDir" />
|
|
||||||
|
|
||||||
<DialogRef Id="BrowseDlg" />
|
|
||||||
<DialogRef Id="DiskCostDlg" />
|
|
||||||
<DialogRef Id="ErrorDlg" />
|
|
||||||
<DialogRef Id="FatalError" />
|
|
||||||
<DialogRef Id="FilesInUse" />
|
|
||||||
<DialogRef Id="MsiRMFilesInUse" />
|
|
||||||
<DialogRef Id="PrepareDlg" />
|
|
||||||
<DialogRef Id="ProgressDlg" />
|
|
||||||
<DialogRef Id="ResumeDlg" />
|
|
||||||
<DialogRef Id="UserExit" />
|
|
||||||
|
|
||||||
<Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
|
|
||||||
<Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish>
|
|
||||||
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
|
|
||||||
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomInstallDirDlg">LicenseAccepted = "1"</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
|
|
||||||
<Publish Dialog="CustomInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomInstallDirDlg" Order="1">NOT Installed</Publish>
|
|
||||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
|
|
||||||
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
|
|
||||||
|
|
||||||
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
|
|
||||||
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
|
|
||||||
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
|
|
||||||
|
|
||||||
<Property Id="ARPNOMODIFY" Value="1" />
|
|
||||||
</UI>
|
|
||||||
|
|
||||||
<UIRef Id="WixUI_Common" />
|
|
||||||
</Fragment>
|
|
||||||
</Wix>
|
|
@@ -18,8 +18,12 @@ if(APPLE)
|
|||||||
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK})
|
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_FIND_FRAMEWORK=${CMAKE_FIND_FRAMEWORK})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Can be removed once minimum version is at least 3.15
|
||||||
|
if(POLICY CMP0092)
|
||||||
|
list(APPEND DEPS_CMAKE_ARGS -D CMAKE_POLICY_DEFAULT_CMP0092=NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_program(CACHE_PRG NAMES ccache sccache)
|
find_program(CACHE_PRG NAMES ccache sccache)
|
||||||
mark_as_advanced(CACHE_PRG)
|
|
||||||
if(CACHE_PRG)
|
if(CACHE_PRG)
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
|
set(CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E env CCACHE_SLOPPINESS=pch_defines,time_macros ${CACHE_PRG})
|
||||||
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
|
list(APPEND DEPS_CMAKE_CACHE_ARGS -DCMAKE_C_COMPILER_LAUNCHER:STRING=${CMAKE_C_COMPILER_LAUNCHER})
|
||||||
@@ -28,7 +32,6 @@ endif()
|
|||||||
# MAKE_PRG
|
# MAKE_PRG
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
find_program(MAKE_PRG NAMES gmake make)
|
find_program(MAKE_PRG NAMES gmake make)
|
||||||
mark_as_advanced(MAKE_PRG)
|
|
||||||
if(NOT MAKE_PRG)
|
if(NOT MAKE_PRG)
|
||||||
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
|
message(FATAL_ERROR "GNU Make is required to build the dependencies.")
|
||||||
else()
|
else()
|
||||||
|
31
cmake/FindLibvterm.cmake
Normal file
31
cmake/FindLibvterm.cmake
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
find_path2(LIBVTERM_INCLUDE_DIR vterm.h)
|
||||||
|
find_library2(LIBVTERM_LIBRARY vterm)
|
||||||
|
|
||||||
|
if(LIBVTERM_INCLUDE_DIR AND EXISTS "${LIBVTERM_INCLUDE_DIR}/vterm.h")
|
||||||
|
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MAJOR REGEX "#define VTERM_VERSION_MAJOR")
|
||||||
|
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MAJOR ${VTERM_VERSION_MAJOR})
|
||||||
|
|
||||||
|
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_MINOR REGEX "#define VTERM_VERSION_MINOR")
|
||||||
|
string(REGEX MATCH "[0-9]+" VTERM_VERSION_MINOR ${VTERM_VERSION_MINOR})
|
||||||
|
|
||||||
|
file(STRINGS ${LIBVTERM_INCLUDE_DIR}/vterm.h VTERM_VERSION_PATCH REGEX "#define VTERM_VERSION_PATCH")
|
||||||
|
|
||||||
|
# The following is needed to give a coherent error for versions 0.3.2 and
|
||||||
|
# smaller.
|
||||||
|
if(VTERM_VERSION_PATCH)
|
||||||
|
string(REGEX MATCH "[0-9]+" VTERM_VERSION_PATCH ${VTERM_VERSION_PATCH})
|
||||||
|
string(PREPEND VTERM_VERSION_PATCH ".")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(VTERM_VERSION ${VTERM_VERSION_MAJOR}.${VTERM_VERSION_MINOR}${VTERM_VERSION_PATCH})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(Libvterm
|
||||||
|
REQUIRED_VARS LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY
|
||||||
|
VERSION_VAR VTERM_VERSION)
|
||||||
|
|
||||||
|
add_library(libvterm INTERFACE)
|
||||||
|
target_include_directories(libvterm SYSTEM BEFORE INTERFACE ${LIBVTERM_INCLUDE_DIR})
|
||||||
|
target_link_libraries(libvterm INTERFACE ${LIBVTERM_LIBRARY})
|
||||||
|
|
||||||
|
mark_as_advanced(LIBVTERM_INCLUDE_DIR LIBVTERM_LIBRARY)
|
@@ -1,13 +1,4 @@
|
|||||||
find_library2(LPEG_LIBRARY NAMES lpeg_a lpeg liblpeg_a lpeg.so lpeg${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1)
|
find_library2(LPEG_LIBRARY NAMES lpeg_a lpeg liblpeg_a lpeg${CMAKE_SHARED_LIBRARY_SUFFIX} PATH_SUFFIXES lua/5.1)
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND LPEG_LIBRARY MATCHES ".so$")
|
|
||||||
execute_process(
|
|
||||||
COMMAND otool -hv "${LPEG_LIBRARY}"
|
|
||||||
OUTPUT_VARIABLE LPEG_HEADER
|
|
||||||
)
|
|
||||||
if(LPEG_HEADER MATCHES ".* BUNDLE .*")
|
|
||||||
message(FATAL_ERROR "lpeg library found at ${LPEG_LIBRARY} but built as a bundle rather than a dylib, please rebuild with `-dynamiclib` rather than `-bundle`")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package_handle_standard_args(Lpeg DEFAULT_MSG LPEG_LIBRARY)
|
find_package_handle_standard_args(Lpeg DEFAULT_MSG LPEG_LIBRARY)
|
||||||
mark_as_advanced(LPEG_LIBRARY)
|
mark_as_advanced(LPEG_LIBRARY)
|
||||||
|
24
cmake/FindMsgpack.cmake
Normal file
24
cmake/FindMsgpack.cmake
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
find_path2(MSGPACK_INCLUDE_DIR msgpack/version_master.h)
|
||||||
|
|
||||||
|
if(MSGPACK_INCLUDE_DIR)
|
||||||
|
file(READ ${MSGPACK_INCLUDE_DIR}/msgpack/version_master.h msgpack_version_h)
|
||||||
|
string(REGEX REPLACE ".*MSGPACK_VERSION_MAJOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MAJOR "${msgpack_version_h}")
|
||||||
|
string(REGEX REPLACE ".*MSGPACK_VERSION_MINOR +([0-9]+).*" "\\1" MSGPACK_VERSION_MINOR "${msgpack_version_h}")
|
||||||
|
string(REGEX REPLACE ".*MSGPACK_VERSION_REVISION +([0-9]+).*" "\\1" MSGPACK_VERSION_REVISION "${msgpack_version_h}")
|
||||||
|
set(MSGPACK_VERSION_STRING "${MSGPACK_VERSION_MAJOR}.${MSGPACK_VERSION_MINOR}.${MSGPACK_VERSION_REVISION}")
|
||||||
|
else()
|
||||||
|
set(MSGPACK_VERSION_STRING)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_library2(MSGPACK_LIBRARY NAMES msgpackc msgpack msgpackc_import msgpack-c
|
||||||
|
NAMES_PER_DIR)
|
||||||
|
|
||||||
|
mark_as_advanced(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
|
||||||
|
|
||||||
|
find_package_handle_standard_args(Msgpack
|
||||||
|
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
|
||||||
|
VERSION_VAR MSGPACK_VERSION_STRING)
|
||||||
|
|
||||||
|
add_library(msgpack INTERFACE)
|
||||||
|
target_include_directories(msgpack SYSTEM BEFORE INTERFACE ${MSGPACK_INCLUDE_DIR})
|
||||||
|
target_link_libraries(msgpack INTERFACE ${MSGPACK_LIBRARY})
|
@@ -1,12 +0,0 @@
|
|||||||
find_path2(UTF8PROC_INCLUDE_DIR utf8proc.h)
|
|
||||||
find_library2(UTF8PROC_LIBRARY NAMES utf8proc utf8proc_static)
|
|
||||||
find_package_handle_standard_args(UTF8proc DEFAULT_MSG
|
|
||||||
UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
|
|
||||||
mark_as_advanced(UTF8PROC_LIBRARY UTF8PROC_INCLUDE_DIR)
|
|
||||||
|
|
||||||
add_library(utf8proc INTERFACE)
|
|
||||||
target_include_directories(utf8proc SYSTEM BEFORE INTERFACE ${UTF8PROC_INCLUDE_DIR})
|
|
||||||
target_link_libraries(utf8proc INTERFACE ${UTF8PROC_LIBRARY})
|
|
||||||
|
|
||||||
#TODO(dundargoc): this is a hack that should ideally be hardcoded into the utf8proc project via configure_command
|
|
||||||
target_compile_definitions(utf8proc INTERFACE "UTF8PROC_STATIC")
|
|
@@ -1,22 +0,0 @@
|
|||||||
find_path2(WASMTIME_INCLUDE_DIR wasmtime.h)
|
|
||||||
find_library2(WASMTIME_LIBRARY wasmtime)
|
|
||||||
|
|
||||||
if(WASMTIME_INCLUDE_DIR AND EXISTS "${WASMTIME_INCLUDE_DIR}/wasmtime.h")
|
|
||||||
file(STRINGS ${WASMTIME_INCLUDE_DIR}/wasmtime.h WASMTIME_VERSION REGEX "#define WASMTIME_VERSION")
|
|
||||||
string(REGEX MATCH "[0-9]+\.[0-9]\.[0-9]" WASMTIME_VERSION ${WASMTIME_VERSION})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package_handle_standard_args(Wasmtime
|
|
||||||
REQUIRED_VARS WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY
|
|
||||||
VERSION_VAR WASMTIME_VERSION)
|
|
||||||
|
|
||||||
add_library(wasmtime INTERFACE)
|
|
||||||
target_include_directories(wasmtime SYSTEM BEFORE INTERFACE ${WASMTIME_INCLUDE_DIR})
|
|
||||||
target_link_libraries(wasmtime INTERFACE ${WASMTIME_LIBRARY})
|
|
||||||
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_options(wasmtime INTERFACE -DWASM_API_EXTERN= -DWASI_API_EXTERN=)
|
|
||||||
target_link_libraries(wasmtime INTERFACE ws2_32 advapi32 userenv ntdll shell32 ole32 bcrypt)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(WASMTIME_INCLUDE_DIR WASMTIME_LIBRARY)
|
|
@@ -7,7 +7,6 @@ set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
|||||||
set(ENV{XDG_STATE_HOME} ${BUILD_DIR}/Xtest_xdg/state)
|
set(ENV{XDG_STATE_HOME} ${BUILD_DIR}/Xtest_xdg/state)
|
||||||
unset(ENV{XDG_DATA_DIRS})
|
unset(ENV{XDG_DATA_DIRS})
|
||||||
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
|
unset(ENV{NVIM}) # Clear $NVIM in case tests are running from Nvim. #11009
|
||||||
unset(ENV{TMUX}) # Nvim TUI shouldn't think it's running in tmux. #34173
|
|
||||||
|
|
||||||
# TODO(dundargoc): The CIRRUS_CI environment variable isn't passed to here from
|
# TODO(dundargoc): The CIRRUS_CI environment variable isn't passed to here from
|
||||||
# the main CMakeLists.txt, so we have to manually pass it to this script and
|
# the main CMakeLists.txt, so we have to manually pass it to this script and
|
||||||
@@ -69,16 +68,16 @@ endif()
|
|||||||
execute_process(
|
execute_process(
|
||||||
# Note: because of "-ll" (low-level interpreter mode), some modules like
|
# Note: because of "-ll" (low-level interpreter mode), some modules like
|
||||||
# _editor.lua are not loaded.
|
# _editor.lua are not loaded.
|
||||||
COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR}/share/lua/5.1/ busted -v -o test.busted.outputHandlers.nvim
|
COMMAND ${NVIM_PRG} -ll ${WORKING_DIR}/test/lua_runner.lua ${DEPS_INSTALL_DIR} busted -v -o test.busted.outputHandlers.nvim
|
||||||
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
|
--lazy --helper=${TEST_DIR}/${TEST_TYPE}/preload.lua
|
||||||
--lpath=${BUILD_DIR}/?.lua
|
--lpath=${BUILD_DIR}/?.lua
|
||||||
--lpath=${WORKING_DIR}/src/?.lua
|
|
||||||
--lpath=${WORKING_DIR}/runtime/lua/?.lua
|
--lpath=${WORKING_DIR}/runtime/lua/?.lua
|
||||||
--lpath=?.lua
|
--lpath=?.lua
|
||||||
${BUSTED_ARGS}
|
${BUSTED_ARGS}
|
||||||
${TEST_PATH}
|
${TEST_PATH}
|
||||||
TIMEOUT $ENV{TEST_TIMEOUT}
|
TIMEOUT $ENV{TEST_TIMEOUT}
|
||||||
WORKING_DIRECTORY ${WORKING_DIR}
|
WORKING_DIRECTORY ${WORKING_DIR}
|
||||||
|
ERROR_VARIABLE err
|
||||||
RESULT_VARIABLE res
|
RESULT_VARIABLE res
|
||||||
${EXTRA_ARGS})
|
${EXTRA_ARGS})
|
||||||
|
|
||||||
@@ -87,6 +86,11 @@ file(REMOVE_RECURSE ${RM_FILES})
|
|||||||
|
|
||||||
if(res)
|
if(res)
|
||||||
message(STATUS "Tests exited non-zero: ${res}")
|
message(STATUS "Tests exited non-zero: ${res}")
|
||||||
|
if("${err}" STREQUAL "")
|
||||||
|
message(STATUS "No output to stderr.")
|
||||||
|
else()
|
||||||
|
message(STATUS "Output to stderr:\n${err}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Dump the logfile on CI (if not displayed and moved already).
|
# Dump the logfile on CI (if not displayed and moved already).
|
||||||
if(CI_BUILD)
|
if(CI_BUILD)
|
||||||
|
@@ -176,7 +176,8 @@ function(add_target)
|
|||||||
add_custom_target(${target} DEPENDS ${touch_file})
|
add_custom_target(${target} DEPENDS ${touch_file})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Set default build type to BUILD_TYPE.
|
# Set default build type to BUILD_TYPE. Also limit the list of allowable build
|
||||||
|
# types to the ones defined in variable allowableBuildTypes.
|
||||||
#
|
#
|
||||||
# The correct way to specify build type (for example Release) for
|
# The correct way to specify build type (for example Release) for
|
||||||
# single-configuration generators (Make and Ninja) is to run
|
# single-configuration generators (Make and Ninja) is to run
|
||||||
@@ -193,24 +194,28 @@ endfunction()
|
|||||||
# Passing CMAKE_BUILD_TYPE for multi-config generators will not only not be
|
# Passing CMAKE_BUILD_TYPE for multi-config generators will not only not be
|
||||||
# used, but also generate a warning for the user.
|
# used, but also generate a warning for the user.
|
||||||
function(set_default_buildtype BUILD_TYPE)
|
function(set_default_buildtype BUILD_TYPE)
|
||||||
set(defaultBuildTypes Debug Release MinSizeRel RelWithDebInfo)
|
set(allowableBuildTypes Debug Release MinSizeRel RelWithDebInfo)
|
||||||
|
if(NOT BUILD_TYPE IN_LIST allowableBuildTypes)
|
||||||
|
message(FATAL_ERROR "Invalid build type: ${BUILD_TYPE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
if(isMultiConfig)
|
if(isMultiConfig)
|
||||||
# Multi-config generators use the first element in
|
# Multi-config generators use the first element in CMAKE_CONFIGURATION_TYPES as the default build type
|
||||||
# CMAKE_CONFIGURATION_TYPES as the default build type
|
list(INSERT allowableBuildTypes 0 ${BUILD_TYPE})
|
||||||
list(INSERT defaultBuildTypes 0 ${BUILD_TYPE})
|
list(REMOVE_DUPLICATES allowableBuildTypes)
|
||||||
list(REMOVE_DUPLICATES defaultBuildTypes)
|
set(CMAKE_CONFIGURATION_TYPES ${allowableBuildTypes} PARENT_SCOPE)
|
||||||
set(CMAKE_CONFIGURATION_TYPES ${defaultBuildTypes} PARENT_SCOPE)
|
|
||||||
if(CMAKE_BUILD_TYPE)
|
if(CMAKE_BUILD_TYPE)
|
||||||
message(WARNING "CMAKE_BUILD_TYPE specified which is ignored on \
|
message(WARNING "CMAKE_BUILD_TYPE specified which is ignored on \
|
||||||
multi-configuration generators. Defaulting to ${BUILD_TYPE} build type.")
|
multi-configuration generators. Defaulting to ${BUILD_TYPE} build type.")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${defaultBuildTypes}")
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuildTypes}")
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "CMAKE_BUILD_TYPE not specified, default is '${BUILD_TYPE}'")
|
message(STATUS "CMAKE_BUILD_TYPE not specified, default is '${BUILD_TYPE}'")
|
||||||
set(CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE STRING "Choose the type of build" FORCE)
|
set(CMAKE_BUILD_TYPE ${BUILD_TYPE} CACHE STRING "Choose the type of build" FORCE)
|
||||||
|
elseif(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes)
|
||||||
|
message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
|
||||||
else()
|
else()
|
||||||
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
message(STATUS "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -167,15 +167,13 @@ function! s:Spawn(server_cmd, client_cmd, server_addr, reconnect)
|
|||||||
if type(a:server_cmd) == type('')
|
if type(a:server_cmd) == type('')
|
||||||
" spawn gdbserver in a vertical split
|
" spawn gdbserver in a vertical split
|
||||||
let server = s:GdbServer.new(gdb)
|
let server = s:GdbServer.new(gdb)
|
||||||
server.term = v:true
|
vsp | enew | let gdb._server_id = termopen(a:server_cmd, server)
|
||||||
vsp | enew | let gdb._server_id = jobstart(a:server_cmd, server)
|
|
||||||
let gdb._jump_window = 2
|
let gdb._jump_window = 2
|
||||||
let gdb._server_buf = bufnr('%')
|
let gdb._server_buf = bufnr('%')
|
||||||
endif
|
endif
|
||||||
" go to the bottom window and spawn gdb client
|
" go to the bottom window and spawn gdb client
|
||||||
wincmd j
|
wincmd j
|
||||||
gdb.term = v:true
|
enew | let gdb._client_id = termopen(a:client_cmd, gdb)
|
||||||
enew | let gdb._client_id = jobstart(a:client_cmd, gdb)
|
|
||||||
let gdb._client_buf = bufnr('%')
|
let gdb._client_buf = bufnr('%')
|
||||||
tnoremap <silent> <f8> <c-\><c-n>:GdbContinue<cr>i
|
tnoremap <silent> <f8> <c-\><c-n>:GdbContinue<cr>i
|
||||||
tnoremap <silent> <f10> <c-\><c-n>:GdbNext<cr>i
|
tnoremap <silent> <f10> <c-\><c-n>:GdbNext<cr>i
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
#
|
#
|
||||||
# - Debug: Disables optimizations (-O0), enables debug information.
|
# - Debug: Disables optimizations (-O0), enables debug information.
|
||||||
#
|
#
|
||||||
# - RelWithDebInfo: Enables optimizations (-O2) with debug information.
|
# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information.
|
||||||
#
|
#
|
||||||
# - MinSizeRel: Enables all -O2 optimization that do not typically
|
# - MinSizeRel: Enables all -O2 optimization that do not typically
|
||||||
# increase code size, and performs further optimizations
|
# increase code size, and performs further optimizations
|
||||||
@@ -45,12 +45,13 @@
|
|||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_GETTEXT=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_GETTEXT=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBICONV=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBICONV=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBUV=OFF
|
||||||
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LIBVTERM=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAJIT=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUV=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUV=OFF
|
||||||
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS_PARSERS=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_TS_PARSERS=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
|
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
|
||||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UTF8PROC=OFF
|
|
||||||
#
|
#
|
||||||
# Or disable all bundled dependencies at once.
|
# Or disable all bundled dependencies at once.
|
||||||
#
|
#
|
||||||
|
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
for name, url in pairs {
|
for name, url in pairs {
|
||||||
-- ADD PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE, e.g:
|
-- ADD PLUGINS _NECESSARY_ TO REPRODUCE THE ISSUE, e.g:
|
||||||
-- 'https://github.com/author1/plugin1',
|
-- some_plugin = 'https://github.com/author/plugin.nvim'
|
||||||
-- 'https://github.com/author2/plugin2',
|
|
||||||
} do
|
} do
|
||||||
local install_path = vim.fn.fnamemodify('nvim_issue/' .. name, ':p')
|
local install_path = vim.fn.fnamemodify('nvim_issue/' .. name, ':p')
|
||||||
if vim.fn.isdirectory(install_path) == 0 then
|
if vim.fn.isdirectory(install_path) == 0 then
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
#compdef nvim
|
|
||||||
|
|
||||||
# zsh completions for 'nvim'
|
|
||||||
# automatically generated with http://github.com/RobSis/zsh-completion-generator
|
|
||||||
local arguments
|
|
||||||
|
|
||||||
arguments=(
|
|
||||||
'*--cmd[execute <cmd> before any config]:command'
|
|
||||||
'*-c[Execute <cmd> after config and first file]:command'
|
|
||||||
'-l[Execute Lua <script> (with optional args)]:script:_files -g "*.lua"' # TODO: remaining args are passed to <script> and not opened by nvim for edit
|
|
||||||
'-S[source <session> after loading the first file]::session:_files'
|
|
||||||
'-s[read Normal mode commands from <scriptin>]:file:_files'
|
|
||||||
'-u[use this config file]:config'
|
|
||||||
'-d[diff mode]'
|
|
||||||
{-es,-Es}'[silent (batch) mode]'
|
|
||||||
'(- *)'{-h,--help}'[print this help message]'
|
|
||||||
'-i[use this shada file]:shada:_files -g "*.shada"'
|
|
||||||
'-n[no swap file, use memory only]'
|
|
||||||
'-o-[open N windows (default: one per file)]::N'
|
|
||||||
'-O-[open N vertical windows (default: one per file)]::N'
|
|
||||||
'-p-[open N tab pages (default: one per file)]::N'
|
|
||||||
'-R[read-only (view) mode]'
|
|
||||||
'(- *)'{-v,--version}'[print version information]'
|
|
||||||
'-V[verbose \[level\]\[file\]]'
|
|
||||||
'(- *)--api-info[write msgpack-encoded API metadata to stdout]'
|
|
||||||
'--clean["Factory defaults" (skip user config and plugins, shada)]'
|
|
||||||
'--embed[use stdin/stdout as a msgpack-rpc channel]'
|
|
||||||
'--headless[dont start a user interface]'
|
|
||||||
'--listen[serve RPC API from this address]:address'
|
|
||||||
'--remote[\[-subcommand\] Execute commands remotely on a server]'
|
|
||||||
'--server[connect to this Nvim server]:address'
|
|
||||||
'--startuptime[write startup timing messages to <file>]:file:_files'
|
|
||||||
'*:filename:_files'
|
|
||||||
)
|
|
||||||
|
|
||||||
_arguments -s $arguments
|
|
30
deps/unibilium/build.zig
vendored
30
deps/unibilium/build.zig
vendored
@@ -1,30 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
|
||||||
const target = b.standardTargetOptions(.{});
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
const upstream = b.dependency("unibilium", .{});
|
|
||||||
const lib = b.addLibrary(.{
|
|
||||||
.name = "unibilium",
|
|
||||||
.linkage = .static,
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
lib.addIncludePath(upstream.path(""));
|
|
||||||
|
|
||||||
lib.installHeader(upstream.path("unibilium.h"), "unibilium.h");
|
|
||||||
|
|
||||||
lib.linkLibC();
|
|
||||||
|
|
||||||
lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
|
|
||||||
"unibilium.c",
|
|
||||||
"uninames.c",
|
|
||||||
"uniutil.c",
|
|
||||||
}, .flags = &.{"-DTERMINFO_DIRS=\"/etc/terminfo:/usr/share/terminfo\""} });
|
|
||||||
|
|
||||||
b.installArtifact(lib);
|
|
||||||
}
|
|
12
deps/unibilium/build.zig.zon
vendored
12
deps/unibilium/build.zig.zon
vendored
@@ -1,12 +0,0 @@
|
|||||||
.{
|
|
||||||
.name = "unibilium",
|
|
||||||
.version = "2.1.2",
|
|
||||||
.paths = .{""},
|
|
||||||
|
|
||||||
.dependencies = .{
|
|
||||||
.unibilium = .{
|
|
||||||
.url = "git+https://github.com/neovim/unibilium?ref=v2.1.2#bfcb0350129dd76893bc90399cf37c45812268a2",
|
|
||||||
.hash = "N-V-__8AADO1CgCggvx73yptnBlXbEm7TjOSO6VGIqc0CvYR",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
27
deps/utf8proc/build.zig
vendored
27
deps/utf8proc/build.zig
vendored
@@ -1,27 +0,0 @@
|
|||||||
const std = @import("std");
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
|
||||||
const target = b.standardTargetOptions(.{});
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
const upstream = b.dependency("utf8proc", .{});
|
|
||||||
const lib = b.addLibrary(.{
|
|
||||||
.name = "utf8proc",
|
|
||||||
.linkage = .static,
|
|
||||||
.root_module = b.createModule(.{
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
|
|
||||||
lib.addIncludePath(upstream.path(""));
|
|
||||||
lib.installHeader(upstream.path("utf8proc.h"), "utf8proc.h");
|
|
||||||
|
|
||||||
lib.linkLibC();
|
|
||||||
|
|
||||||
lib.addCSourceFiles(.{ .root = upstream.path(""), .files = &.{
|
|
||||||
"utf8proc.c",
|
|
||||||
}, .flags = &.{"-DUTF8PROC_STATIC"} });
|
|
||||||
|
|
||||||
b.installArtifact(lib);
|
|
||||||
}
|
|
12
deps/utf8proc/build.zig.zon
vendored
12
deps/utf8proc/build.zig.zon
vendored
@@ -1,12 +0,0 @@
|
|||||||
.{
|
|
||||||
.name = "utf8proc",
|
|
||||||
.version = "2.10.0",
|
|
||||||
.paths = .{""},
|
|
||||||
|
|
||||||
.dependencies = .{
|
|
||||||
.utf8proc = .{
|
|
||||||
.url = "git+https://github.com/JuliaStrings/utf8proc?ref=v2.10.0#a1b99daa2a3393884220264c927a48ba1251a9c6",
|
|
||||||
.hash = "N-V-__8AAPJfKADYDOC95xuKyudrlob6eFqgzfFl8NbpOoU9",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
@@ -3,7 +3,7 @@ set(GENERATED_RUNTIME_DIR ${PROJECT_BINARY_DIR}/runtime)
|
|||||||
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
|
set(GENERATED_HELP_TAGS ${GENERATED_RUNTIME_DIR}/doc/tags)
|
||||||
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
|
set(GENERATED_PACKAGE_DIR ${GENERATED_RUNTIME_DIR}/pack/dist/opt)
|
||||||
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
|
set(GENERATED_SYN_VIM ${GENERATED_RUNTIME_DIR}/syntax/vim/generated.vim)
|
||||||
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/gen/gen_vimvim.lua)
|
set(SYN_VIM_GENERATOR ${PROJECT_SOURCE_DIR}/src/nvim/generators/gen_vimvim.lua)
|
||||||
|
|
||||||
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
|
file(MAKE_DIRECTORY ${GENERATED_RUNTIME_DIR}/syntax/vim)
|
||||||
|
|
||||||
@@ -12,17 +12,12 @@ get_directory_property(LUA_GEN_DEPS DIRECTORY ${PROJECT_SOURCE_DIR}/src/nvim DEF
|
|||||||
|
|
||||||
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
||||||
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
|
COMMAND ${LUA_GEN} ${SYN_VIM_GENERATOR} ${GENERATED_SYN_VIM} ${FUNCS_DATA}
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
|
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
|
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
|
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/vvars.lua
|
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${LUA_GEN_DEPS}
|
${LUA_GEN_DEPS}
|
||||||
${SYN_VIM_GENERATOR}
|
${SYN_VIM_GENERATOR}
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
|
${PROJECT_SOURCE_DIR}/src/nvim/ex_cmds.lua
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
|
${PROJECT_SOURCE_DIR}/src/nvim/auevents.lua
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
|
${PROJECT_SOURCE_DIR}/src/nvim/options.lua
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/vvars.lua
|
|
||||||
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
|
${PROJECT_SOURCE_DIR}/src/nvim/eval.c
|
||||||
${FUNCS_DATA}
|
${FUNCS_DATA}
|
||||||
)
|
)
|
||||||
@@ -123,4 +118,4 @@ foreach(D ${RUNTIME_DIRS})
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# only foo.sh script in runtime/
|
# only foo.sh script in runtime/
|
||||||
install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/scripts/)
|
install_helper(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/macros/less.sh DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/macros/)
|
||||||
|
@@ -7,7 +7,7 @@ gzip.vim for editing compressed files
|
|||||||
netrw*.vim browsing (remote) directories and editing remote files
|
netrw*.vim browsing (remote) directories and editing remote files
|
||||||
tar.vim browsing tar files
|
tar.vim browsing tar files
|
||||||
zip.vim browsing zip files
|
zip.vim browsing zip files
|
||||||
paste.vim common code for mswin.vim and menu.vim
|
paste.vim common code for mswin.vim, menu.vim and macmap.vim
|
||||||
spellfile.vim downloading of a missing spell file
|
spellfile.vim downloading of a missing spell file
|
||||||
|
|
||||||
Omni completion files:
|
Omni completion files:
|
||||||
|
858
runtime/autoload/ccomplete.lua
Normal file
858
runtime/autoload/ccomplete.lua
Normal file
@@ -0,0 +1,858 @@
|
|||||||
|
----------------------------------------
|
||||||
|
-- This file is generated via github.com/tjdevries/vim9jit
|
||||||
|
-- For any bugs, please first consider reporting there.
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
-- Ignore "value assigned to a local variable is unused" because
|
||||||
|
-- we can't guarantee that local variables will be used by plugins
|
||||||
|
-- luacheck: ignore 311
|
||||||
|
|
||||||
|
local vim9 = require('_vim9script')
|
||||||
|
local M = {}
|
||||||
|
local prepended = nil
|
||||||
|
local grepCache = nil
|
||||||
|
local Complete = nil
|
||||||
|
local GetAddition = nil
|
||||||
|
local Tag2item = nil
|
||||||
|
local Dict2info = nil
|
||||||
|
local ParseTagline = nil
|
||||||
|
local Tagline2item = nil
|
||||||
|
local Tagcmd2extra = nil
|
||||||
|
local Nextitem = nil
|
||||||
|
local StructMembers = nil
|
||||||
|
local SearchMembers = nil
|
||||||
|
-- vim9script
|
||||||
|
|
||||||
|
-- # Vim completion script
|
||||||
|
-- # Language: C
|
||||||
|
-- # Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||||
|
-- # Last Change: 2023 Aug 10
|
||||||
|
-- # Rewritten in Vim9 script by github user lacygoill
|
||||||
|
-- # Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
|
|
||||||
|
prepended = ''
|
||||||
|
grepCache = vim.empty_dict()
|
||||||
|
|
||||||
|
-- # This function is used for the 'omnifunc' option.
|
||||||
|
|
||||||
|
Complete = function(findstart, abase)
|
||||||
|
findstart = vim9.bool(findstart)
|
||||||
|
if vim9.bool(findstart) then
|
||||||
|
-- # Locate the start of the item, including ".", "->" and "[...]".
|
||||||
|
local line = vim9.fn.getline('.')
|
||||||
|
local start = vim9.fn.charcol('.') - 1
|
||||||
|
local lastword = -1
|
||||||
|
while start > 0 do
|
||||||
|
if vim9.ops.RegexpMatches(vim9.index(line, vim9.ops.Minus(start, 1)), '\\w') then
|
||||||
|
start = start - 1
|
||||||
|
elseif
|
||||||
|
vim9.bool(vim9.ops.RegexpMatches(vim9.index(line, vim9.ops.Minus(start, 1)), '\\.'))
|
||||||
|
then
|
||||||
|
if lastword == -1 then
|
||||||
|
lastword = start
|
||||||
|
end
|
||||||
|
start = start - 1
|
||||||
|
elseif
|
||||||
|
vim9.bool(
|
||||||
|
start > 1
|
||||||
|
and vim9.index(line, vim9.ops.Minus(start, 2)) == '-'
|
||||||
|
and vim9.index(line, vim9.ops.Minus(start, 1)) == '>'
|
||||||
|
)
|
||||||
|
then
|
||||||
|
if lastword == -1 then
|
||||||
|
lastword = start
|
||||||
|
end
|
||||||
|
start = vim9.ops.Minus(start, 2)
|
||||||
|
elseif vim9.bool(vim9.index(line, vim9.ops.Minus(start, 1)) == ']') then
|
||||||
|
-- # Skip over [...].
|
||||||
|
local n = 0
|
||||||
|
start = start - 1
|
||||||
|
while start > 0 do
|
||||||
|
start = start - 1
|
||||||
|
if vim9.index(line, start) == '[' then
|
||||||
|
if n == 0 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
n = n - 1
|
||||||
|
elseif vim9.bool(vim9.index(line, start) == ']') then
|
||||||
|
n = n + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Return the column of the last word, which is going to be changed.
|
||||||
|
-- # Remember the text that comes before it in prepended.
|
||||||
|
if lastword == -1 then
|
||||||
|
prepended = ''
|
||||||
|
return vim9.fn.byteidx(line, start)
|
||||||
|
end
|
||||||
|
prepended = vim9.slice(line, start, vim9.ops.Minus(lastword, 1))
|
||||||
|
return vim9.fn.byteidx(line, lastword)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Return list of matches.
|
||||||
|
|
||||||
|
local base = prepended .. abase
|
||||||
|
|
||||||
|
-- # Don't do anything for an empty base, would result in all the tags in the
|
||||||
|
-- # tags file.
|
||||||
|
if base == '' then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # init cache for vimgrep to empty
|
||||||
|
grepCache = {}
|
||||||
|
|
||||||
|
-- # Split item in words, keep empty word after "." or "->".
|
||||||
|
-- # "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
|
||||||
|
-- # We can't use split, because we need to skip nested [...].
|
||||||
|
-- # "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc.
|
||||||
|
local items = {}
|
||||||
|
local s = 0
|
||||||
|
local arrays = 0
|
||||||
|
while 1 do
|
||||||
|
local e = vim9.fn.charidx(base, vim9.fn.match(base, '\\.\\|->\\|\\[', s))
|
||||||
|
if e < 0 then
|
||||||
|
if s == 0 or vim9.index(base, vim9.ops.Minus(s, 1)) ~= ']' then
|
||||||
|
vim9.fn.add(items, vim9.slice(base, s, nil))
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if s == 0 or vim9.index(base, vim9.ops.Minus(s, 1)) ~= ']' then
|
||||||
|
vim9.fn.add(items, vim9.slice(base, s, vim9.ops.Minus(e, 1)))
|
||||||
|
end
|
||||||
|
if vim9.index(base, e) == '.' then
|
||||||
|
-- # skip over '.'
|
||||||
|
s = vim9.ops.Plus(e, 1)
|
||||||
|
elseif vim9.bool(vim9.index(base, e) == '-') then
|
||||||
|
-- # skip over '->'
|
||||||
|
s = vim9.ops.Plus(e, 2)
|
||||||
|
else
|
||||||
|
-- # Skip over [...].
|
||||||
|
local n = 0
|
||||||
|
s = e
|
||||||
|
e = e + 1
|
||||||
|
while e < vim9.fn.strcharlen(base) do
|
||||||
|
if vim9.index(base, e) == ']' then
|
||||||
|
if n == 0 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
n = n - 1
|
||||||
|
elseif vim9.bool(vim9.index(base, e) == '[') then
|
||||||
|
n = n + 1
|
||||||
|
end
|
||||||
|
e = e + 1
|
||||||
|
end
|
||||||
|
e = e + 1
|
||||||
|
vim9.fn.add(items, vim9.slice(base, s, vim9.ops.Minus(e, 1)))
|
||||||
|
arrays = arrays + 1
|
||||||
|
s = e
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Find the variable items[0].
|
||||||
|
-- # 1. in current function (like with "gd")
|
||||||
|
-- # 2. in tags file(s) (like with ":tag")
|
||||||
|
-- # 3. in current file (like with "gD")
|
||||||
|
local res = {}
|
||||||
|
if vim9.fn.searchdecl(vim9.index(items, 0), false, true) == 0 then
|
||||||
|
-- # Found, now figure out the type.
|
||||||
|
-- # TODO: join previous line if it makes sense
|
||||||
|
local line = vim9.fn.getline('.')
|
||||||
|
local col = vim9.fn.charcol('.')
|
||||||
|
if vim9.fn.stridx(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), ';') >= 0 then
|
||||||
|
-- # Handle multiple declarations on the same line.
|
||||||
|
local col2 = vim9.ops.Minus(col, 1)
|
||||||
|
while vim9.index(line, col2) ~= ';' do
|
||||||
|
col2 = col2 - 1
|
||||||
|
end
|
||||||
|
line = vim9.slice(line, vim9.ops.Plus(col2, 1), nil)
|
||||||
|
col = vim9.ops.Minus(col, col2)
|
||||||
|
end
|
||||||
|
if vim9.fn.stridx(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), ',') >= 0 then
|
||||||
|
-- # Handle multiple declarations on the same line in a function
|
||||||
|
-- # declaration.
|
||||||
|
local col2 = vim9.ops.Minus(col, 1)
|
||||||
|
while vim9.index(line, col2) ~= ',' do
|
||||||
|
col2 = col2 - 1
|
||||||
|
end
|
||||||
|
if
|
||||||
|
vim9.ops.RegexpMatches(
|
||||||
|
vim9.slice(line, vim9.ops.Plus(col2, 1), vim9.ops.Minus(col, 1)),
|
||||||
|
' *[^ ][^ ]* *[^ ]'
|
||||||
|
)
|
||||||
|
then
|
||||||
|
line = vim9.slice(line, vim9.ops.Plus(col2, 1), nil)
|
||||||
|
col = vim9.ops.Minus(col, col2)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if vim9.fn.len(items) == 1 then
|
||||||
|
-- # Completing one word and it's a local variable: May add '[', '.' or
|
||||||
|
-- # '->'.
|
||||||
|
local match = vim9.index(items, 0)
|
||||||
|
local kind = 'v'
|
||||||
|
if vim9.fn.match(line, '\\<' .. match .. '\\s*\\[') > 0 then
|
||||||
|
match = match .. '['
|
||||||
|
else
|
||||||
|
res = Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), { '' }, 0, true)
|
||||||
|
if vim9.fn.len(res) > 0 then
|
||||||
|
-- # There are members, thus add "." or "->".
|
||||||
|
if vim9.fn.match(line, '\\*[ \\t(]*' .. match .. '\\>') > 0 then
|
||||||
|
match = match .. '->'
|
||||||
|
else
|
||||||
|
match = match .. '.'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
res = { { ['match'] = match, ['tagline'] = '', ['kind'] = kind, ['info'] = line } }
|
||||||
|
elseif vim9.bool(vim9.fn.len(items) == vim9.ops.Plus(arrays, 1)) then
|
||||||
|
-- # Completing one word and it's a local array variable: build tagline
|
||||||
|
-- # from declaration line
|
||||||
|
local match = vim9.index(items, 0)
|
||||||
|
local kind = 'v'
|
||||||
|
local tagline = '\t/^' .. line .. '$/'
|
||||||
|
res = { { ['match'] = match, ['tagline'] = tagline, ['kind'] = kind, ['info'] = line } }
|
||||||
|
else
|
||||||
|
-- # Completing "var.", "var.something", etc.
|
||||||
|
res =
|
||||||
|
Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), vim9.slice(items, 1, nil), 0, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.fn.len(items) == 1 or vim9.fn.len(items) == vim9.ops.Plus(arrays, 1) then
|
||||||
|
-- # Only one part, no "." or "->": complete from tags file.
|
||||||
|
local tags = {}
|
||||||
|
if vim9.fn.len(items) == 1 then
|
||||||
|
tags = vim9.fn.taglist('^' .. base)
|
||||||
|
else
|
||||||
|
tags = vim9.fn.taglist('^' .. vim9.index(items, 0) .. '$')
|
||||||
|
end
|
||||||
|
|
||||||
|
vim9.fn_mut('filter', {
|
||||||
|
vim9.fn_mut('filter', {
|
||||||
|
tags,
|
||||||
|
function(_, v)
|
||||||
|
return vim9.ternary(vim9.fn.has_key(v, 'kind'), function()
|
||||||
|
return v.kind ~= 'm'
|
||||||
|
end, true)
|
||||||
|
end,
|
||||||
|
}, { replace = 0 }),
|
||||||
|
function(_, v)
|
||||||
|
return vim9.ops.Or(
|
||||||
|
vim9.ops.Or(
|
||||||
|
vim9.prefix['Bang'](vim9.fn.has_key(v, 'static')),
|
||||||
|
vim9.prefix['Bang'](vim9.index(v, 'static'))
|
||||||
|
),
|
||||||
|
vim9.fn.bufnr('%') == vim9.fn.bufnr(vim9.index(v, 'filename'))
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
}, { replace = 0 })
|
||||||
|
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
vim9.fn.map(tags, function(_, v)
|
||||||
|
return Tag2item(v)
|
||||||
|
end)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.fn.len(res) == 0 then
|
||||||
|
-- # Find the variable in the tags file(s)
|
||||||
|
local diclist = vim9.fn.filter(
|
||||||
|
vim9.fn.taglist('^' .. vim9.index(items, 0) .. '$'),
|
||||||
|
function(_, v)
|
||||||
|
return vim9.ternary(vim9.fn.has_key(v, 'kind'), function()
|
||||||
|
return v.kind ~= 'm'
|
||||||
|
end, true)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
res = {}
|
||||||
|
|
||||||
|
for _, i in vim9.iter(vim9.fn.range(vim9.fn.len(diclist))) do
|
||||||
|
-- # New ctags has the "typeref" field. Patched version has "typename".
|
||||||
|
if vim9.bool(vim9.fn.has_key(vim9.index(diclist, i), 'typename')) then
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
StructMembers(
|
||||||
|
vim9.index(vim9.index(diclist, i), 'typename'),
|
||||||
|
vim9.slice(items, 1, nil),
|
||||||
|
true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elseif vim9.bool(vim9.fn.has_key(vim9.index(diclist, i), 'typeref')) then
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
StructMembers(
|
||||||
|
vim9.index(vim9.index(diclist, i), 'typeref'),
|
||||||
|
vim9.slice(items, 1, nil),
|
||||||
|
true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # For a variable use the command, which must be a search pattern that
|
||||||
|
-- # shows the declaration of the variable.
|
||||||
|
if vim9.index(vim9.index(diclist, i), 'kind') == 'v' then
|
||||||
|
local line = vim9.index(vim9.index(diclist, i), 'cmd')
|
||||||
|
if vim9.slice(line, nil, 1) == '/^' then
|
||||||
|
local col =
|
||||||
|
vim9.fn.charidx(line, vim9.fn.match(line, '\\<' .. vim9.index(items, 0) .. '\\>'))
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
Nextitem(
|
||||||
|
vim9.slice(line, 2, vim9.ops.Minus(col, 1)),
|
||||||
|
vim9.slice(items, 1, nil),
|
||||||
|
0,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.fn.len(res) == 0 and vim9.fn.searchdecl(vim9.index(items, 0), true) == 0 then
|
||||||
|
-- # Found, now figure out the type.
|
||||||
|
-- # TODO: join previous line if it makes sense
|
||||||
|
local line = vim9.fn.getline('.')
|
||||||
|
local col = vim9.fn.charcol('.')
|
||||||
|
res =
|
||||||
|
Nextitem(vim9.slice(line, nil, vim9.ops.Minus(col, 1)), vim9.slice(items, 1, nil), 0, true)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # If the last item(s) are [...] they need to be added to the matches.
|
||||||
|
local last = vim9.fn.len(items) - 1
|
||||||
|
local brackets = ''
|
||||||
|
while last >= 0 do
|
||||||
|
if vim9.index(vim9.index(items, last), 0) ~= '[' then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
brackets = vim9.index(items, last) .. brackets
|
||||||
|
last = last - 1
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim9.fn.map(res, function(_, v)
|
||||||
|
return Tagline2item(v, brackets)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
M['Complete'] = Complete
|
||||||
|
|
||||||
|
GetAddition = function(line, match, memarg, bracket)
|
||||||
|
bracket = vim9.bool(bracket)
|
||||||
|
-- # Guess if the item is an array.
|
||||||
|
if vim9.bool(vim9.ops.And(bracket, vim9.fn.match(line, match .. '\\s*\\[') > 0)) then
|
||||||
|
return '['
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Check if the item has members.
|
||||||
|
if vim9.fn.len(SearchMembers(memarg, { '' }, false)) > 0 then
|
||||||
|
-- # If there is a '*' before the name use "->".
|
||||||
|
if vim9.fn.match(line, '\\*[ \\t(]*' .. match .. '\\>') > 0 then
|
||||||
|
return '->'
|
||||||
|
else
|
||||||
|
return '.'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ''
|
||||||
|
end
|
||||||
|
|
||||||
|
Tag2item = function(val)
|
||||||
|
-- # Turn the tag info "val" into an item for completion.
|
||||||
|
-- # "val" is is an item in the list returned by taglist().
|
||||||
|
-- # If it is a variable we may add "." or "->". Don't do it for other types,
|
||||||
|
-- # such as a typedef, by not including the info that GetAddition() uses.
|
||||||
|
local res = vim9.convert.decl_dict({ ['match'] = vim9.index(val, 'name') })
|
||||||
|
|
||||||
|
res[vim9.index_expr('extra')] =
|
||||||
|
Tagcmd2extra(vim9.index(val, 'cmd'), vim9.index(val, 'name'), vim9.index(val, 'filename'))
|
||||||
|
|
||||||
|
local s = Dict2info(val)
|
||||||
|
if s ~= '' then
|
||||||
|
res[vim9.index_expr('info')] = s
|
||||||
|
end
|
||||||
|
|
||||||
|
res[vim9.index_expr('tagline')] = ''
|
||||||
|
if vim9.bool(vim9.fn.has_key(val, 'kind')) then
|
||||||
|
local kind = vim9.index(val, 'kind')
|
||||||
|
res[vim9.index_expr('kind')] = kind
|
||||||
|
if kind == 'v' then
|
||||||
|
res[vim9.index_expr('tagline')] = '\t' .. vim9.index(val, 'cmd')
|
||||||
|
res[vim9.index_expr('dict')] = val
|
||||||
|
elseif vim9.bool(kind == 'f') then
|
||||||
|
res[vim9.index_expr('match')] = vim9.index(val, 'name') .. '('
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
Dict2info = function(dict)
|
||||||
|
-- # Use all the items in dictionary for the "info" entry.
|
||||||
|
local info = ''
|
||||||
|
|
||||||
|
for _, k in vim9.iter(vim9.fn_mut('sort', { vim9.fn.keys(dict) }, { replace = 0 })) do
|
||||||
|
info = info .. k .. vim9.fn['repeat'](' ', 10 - vim9.fn.strlen(k))
|
||||||
|
if k == 'cmd' then
|
||||||
|
info = info
|
||||||
|
.. vim9.fn.substitute(
|
||||||
|
vim9.fn.matchstr(vim9.index(dict, 'cmd'), '/^\\s*\\zs.*\\ze$/'),
|
||||||
|
'\\\\\\(.\\)',
|
||||||
|
'\\1',
|
||||||
|
'g'
|
||||||
|
)
|
||||||
|
else
|
||||||
|
local dictk = vim9.index(dict, k)
|
||||||
|
if vim9.fn.typename(dictk) ~= 'string' then
|
||||||
|
info = info .. vim9.fn.string(dictk)
|
||||||
|
else
|
||||||
|
info = info .. dictk
|
||||||
|
end
|
||||||
|
end
|
||||||
|
info = info .. '\n'
|
||||||
|
end
|
||||||
|
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
|
ParseTagline = function(line)
|
||||||
|
-- # Parse a tag line and return a dictionary with items like taglist()
|
||||||
|
local l = vim9.fn.split(line, '\t')
|
||||||
|
local d = vim.empty_dict()
|
||||||
|
if vim9.fn.len(l) >= 3 then
|
||||||
|
d[vim9.index_expr('name')] = vim9.index(l, 0)
|
||||||
|
d[vim9.index_expr('filename')] = vim9.index(l, 1)
|
||||||
|
d[vim9.index_expr('cmd')] = vim9.index(l, 2)
|
||||||
|
local n = 2
|
||||||
|
if vim9.ops.RegexpMatches(vim9.index(l, 2), '^/') then
|
||||||
|
-- # Find end of cmd, it may contain Tabs.
|
||||||
|
while n < vim9.fn.len(l) and vim9.ops.NotRegexpMatches(vim9.index(l, n), '/;"$') do
|
||||||
|
n = n + 1
|
||||||
|
d[vim9.index_expr('cmd')] = vim9.index(d, 'cmd') .. ' ' .. vim9.index(l, n)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, i in vim9.iter(vim9.fn.range(vim9.ops.Plus(n, 1), vim9.fn.len(l) - 1)) do
|
||||||
|
if vim9.index(l, i) == 'file:' then
|
||||||
|
d[vim9.index_expr('static')] = 1
|
||||||
|
elseif vim9.bool(vim9.ops.NotRegexpMatches(vim9.index(l, i), ':')) then
|
||||||
|
d[vim9.index_expr('kind')] = vim9.index(l, i)
|
||||||
|
else
|
||||||
|
d[vim9.index_expr(vim9.fn.matchstr(vim9.index(l, i), '[^:]*'))] =
|
||||||
|
vim9.fn.matchstr(vim9.index(l, i), ':\\zs.*')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return d
|
||||||
|
end
|
||||||
|
|
||||||
|
Tagline2item = function(val, brackets)
|
||||||
|
-- # Turn a match item "val" into an item for completion.
|
||||||
|
-- # "val['match']" is the matching item.
|
||||||
|
-- # "val['tagline']" is the tagline in which the last part was found.
|
||||||
|
local line = vim9.index(val, 'tagline')
|
||||||
|
local add = GetAddition(line, vim9.index(val, 'match'), { val }, brackets == '')
|
||||||
|
local res = vim9.convert.decl_dict({ ['word'] = vim9.index(val, 'match') .. brackets .. add })
|
||||||
|
|
||||||
|
if vim9.bool(vim9.fn.has_key(val, 'info')) then
|
||||||
|
-- # Use info from Tag2item().
|
||||||
|
res[vim9.index_expr('info')] = vim9.index(val, 'info')
|
||||||
|
else
|
||||||
|
-- # Parse the tag line and add each part to the "info" entry.
|
||||||
|
local s = Dict2info(ParseTagline(line))
|
||||||
|
if s ~= '' then
|
||||||
|
res[vim9.index_expr('info')] = s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.bool(vim9.fn.has_key(val, 'kind')) then
|
||||||
|
res[vim9.index_expr('kind')] = vim9.index(val, 'kind')
|
||||||
|
elseif vim9.bool(add == '(') then
|
||||||
|
res[vim9.index_expr('kind')] = 'f'
|
||||||
|
else
|
||||||
|
local s = vim9.fn.matchstr(line, '\\t\\(kind:\\)\\=\\zs\\S\\ze\\(\\t\\|$\\)')
|
||||||
|
if s ~= '' then
|
||||||
|
res[vim9.index_expr('kind')] = s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.bool(vim9.fn.has_key(val, 'extra')) then
|
||||||
|
res[vim9.index_expr('menu')] = vim9.index(val, 'extra')
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Isolate the command after the tag and filename.
|
||||||
|
local s = vim9.fn.matchstr(
|
||||||
|
line,
|
||||||
|
'[^\\t]*\\t[^\\t]*\\t\\zs\\(/^.*$/\\|[^\\t]*\\)\\ze\\(;"\\t\\|\\t\\|$\\)'
|
||||||
|
)
|
||||||
|
if s ~= '' then
|
||||||
|
res[vim9.index_expr('menu')] = Tagcmd2extra(
|
||||||
|
s,
|
||||||
|
vim9.index(val, 'match'),
|
||||||
|
vim9.fn.matchstr(line, '[^\\t]*\\t\\zs[^\\t]*\\ze\\t')
|
||||||
|
)
|
||||||
|
end
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
Tagcmd2extra = function(cmd, name, fname)
|
||||||
|
-- # Turn a command from a tag line to something that is useful in the menu
|
||||||
|
local x = ''
|
||||||
|
if vim9.ops.RegexpMatches(cmd, '^/^') then
|
||||||
|
-- # The command is a search command, useful to see what it is.
|
||||||
|
x = vim9.fn.substitute(
|
||||||
|
vim9.fn.substitute(
|
||||||
|
vim9.fn.matchstr(cmd, '^/^\\s*\\zs.*\\ze$/'),
|
||||||
|
'\\<' .. name .. '\\>',
|
||||||
|
'@@',
|
||||||
|
''
|
||||||
|
),
|
||||||
|
'\\\\\\(.\\)',
|
||||||
|
'\\1',
|
||||||
|
'g'
|
||||||
|
) .. ' - ' .. fname
|
||||||
|
elseif vim9.bool(vim9.ops.RegexpMatches(cmd, '^\\d*$')) then
|
||||||
|
-- # The command is a line number, the file name is more useful.
|
||||||
|
x = fname .. ' - ' .. cmd
|
||||||
|
else
|
||||||
|
-- # Not recognized, use command and file name.
|
||||||
|
x = cmd .. ' - ' .. fname
|
||||||
|
end
|
||||||
|
return x
|
||||||
|
end
|
||||||
|
|
||||||
|
Nextitem = function(lead, items, depth, all)
|
||||||
|
all = vim9.bool(all)
|
||||||
|
-- # Find composing type in "lead" and match items[0] with it.
|
||||||
|
-- # Repeat this recursively for items[1], if it's there.
|
||||||
|
-- # When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||||
|
-- # Return the list of matches.
|
||||||
|
|
||||||
|
-- # Use the text up to the variable name and split it in tokens.
|
||||||
|
local tokens = vim9.fn.split(lead, '\\s\\+\\|\\<')
|
||||||
|
|
||||||
|
-- # Try to recognize the type of the variable. This is rough guessing...
|
||||||
|
local res = {}
|
||||||
|
|
||||||
|
local body = function(_, tidx)
|
||||||
|
-- # Skip tokens starting with a non-ID character.
|
||||||
|
if vim9.ops.NotRegexpMatches(vim9.index(tokens, tidx), '^\\h') then
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Recognize "struct foobar" and "union foobar".
|
||||||
|
-- # Also do "class foobar" when it's C++ after all (doesn't work very well
|
||||||
|
-- # though).
|
||||||
|
if
|
||||||
|
(
|
||||||
|
vim9.index(tokens, tidx) == 'struct'
|
||||||
|
or vim9.index(tokens, tidx) == 'union'
|
||||||
|
or vim9.index(tokens, tidx) == 'class'
|
||||||
|
) and vim9.ops.Plus(tidx, 1) < vim9.fn.len(tokens)
|
||||||
|
then
|
||||||
|
res = StructMembers(
|
||||||
|
vim9.index(tokens, tidx) .. ':' .. vim9.index(tokens, vim9.ops.Plus(tidx, 1)),
|
||||||
|
items,
|
||||||
|
all
|
||||||
|
)
|
||||||
|
return vim9.ITER_BREAK
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # TODO: add more reserved words
|
||||||
|
if
|
||||||
|
vim9.fn.index(
|
||||||
|
{ 'int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern' },
|
||||||
|
vim9.index(tokens, tidx)
|
||||||
|
) >= 0
|
||||||
|
then
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Use the tags file to find out if this is a typedef.
|
||||||
|
local diclist = vim9.fn.taglist('^' .. vim9.index(tokens, tidx) .. '$')
|
||||||
|
|
||||||
|
local body = function(_, tagidx)
|
||||||
|
local item = vim9.convert.decl_dict(vim9.index(diclist, tagidx))
|
||||||
|
|
||||||
|
-- # New ctags has the "typeref" field. Patched version has "typename".
|
||||||
|
if vim9.bool(vim9.fn.has_key(item, 'typeref')) then
|
||||||
|
res = vim9.fn.extend(res, StructMembers(vim9.index(item, 'typeref'), items, all))
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
if vim9.bool(vim9.fn.has_key(item, 'typename')) then
|
||||||
|
res = vim9.fn.extend(res, StructMembers(vim9.index(item, 'typename'), items, all))
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Only handle typedefs here.
|
||||||
|
if vim9.index(item, 'kind') ~= 't' then
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Skip matches local to another file.
|
||||||
|
if
|
||||||
|
vim9.bool(
|
||||||
|
vim9.ops.And(
|
||||||
|
vim9.ops.And(vim9.fn.has_key(item, 'static'), vim9.index(item, 'static')),
|
||||||
|
vim9.fn.bufnr('%') ~= vim9.fn.bufnr(vim9.index(item, 'filename'))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
then
|
||||||
|
return vim9.ITER_CONTINUE
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # For old ctags we recognize "typedef struct aaa" and
|
||||||
|
-- # "typedef union bbb" in the tags file command.
|
||||||
|
local cmd = vim9.index(item, 'cmd')
|
||||||
|
local ei = vim9.fn.charidx(cmd, vim9.fn.matchend(cmd, 'typedef\\s\\+'))
|
||||||
|
if ei > 1 then
|
||||||
|
local cmdtokens = vim9.fn.split(vim9.slice(cmd, ei, nil), '\\s\\+\\|\\<')
|
||||||
|
if vim9.fn.len(cmdtokens) > 1 then
|
||||||
|
if
|
||||||
|
vim9.index(cmdtokens, 0) == 'struct'
|
||||||
|
or vim9.index(cmdtokens, 0) == 'union'
|
||||||
|
or vim9.index(cmdtokens, 0) == 'class'
|
||||||
|
then
|
||||||
|
local name = ''
|
||||||
|
-- # Use the first identifier after the "struct" or "union"
|
||||||
|
|
||||||
|
for _, ti in vim9.iter(vim9.fn.range((vim9.fn.len(cmdtokens) - 1))) do
|
||||||
|
if vim9.ops.RegexpMatches(vim9.index(cmdtokens, ti), '^\\w') then
|
||||||
|
name = vim9.index(cmdtokens, ti)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if name ~= '' then
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
StructMembers(vim9.index(cmdtokens, 0) .. ':' .. name, items, all)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
elseif vim9.bool(depth < 10) then
|
||||||
|
-- # Could be "typedef other_T some_T".
|
||||||
|
res = vim9.fn.extend(
|
||||||
|
res,
|
||||||
|
Nextitem(vim9.index(cmdtokens, 0), items, vim9.ops.Plus(depth, 1), all)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim9.ITER_DEFAULT
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, tagidx in vim9.iter(vim9.fn.range(vim9.fn.len(diclist))) do
|
||||||
|
local nvim9_status, nvim9_ret = body(_, tagidx)
|
||||||
|
if nvim9_status == vim9.ITER_BREAK then
|
||||||
|
break
|
||||||
|
elseif nvim9_status == vim9.ITER_RETURN then
|
||||||
|
return nvim9_ret
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.fn.len(res) > 0 then
|
||||||
|
return vim9.ITER_BREAK
|
||||||
|
end
|
||||||
|
|
||||||
|
return vim9.ITER_DEFAULT
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, tidx in vim9.iter(vim9.fn.range(vim9.fn.len(tokens))) do
|
||||||
|
local nvim9_status, nvim9_ret = body(_, tidx)
|
||||||
|
if nvim9_status == vim9.ITER_BREAK then
|
||||||
|
break
|
||||||
|
elseif nvim9_status == vim9.ITER_RETURN then
|
||||||
|
return nvim9_ret
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
StructMembers = function(atypename, items, all)
|
||||||
|
all = vim9.bool(all)
|
||||||
|
|
||||||
|
-- # Search for members of structure "typename" in tags files.
|
||||||
|
-- # Return a list with resulting matches.
|
||||||
|
-- # Each match is a dictionary with "match" and "tagline" entries.
|
||||||
|
-- # When "all" is true find all, otherwise just return 1 if there is any member.
|
||||||
|
|
||||||
|
-- # Todo: What about local structures?
|
||||||
|
local fnames = vim9.fn.join(vim9.fn.map(vim9.fn.tagfiles(), function(_, v)
|
||||||
|
return vim9.fn.escape(v, ' \\#%')
|
||||||
|
end))
|
||||||
|
if fnames == '' then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
|
local typename = atypename
|
||||||
|
local qflist = {}
|
||||||
|
local cached = 0
|
||||||
|
local n = ''
|
||||||
|
if vim9.bool(vim9.prefix['Bang'](all)) then
|
||||||
|
n = '1'
|
||||||
|
if vim9.bool(vim9.fn.has_key(grepCache, typename)) then
|
||||||
|
qflist = vim9.index(grepCache, typename)
|
||||||
|
cached = 1
|
||||||
|
end
|
||||||
|
else
|
||||||
|
n = ''
|
||||||
|
end
|
||||||
|
if vim9.bool(vim9.prefix['Bang'](cached)) then
|
||||||
|
while 1 do
|
||||||
|
vim.api.nvim_command(
|
||||||
|
'silent! keepjumps noautocmd '
|
||||||
|
.. n
|
||||||
|
.. 'vimgrep '
|
||||||
|
.. '/\\t'
|
||||||
|
.. typename
|
||||||
|
.. '\\(\\t\\|$\\)/j '
|
||||||
|
.. fnames
|
||||||
|
)
|
||||||
|
|
||||||
|
qflist = vim9.fn.getqflist()
|
||||||
|
if vim9.fn.len(qflist) > 0 or vim9.fn.match(typename, '::') < 0 then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
-- # No match for "struct:context::name", remove "context::" and try again.
|
||||||
|
typename = vim9.fn.substitute(typename, ':[^:]*::', ':', '')
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.bool(vim9.prefix['Bang'](all)) then
|
||||||
|
-- # Store the result to be able to use it again later.
|
||||||
|
grepCache[vim9.index_expr(typename)] = qflist
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Skip over [...] items
|
||||||
|
local idx = 0
|
||||||
|
local target = ''
|
||||||
|
while 1 do
|
||||||
|
if idx >= vim9.fn.len(items) then
|
||||||
|
target = ''
|
||||||
|
break
|
||||||
|
end
|
||||||
|
if vim9.index(vim9.index(items, idx), 0) ~= '[' then
|
||||||
|
target = vim9.index(items, idx)
|
||||||
|
break
|
||||||
|
end
|
||||||
|
idx = idx + 1
|
||||||
|
end
|
||||||
|
-- # Put matching members in matches[].
|
||||||
|
local matches = {}
|
||||||
|
|
||||||
|
for _, l in vim9.iter(qflist) do
|
||||||
|
local memb = vim9.fn.matchstr(vim9.index(l, 'text'), '[^\\t]*')
|
||||||
|
if vim9.ops.RegexpMatches(memb, '^' .. target) then
|
||||||
|
-- # Skip matches local to another file.
|
||||||
|
if
|
||||||
|
vim9.fn.match(vim9.index(l, 'text'), '\tfile:') < 0
|
||||||
|
or vim9.fn.bufnr('%')
|
||||||
|
== vim9.fn.bufnr(vim9.fn.matchstr(vim9.index(l, 'text'), '\\t\\zs[^\\t]*'))
|
||||||
|
then
|
||||||
|
local item =
|
||||||
|
vim9.convert.decl_dict({ ['match'] = memb, ['tagline'] = vim9.index(l, 'text') })
|
||||||
|
|
||||||
|
-- # Add the kind of item.
|
||||||
|
local s =
|
||||||
|
vim9.fn.matchstr(vim9.index(l, 'text'), '\\t\\(kind:\\)\\=\\zs\\S\\ze\\(\\t\\|$\\)')
|
||||||
|
if s ~= '' then
|
||||||
|
item[vim9.index_expr('kind')] = s
|
||||||
|
if s == 'f' then
|
||||||
|
item[vim9.index_expr('match')] = memb .. '('
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim9.fn.add(matches, item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if vim9.fn.len(matches) > 0 then
|
||||||
|
-- # Skip over next [...] items
|
||||||
|
idx = idx + 1
|
||||||
|
while 1 do
|
||||||
|
if idx >= vim9.fn.len(items) then
|
||||||
|
return matches
|
||||||
|
end
|
||||||
|
if vim9.index(vim9.index(items, idx), 0) ~= '[' then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
idx = idx + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # More items following. For each of the possible members find the
|
||||||
|
-- # matching following members.
|
||||||
|
return SearchMembers(matches, vim9.slice(items, idx, nil), all)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- # Failed to find anything.
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
|
SearchMembers = function(matches, items, all)
|
||||||
|
all = vim9.bool(all)
|
||||||
|
|
||||||
|
-- # For matching members, find matches for following items.
|
||||||
|
-- # When "all" is true find all, otherwise just return 1 if there is any member.
|
||||||
|
local res = {}
|
||||||
|
|
||||||
|
for _, i in vim9.iter(vim9.fn.range(vim9.fn.len(matches))) do
|
||||||
|
local typename = ''
|
||||||
|
local line = ''
|
||||||
|
if vim9.bool(vim9.fn.has_key(vim9.index(matches, i), 'dict')) then
|
||||||
|
if vim9.bool(vim9.fn.has_key(vim9.index(vim9.index(matches, i), 'dict'), 'typename')) then
|
||||||
|
typename = vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'typename')
|
||||||
|
elseif vim9.bool(vim9.fn.has_key(vim9.index(vim9.index(matches, i), 'dict'), 'typeref')) then
|
||||||
|
typename = vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'typeref')
|
||||||
|
end
|
||||||
|
line = '\t' .. vim9.index(vim9.index(vim9.index(matches, i), 'dict'), 'cmd')
|
||||||
|
else
|
||||||
|
line = vim9.index(vim9.index(matches, i), 'tagline')
|
||||||
|
local eb = vim9.fn.matchend(line, '\\ttypename:')
|
||||||
|
local e = vim9.fn.charidx(line, eb)
|
||||||
|
if e < 0 then
|
||||||
|
eb = vim9.fn.matchend(line, '\\ttyperef:')
|
||||||
|
e = vim9.fn.charidx(line, eb)
|
||||||
|
end
|
||||||
|
if e > 0 then
|
||||||
|
-- # Use typename field
|
||||||
|
typename = vim9.fn.matchstr(line, '[^\\t]*', eb)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if typename ~= '' then
|
||||||
|
res = vim9.fn.extend(res, StructMembers(typename, items, all))
|
||||||
|
else
|
||||||
|
-- # Use the search command (the declaration itself).
|
||||||
|
local sb = vim9.fn.match(line, '\\t\\zs/^')
|
||||||
|
local s = vim9.fn.charidx(line, sb)
|
||||||
|
if s > 0 then
|
||||||
|
local e = vim9.fn.charidx(
|
||||||
|
line,
|
||||||
|
vim9.fn.match(line, '\\<' .. vim9.index(vim9.index(matches, i), 'match') .. '\\>', sb)
|
||||||
|
)
|
||||||
|
if e > 0 then
|
||||||
|
res =
|
||||||
|
vim9.fn.extend(res, Nextitem(vim9.slice(line, s, vim9.ops.Minus(e, 1)), items, 0, all))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if vim9.bool(vim9.ops.And(vim9.prefix['Bang'](all), vim9.fn.len(res) > 0)) then
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return res
|
||||||
|
end
|
||||||
|
|
||||||
|
-- #}}}1
|
||||||
|
|
||||||
|
-- # vim: noet sw=2 sts=2
|
||||||
|
return M
|
@@ -1,682 +1,8 @@
|
|||||||
" Vim completion script
|
" Generated vim file by vim9jit. Please do not edit
|
||||||
" Language: C
|
let s:path = expand("<script>")
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
let s:lua_path = fnamemodify(s:path, ":r") . ".lua"
|
||||||
" Last Change: 2020 Nov 14
|
let s:nvim_module = luaeval('require("_vim9script").autoload(_A)', s:lua_path)
|
||||||
|
|
||||||
let s:cpo_save = &cpo
|
function! ccomplete#Complete(findstart, abase) abort
|
||||||
set cpo&vim
|
return s:nvim_module.Complete(a:findstart, a:abase)
|
||||||
|
endfunction
|
||||||
" This function is used for the 'omnifunc' option.
|
|
||||||
func ccomplete#Complete(findstart, base)
|
|
||||||
if a:findstart
|
|
||||||
" Locate the start of the item, including ".", "->" and "[...]".
|
|
||||||
let line = getline('.')
|
|
||||||
let start = col('.') - 1
|
|
||||||
let lastword = -1
|
|
||||||
while start > 0
|
|
||||||
if line[start - 1] =~ '\w'
|
|
||||||
let start -= 1
|
|
||||||
elseif line[start - 1] =~ '\.'
|
|
||||||
if lastword == -1
|
|
||||||
let lastword = start
|
|
||||||
endif
|
|
||||||
let start -= 1
|
|
||||||
elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>'
|
|
||||||
if lastword == -1
|
|
||||||
let lastword = start
|
|
||||||
endif
|
|
||||||
let start -= 2
|
|
||||||
elseif line[start - 1] == ']'
|
|
||||||
" Skip over [...].
|
|
||||||
let n = 0
|
|
||||||
let start -= 1
|
|
||||||
while start > 0
|
|
||||||
let start -= 1
|
|
||||||
if line[start] == '['
|
|
||||||
if n == 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let n -= 1
|
|
||||||
elseif line[start] == ']' " nested []
|
|
||||||
let n += 1
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
else
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
" Return the column of the last word, which is going to be changed.
|
|
||||||
" Remember the text that comes before it in s:prepended.
|
|
||||||
if lastword == -1
|
|
||||||
let s:prepended = ''
|
|
||||||
return start
|
|
||||||
endif
|
|
||||||
let s:prepended = strpart(line, start, lastword - start)
|
|
||||||
return lastword
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Return list of matches.
|
|
||||||
|
|
||||||
let base = s:prepended . a:base
|
|
||||||
|
|
||||||
" Don't do anything for an empty base, would result in all the tags in the
|
|
||||||
" tags file.
|
|
||||||
if base == ''
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
|
|
||||||
" init cache for vimgrep to empty
|
|
||||||
let s:grepCache = {}
|
|
||||||
|
|
||||||
" Split item in words, keep empty word after "." or "->".
|
|
||||||
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
|
|
||||||
" We can't use split, because we need to skip nested [...].
|
|
||||||
" "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc.
|
|
||||||
let items = []
|
|
||||||
let s = 0
|
|
||||||
let arrays = 0
|
|
||||||
while 1
|
|
||||||
let e = match(base, '\.\|->\|\[', s)
|
|
||||||
if e < 0
|
|
||||||
if s == 0 || base[s - 1] != ']'
|
|
||||||
call add(items, strpart(base, s))
|
|
||||||
endif
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
if s == 0 || base[s - 1] != ']'
|
|
||||||
call add(items, strpart(base, s, e - s))
|
|
||||||
endif
|
|
||||||
if base[e] == '.'
|
|
||||||
let s = e + 1 " skip over '.'
|
|
||||||
elseif base[e] == '-'
|
|
||||||
let s = e + 2 " skip over '->'
|
|
||||||
else
|
|
||||||
" Skip over [...].
|
|
||||||
let n = 0
|
|
||||||
let s = e
|
|
||||||
let e += 1
|
|
||||||
while e < len(base)
|
|
||||||
if base[e] == ']'
|
|
||||||
if n == 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let n -= 1
|
|
||||||
elseif base[e] == '[' " nested [...]
|
|
||||||
let n += 1
|
|
||||||
endif
|
|
||||||
let e += 1
|
|
||||||
endwhile
|
|
||||||
let e += 1
|
|
||||||
call add(items, strpart(base, s, e - s))
|
|
||||||
let arrays += 1
|
|
||||||
let s = e
|
|
||||||
endif
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
if complete_check()
|
|
||||||
" return v:none
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Find the variable items[0].
|
|
||||||
" 1. in current function (like with "gd")
|
|
||||||
" 2. in tags file(s) (like with ":tag")
|
|
||||||
" 3. in current file (like with "gD")
|
|
||||||
let res = []
|
|
||||||
if searchdecl(items[0], 0, 1) == 0
|
|
||||||
" Found, now figure out the type.
|
|
||||||
" TODO: join previous line if it makes sense
|
|
||||||
let line = getline('.')
|
|
||||||
let col = col('.')
|
|
||||||
if stridx(strpart(line, 0, col), ';') != -1
|
|
||||||
" Handle multiple declarations on the same line.
|
|
||||||
let col2 = col - 1
|
|
||||||
while line[col2] != ';'
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
let col2 -= 1
|
|
||||||
endwhile
|
|
||||||
let line = strpart(line, col2 + 1)
|
|
||||||
let col -= col2
|
|
||||||
endif
|
|
||||||
if stridx(strpart(line, 0, col), ',') != -1
|
|
||||||
" Handle multiple declarations on the same line in a function
|
|
||||||
" declaration.
|
|
||||||
let col2 = col - 1
|
|
||||||
while line[col2] != ','
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
let col2 -= 1
|
|
||||||
endwhile
|
|
||||||
if strpart(line, col2 + 1, col - col2 - 1) =~ ' *[^ ][^ ]* *[^ ]'
|
|
||||||
let line = strpart(line, col2 + 1)
|
|
||||||
let col -= col2
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if len(items) == 1
|
|
||||||
" Completing one word and it's a local variable: May add '[', '.' or
|
|
||||||
" '->'.
|
|
||||||
let match = items[0]
|
|
||||||
let kind = 'v'
|
|
||||||
if match(line, '\<' . match . '\s*\[') > 0
|
|
||||||
let match .= '['
|
|
||||||
else
|
|
||||||
let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1)
|
|
||||||
if len(res) > 0
|
|
||||||
" There are members, thus add "." or "->".
|
|
||||||
if match(line, '\*[ \t(]*' . match . '\>') > 0
|
|
||||||
let match .= '->'
|
|
||||||
else
|
|
||||||
let match .= '.'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}]
|
|
||||||
elseif len(items) == arrays + 1
|
|
||||||
" Completing one word and it's a local array variable: build tagline
|
|
||||||
" from declaration line
|
|
||||||
let match = items[0]
|
|
||||||
let kind = 'v'
|
|
||||||
let tagline = "\t/^" . line . '$/'
|
|
||||||
let res = [{'match': match, 'tagline' : tagline, 'kind' : kind, 'info' : line}]
|
|
||||||
else
|
|
||||||
" Completing "var.", "var.something", etc.
|
|
||||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if len(items) == 1 || len(items) == arrays + 1
|
|
||||||
" Only one part, no "." or "->": complete from tags file.
|
|
||||||
if len(items) == 1
|
|
||||||
let tags = taglist('^' . base)
|
|
||||||
else
|
|
||||||
let tags = taglist('^' . items[0] . '$')
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Remove members, these can't appear without something in front.
|
|
||||||
call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
|
|
||||||
|
|
||||||
" Remove static matches in other files.
|
|
||||||
call filter(tags, '!has_key(v:val, "static") || !v:val["static"] || bufnr("%") == bufnr(v:val["filename"])')
|
|
||||||
|
|
||||||
call extend(res, map(tags, 's:Tag2item(v:val)'))
|
|
||||||
endif
|
|
||||||
|
|
||||||
if len(res) == 0
|
|
||||||
" Find the variable in the tags file(s)
|
|
||||||
let diclist = taglist('^' . items[0] . '$')
|
|
||||||
|
|
||||||
" Remove members, these can't appear without something in front.
|
|
||||||
call filter(diclist, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
|
|
||||||
|
|
||||||
let res = []
|
|
||||||
for i in range(len(diclist))
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
" New ctags has the "typeref" field. Patched version has "typename".
|
|
||||||
if has_key(diclist[i], 'typename')
|
|
||||||
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1))
|
|
||||||
elseif has_key(diclist[i], 'typeref')
|
|
||||||
call extend(res, s:StructMembers(diclist[i]['typeref'], items[1:], 1))
|
|
||||||
endif
|
|
||||||
|
|
||||||
" For a variable use the command, which must be a search pattern that
|
|
||||||
" shows the declaration of the variable.
|
|
||||||
if diclist[i]['kind'] == 'v'
|
|
||||||
let line = diclist[i]['cmd']
|
|
||||||
if line[0] == '/' && line[1] == '^'
|
|
||||||
let col = match(line, '\<' . items[0] . '\>')
|
|
||||||
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
|
|
||||||
if len(res) == 0 && searchdecl(items[0], 1) == 0
|
|
||||||
" Found, now figure out the type.
|
|
||||||
" TODO: join previous line if it makes sense
|
|
||||||
let line = getline('.')
|
|
||||||
let col = col('.')
|
|
||||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the last item(s) are [...] they need to be added to the matches.
|
|
||||||
let last = len(items) - 1
|
|
||||||
let brackets = ''
|
|
||||||
while last >= 0
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
if items[last][0] != '['
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let brackets = items[last] . brackets
|
|
||||||
let last -= 1
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func s:GetAddition(line, match, memarg, bracket)
|
|
||||||
" Guess if the item is an array.
|
|
||||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
|
||||||
return '['
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Check if the item has members.
|
|
||||||
if len(s:SearchMembers(a:memarg, [''], 0)) > 0
|
|
||||||
" If there is a '*' before the name use "->".
|
|
||||||
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
|
|
||||||
return '->'
|
|
||||||
else
|
|
||||||
return '.'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
return ''
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Turn the tag info "val" into an item for completion.
|
|
||||||
" "val" is is an item in the list returned by taglist().
|
|
||||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
|
||||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
|
||||||
func s:Tag2item(val)
|
|
||||||
let res = {'match': a:val['name']}
|
|
||||||
|
|
||||||
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
|
||||||
|
|
||||||
let s = s:Dict2info(a:val)
|
|
||||||
if s != ''
|
|
||||||
let res['info'] = s
|
|
||||||
endif
|
|
||||||
|
|
||||||
let res['tagline'] = ''
|
|
||||||
if has_key(a:val, "kind")
|
|
||||||
let kind = a:val['kind']
|
|
||||||
let res['kind'] = kind
|
|
||||||
if kind == 'v'
|
|
||||||
let res['tagline'] = "\t" . a:val['cmd']
|
|
||||||
let res['dict'] = a:val
|
|
||||||
elseif kind == 'f'
|
|
||||||
let res['match'] = a:val['name'] . '('
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return res
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Use all the items in dictionary for the "info" entry.
|
|
||||||
func s:Dict2info(dict)
|
|
||||||
let info = ''
|
|
||||||
for k in sort(keys(a:dict))
|
|
||||||
if complete_check()
|
|
||||||
return info
|
|
||||||
endif
|
|
||||||
let info .= k . repeat(' ', 10 - len(k))
|
|
||||||
if k == 'cmd'
|
|
||||||
let info .= substitute(matchstr(a:dict['cmd'], '/^\s*\zs.*\ze$/'), '\\\(.\)', '\1', 'g')
|
|
||||||
else
|
|
||||||
let info .= a:dict[k]
|
|
||||||
endif
|
|
||||||
let info .= "\n"
|
|
||||||
endfor
|
|
||||||
return info
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Parse a tag line and return a dictionary with items like taglist()
|
|
||||||
func s:ParseTagline(line)
|
|
||||||
let l = split(a:line, "\t")
|
|
||||||
let d = {}
|
|
||||||
if len(l) >= 3
|
|
||||||
let d['name'] = l[0]
|
|
||||||
let d['filename'] = l[1]
|
|
||||||
let d['cmd'] = l[2]
|
|
||||||
let n = 2
|
|
||||||
if l[2] =~ '^/'
|
|
||||||
" Find end of cmd, it may contain Tabs.
|
|
||||||
while n < len(l) && l[n] !~ '/;"$'
|
|
||||||
let n += 1
|
|
||||||
let d['cmd'] .= " " . l[n]
|
|
||||||
endwhile
|
|
||||||
endif
|
|
||||||
for i in range(n + 1, len(l) - 1)
|
|
||||||
if complete_check()
|
|
||||||
return d
|
|
||||||
endif
|
|
||||||
if l[i] == 'file:'
|
|
||||||
let d['static'] = 1
|
|
||||||
elseif l[i] !~ ':'
|
|
||||||
let d['kind'] = l[i]
|
|
||||||
else
|
|
||||||
let d[matchstr(l[i], '[^:]*')] = matchstr(l[i], ':\zs.*')
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
endif
|
|
||||||
|
|
||||||
return d
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Turn a match item "val" into an item for completion.
|
|
||||||
" "val['match']" is the matching item.
|
|
||||||
" "val['tagline']" is the tagline in which the last part was found.
|
|
||||||
func s:Tagline2item(val, brackets)
|
|
||||||
let line = a:val['tagline']
|
|
||||||
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
|
||||||
let res = {'word': a:val['match'] . a:brackets . add }
|
|
||||||
|
|
||||||
if has_key(a:val, 'info')
|
|
||||||
" Use info from Tag2item().
|
|
||||||
let res['info'] = a:val['info']
|
|
||||||
else
|
|
||||||
" Parse the tag line and add each part to the "info" entry.
|
|
||||||
let s = s:Dict2info(s:ParseTagline(line))
|
|
||||||
if s != ''
|
|
||||||
let res['info'] = s
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has_key(a:val, 'kind')
|
|
||||||
let res['kind'] = a:val['kind']
|
|
||||||
elseif add == '('
|
|
||||||
let res['kind'] = 'f'
|
|
||||||
else
|
|
||||||
let s = matchstr(line, '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
|
|
||||||
if s != ''
|
|
||||||
let res['kind'] = s
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has_key(a:val, 'extra')
|
|
||||||
let res['menu'] = a:val['extra']
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Isolate the command after the tag and filename.
|
|
||||||
let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)')
|
|
||||||
if s != ''
|
|
||||||
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
|
|
||||||
endif
|
|
||||||
return res
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Turn a command from a tag line to something that is useful in the menu
|
|
||||||
func s:Tagcmd2extra(cmd, name, fname)
|
|
||||||
if a:cmd =~ '^/^'
|
|
||||||
" The command is a search command, useful to see what it is.
|
|
||||||
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
|
|
||||||
let x = substitute(x, '\<' . a:name . '\>', '@@', '')
|
|
||||||
let x = substitute(x, '\\\(.\)', '\1', 'g')
|
|
||||||
let x = x . ' - ' . a:fname
|
|
||||||
elseif a:cmd =~ '^\d*$'
|
|
||||||
" The command is a line number, the file name is more useful.
|
|
||||||
let x = a:fname . ' - ' . a:cmd
|
|
||||||
else
|
|
||||||
" Not recognized, use command and file name.
|
|
||||||
let x = a:cmd . ' - ' . a:fname
|
|
||||||
endif
|
|
||||||
return x
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" Find composing type in "lead" and match items[0] with it.
|
|
||||||
" Repeat this recursively for items[1], if it's there.
|
|
||||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
|
||||||
" Return the list of matches.
|
|
||||||
func s:Nextitem(lead, items, depth, all)
|
|
||||||
|
|
||||||
" Use the text up to the variable name and split it in tokens.
|
|
||||||
let tokens = split(a:lead, '\s\+\|\<')
|
|
||||||
|
|
||||||
" Try to recognize the type of the variable. This is rough guessing...
|
|
||||||
let res = []
|
|
||||||
for tidx in range(len(tokens))
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Skip tokens starting with a non-ID character.
|
|
||||||
if tokens[tidx] !~ '^\h'
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Recognize "struct foobar" and "union foobar".
|
|
||||||
" Also do "class foobar" when it's C++ after all (doesn't work very well
|
|
||||||
" though).
|
|
||||||
if (tokens[tidx] == 'struct' || tokens[tidx] == 'union' || tokens[tidx] == 'class') && tidx + 1 < len(tokens)
|
|
||||||
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all)
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
|
|
||||||
" TODO: add more reserved words
|
|
||||||
if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Use the tags file to find out if this is a typedef.
|
|
||||||
let diclist = taglist('^' . tokens[tidx] . '$')
|
|
||||||
for tagidx in range(len(diclist))
|
|
||||||
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
|
|
||||||
let item = diclist[tagidx]
|
|
||||||
|
|
||||||
" New ctags has the "typeref" field. Patched version has "typename".
|
|
||||||
if has_key(item, 'typeref')
|
|
||||||
call extend(res, s:StructMembers(item['typeref'], a:items, a:all))
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
if has_key(item, 'typename')
|
|
||||||
call extend(res, s:StructMembers(item['typename'], a:items, a:all))
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Only handle typedefs here.
|
|
||||||
if item['kind'] != 't'
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Skip matches local to another file.
|
|
||||||
if has_key(item, 'static') && item['static'] && bufnr('%') != bufnr(item['filename'])
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
" For old ctags we recognize "typedef struct aaa" and
|
|
||||||
" "typedef union bbb" in the tags file command.
|
|
||||||
let cmd = item['cmd']
|
|
||||||
let ei = matchend(cmd, 'typedef\s\+')
|
|
||||||
if ei > 1
|
|
||||||
let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
|
|
||||||
if len(cmdtokens) > 1
|
|
||||||
if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union' || cmdtokens[0] == 'class'
|
|
||||||
let name = ''
|
|
||||||
" Use the first identifier after the "struct" or "union"
|
|
||||||
for ti in range(len(cmdtokens) - 1)
|
|
||||||
if cmdtokens[ti] =~ '^\w'
|
|
||||||
let name = cmdtokens[ti]
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
if name != ''
|
|
||||||
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all))
|
|
||||||
endif
|
|
||||||
elseif a:depth < 10
|
|
||||||
" Could be "typedef other_T some_T".
|
|
||||||
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
if len(res) > 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return res
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
|
|
||||||
" Search for members of structure "typename" in tags files.
|
|
||||||
" Return a list with resulting matches.
|
|
||||||
" Each match is a dictionary with "match" and "tagline" entries.
|
|
||||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
|
||||||
" member.
|
|
||||||
func s:StructMembers(typename, items, all)
|
|
||||||
" Todo: What about local structures?
|
|
||||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
|
|
||||||
if fnames == ''
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
|
|
||||||
let typename = a:typename
|
|
||||||
let qflist = []
|
|
||||||
let cached = 0
|
|
||||||
if a:all == 0
|
|
||||||
let n = '1' " stop at first found match
|
|
||||||
if has_key(s:grepCache, a:typename)
|
|
||||||
let qflist = s:grepCache[a:typename]
|
|
||||||
let cached = 1
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
let n = ''
|
|
||||||
endif
|
|
||||||
if !cached
|
|
||||||
while 1
|
|
||||||
if complete_check()
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
exe 'silent! keepj noautocmd ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
|
|
||||||
|
|
||||||
let qflist = getqflist()
|
|
||||||
if len(qflist) > 0 || match(typename, "::") < 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
" No match for "struct:context::name", remove "context::" and try again.
|
|
||||||
let typename = substitute(typename, ':[^:]*::', ':', '')
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
if a:all == 0
|
|
||||||
" Store the result to be able to use it again later.
|
|
||||||
let s:grepCache[a:typename] = qflist
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Skip over [...] items
|
|
||||||
let idx = 0
|
|
||||||
while 1
|
|
||||||
if complete_check()
|
|
||||||
return []
|
|
||||||
endif
|
|
||||||
if idx >= len(a:items)
|
|
||||||
let target = '' " No further items, matching all members
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
if a:items[idx][0] != '['
|
|
||||||
let target = a:items[idx]
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let idx += 1
|
|
||||||
endwhile
|
|
||||||
" Put matching members in matches[].
|
|
||||||
let matches = []
|
|
||||||
for l in qflist
|
|
||||||
let memb = matchstr(l['text'], '[^\t]*')
|
|
||||||
if memb =~ '^' . target
|
|
||||||
" Skip matches local to another file.
|
|
||||||
if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*'))
|
|
||||||
let item = {'match': memb, 'tagline': l['text']}
|
|
||||||
|
|
||||||
" Add the kind of item.
|
|
||||||
let s = matchstr(l['text'], '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
|
|
||||||
if s != ''
|
|
||||||
let item['kind'] = s
|
|
||||||
if s == 'f'
|
|
||||||
let item['match'] = memb . '('
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(matches, item)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
|
|
||||||
if len(matches) > 0
|
|
||||||
" Skip over next [...] items
|
|
||||||
let idx += 1
|
|
||||||
while 1
|
|
||||||
if complete_check()
|
|
||||||
return matches
|
|
||||||
endif
|
|
||||||
if idx >= len(a:items)
|
|
||||||
return matches " No further items, return the result.
|
|
||||||
endif
|
|
||||||
if a:items[idx][0] != '['
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
let idx += 1
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
" More items following. For each of the possible members find the
|
|
||||||
" matching following members.
|
|
||||||
return s:SearchMembers(matches, a:items[idx :], a:all)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Failed to find anything.
|
|
||||||
return []
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
" For matching members, find matches for following items.
|
|
||||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
|
||||||
" member.
|
|
||||||
func s:SearchMembers(matches, items, all)
|
|
||||||
let res = []
|
|
||||||
for i in range(len(a:matches))
|
|
||||||
if complete_check()
|
|
||||||
return res
|
|
||||||
endif
|
|
||||||
let typename = ''
|
|
||||||
if has_key(a:matches[i], 'dict')
|
|
||||||
if has_key(a:matches[i].dict, 'typename')
|
|
||||||
let typename = a:matches[i].dict['typename']
|
|
||||||
elseif has_key(a:matches[i].dict, 'typeref')
|
|
||||||
let typename = a:matches[i].dict['typeref']
|
|
||||||
endif
|
|
||||||
let line = "\t" . a:matches[i].dict['cmd']
|
|
||||||
else
|
|
||||||
let line = a:matches[i]['tagline']
|
|
||||||
let e = matchend(line, '\ttypename:')
|
|
||||||
if e < 0
|
|
||||||
let e = matchend(line, '\ttyperef:')
|
|
||||||
endif
|
|
||||||
if e > 0
|
|
||||||
" Use typename field
|
|
||||||
let typename = matchstr(line, '[^\t]*', e)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if typename != ''
|
|
||||||
call extend(res, s:StructMembers(typename, a:items, a:all))
|
|
||||||
else
|
|
||||||
" Use the search command (the declaration itself).
|
|
||||||
let s = match(line, '\t\zs/^')
|
|
||||||
if s > 0
|
|
||||||
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
|
|
||||||
if e > 0
|
|
||||||
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
if a:all == 0 && len(res) > 0
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endfor
|
|
||||||
return res
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
let &cpo = s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
|
|
||||||
" vim: noet sw=2 sts=2
|
|
||||||
|
3
runtime/autoload/dist/vim.vim
vendored
3
runtime/autoload/dist/vim.vim
vendored
@@ -18,9 +18,6 @@ endif
|
|||||||
if !has('vim9script')
|
if !has('vim9script')
|
||||||
function dist#vim#IsSafeExecutable(filetype, executable)
|
function dist#vim#IsSafeExecutable(filetype, executable)
|
||||||
let cwd = getcwd()
|
let cwd = getcwd()
|
||||||
if empty(exepath(a:executable))
|
|
||||||
return v:false
|
|
||||||
endif
|
|
||||||
return get(g:, a:filetype .. '_exec', get(g:, 'plugin_exec', 0)) &&
|
return get(g:, a:filetype .. '_exec', get(g:, 'plugin_exec', 0)) &&
|
||||||
\ (fnamemodify(exepath(a:executable), ':p:h') !=# cwd
|
\ (fnamemodify(exepath(a:executable), ':p:h') !=# cwd
|
||||||
\ || (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1 &&
|
\ || (split($PATH, has('win32') ? ';' : ':')->index(cwd) != -1 &&
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
" Vim autoload file for editing compressed files.
|
" Vim autoload file for editing compressed files.
|
||||||
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
||||||
" Last Change: 2024 Nov 25
|
" Last Change: 2023 Aug 10
|
||||||
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||||
|
|
||||||
" These functions are used by the gzip plugin.
|
" These functions are used by the gzip plugin.
|
||||||
@@ -148,9 +148,6 @@ fun gzip#read(cmd)
|
|||||||
else
|
else
|
||||||
let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<")
|
let fname = escape(expand("%:r"), " \t\n*?[{`$\\%#'\"|!<")
|
||||||
endif
|
endif
|
||||||
if filereadable(undofile(expand("%")))
|
|
||||||
exe "sil rundo " . fnameescape(undofile(expand("%")))
|
|
||||||
endif
|
|
||||||
if &verbose >= 8
|
if &verbose >= 8
|
||||||
execute "doau BufReadPost " . fname
|
execute "doau BufReadPost " . fname
|
||||||
else
|
else
|
||||||
|
@@ -1,26 +0,0 @@
|
|||||||
" Vim autoload file.
|
|
||||||
" Language: Hare
|
|
||||||
" Maintainer: Amelia Clarke <selene@perilune.dev>
|
|
||||||
" Last Updated: 2024-05-10
|
|
||||||
" Upstream: https://git.sr.ht/~sircmpwn/hare.vim
|
|
||||||
|
|
||||||
" Attempt to find the directory for a given Hare module.
|
|
||||||
function hare#FindModule(str)
|
|
||||||
let path = substitute(trim(a:str, ':', 2), '::', '/', 'g')
|
|
||||||
let dir = finddir(path)
|
|
||||||
while !empty(path) && empty(dir)
|
|
||||||
let path = substitute(path, '/\?\h\w*$', '', '')
|
|
||||||
let dir = finddir(path)
|
|
||||||
endwhile
|
|
||||||
return dir
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" Return the value of HAREPATH if it exists. Otherwise use a reasonable default.
|
|
||||||
function hare#GetPath()
|
|
||||||
if empty($HAREPATH)
|
|
||||||
return '/usr/src/hare/stdlib,/usr/src/hare/third-party'
|
|
||||||
endif
|
|
||||||
return substitute($HAREPATH, ':', ',', 'g')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" vim: et sts=2 sw=2 ts=8
|
|
@@ -1,55 +0,0 @@
|
|||||||
" Language: HCL
|
|
||||||
" Maintainer: Gregory Anders
|
|
||||||
" Last Change: 2024-09-03
|
|
||||||
" Based on: https://github.com/hashivim/vim-terraform
|
|
||||||
" License: ISC
|
|
||||||
"
|
|
||||||
" Copyright (c) 2014-2016 Mark Cornick <mark@markcornick.com>
|
|
||||||
"
|
|
||||||
" Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
||||||
" with or without fee is hereby granted, provided that the above copyright notice
|
|
||||||
" and this permission notice appear in all copies.
|
|
||||||
"
|
|
||||||
" THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
||||||
" FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
||||||
" OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
||||||
" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
||||||
" THIS SOFTWARE.
|
|
||||||
|
|
||||||
function! hcl#indentexpr(lnum)
|
|
||||||
" Beginning of the file should have no indent
|
|
||||||
if a:lnum == 0
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Usual case is to continue at the same indent as the previous non-blank line.
|
|
||||||
let prevlnum = prevnonblank(a:lnum-1)
|
|
||||||
let thisindent = indent(prevlnum)
|
|
||||||
|
|
||||||
" If that previous line is a non-comment ending in [ { (, increase the
|
|
||||||
" indent level.
|
|
||||||
let prevline = getline(prevlnum)
|
|
||||||
if prevline !~# '^\s*\(#\|//\)' && prevline =~# '[\[{\(]\s*$'
|
|
||||||
let thisindent += &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the current line ends a block, decrease the indent level.
|
|
||||||
let thisline = getline(a:lnum)
|
|
||||||
if thisline =~# '^\s*[\)}\]]'
|
|
||||||
let thisindent -= &shiftwidth
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line starts a block comment /*, increase by one
|
|
||||||
if prevline =~# '/\*'
|
|
||||||
let thisindent += 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" If the previous line ends a block comment */, decrease by one
|
|
||||||
if prevline =~# '\*/'
|
|
||||||
let thisindent -= 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
return thisindent
|
|
||||||
endfunction
|
|
40
runtime/autoload/health.vim
Normal file
40
runtime/autoload/health.vim
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
function! s:deprecate(type) abort
|
||||||
|
let deprecate = v:lua.vim.deprecate('health#report_' . a:type, 'vim.health.' . a:type, '0.11')
|
||||||
|
redraw | echo 'Running healthchecks...'
|
||||||
|
if deprecate isnot v:null
|
||||||
|
call v:lua.vim.health.warn(deprecate)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! health#report_start(name) abort
|
||||||
|
call v:lua.vim.health.start(a:name)
|
||||||
|
call s:deprecate('start')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! health#report_info(msg) abort
|
||||||
|
call v:lua.vim.health.info(a:msg)
|
||||||
|
call s:deprecate('info')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! health#report_ok(msg) abort
|
||||||
|
call v:lua.vim.health.ok(a:msg)
|
||||||
|
call s:deprecate('ok')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! health#report_warn(msg, ...) abort
|
||||||
|
if a:0 > 0
|
||||||
|
call v:lua.vim.health.warn(a:msg, a:1)
|
||||||
|
else
|
||||||
|
call v:lua.vim.health.warn(a:msg)
|
||||||
|
endif
|
||||||
|
call s:deprecate('warn')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! health#report_error(msg, ...) abort
|
||||||
|
if a:0 > 0
|
||||||
|
call v:lua.vim.health.error(a:msg, a:1)
|
||||||
|
else
|
||||||
|
call v:lua.vim.health.error(a:msg)
|
||||||
|
endif
|
||||||
|
call s:deprecate('error')
|
||||||
|
endfunction
|
@@ -1,192 +0,0 @@
|
|||||||
" HTML folding script, :h ft-html-plugin
|
|
||||||
" Latest Change: 2025 May 10
|
|
||||||
" Original Author: Aliaksei Budavei <0x000c70@gmail.com>
|
|
||||||
|
|
||||||
function! htmlfold#MapBalancedTags() abort
|
|
||||||
" Describe only _a capturable-name prefix_ for start and end patterns of
|
|
||||||
" a tag so that start tags with attributes spanning across lines can also be
|
|
||||||
" matched with a single call of "getline()".
|
|
||||||
let tag = '\m\c</\=\([0-9A-Za-z-]\+\)'
|
|
||||||
let names = []
|
|
||||||
let pairs = []
|
|
||||||
let ends = []
|
|
||||||
let pos = getpos('.')
|
|
||||||
|
|
||||||
try
|
|
||||||
call cursor(1, 1)
|
|
||||||
let [lnum, cnum] = searchpos(tag, 'cnW')
|
|
||||||
|
|
||||||
" Pair up nearest non-inlined tags in scope.
|
|
||||||
while lnum > 0
|
|
||||||
let name_attr = synIDattr(synID(lnum, cnum, 0), 'name')
|
|
||||||
|
|
||||||
if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag'
|
|
||||||
let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
|
|
||||||
|
|
||||||
if !empty(name)
|
|
||||||
call insert(names, tolower(name), 0)
|
|
||||||
call insert(pairs, [lnum, -1], 0)
|
|
||||||
endif
|
|
||||||
elseif name_attr ==# 'htmlEndTag'
|
|
||||||
let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
|
|
||||||
|
|
||||||
if !empty(name)
|
|
||||||
let idx = index(names, tolower(name))
|
|
||||||
|
|
||||||
if idx >= 0
|
|
||||||
" Dismiss inlined balanced tags and opened-only tags.
|
|
||||||
if pairs[idx][0] != lnum
|
|
||||||
let pairs[idx][1] = lnum
|
|
||||||
call add(ends, lnum)
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Claim a pair.
|
|
||||||
let names[: idx] = repeat([''], (idx + 1))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Advance the cursor, at "<", past "</a", "<a>", etc.
|
|
||||||
call cursor(lnum, (cnum + 3))
|
|
||||||
let [lnum, cnum] = searchpos(tag, 'cnW')
|
|
||||||
endwhile
|
|
||||||
finally
|
|
||||||
call setpos('.', pos)
|
|
||||||
endtry
|
|
||||||
|
|
||||||
if empty(ends)
|
|
||||||
return {}
|
|
||||||
endif
|
|
||||||
|
|
||||||
let folds = {}
|
|
||||||
let pending_end = ends[0]
|
|
||||||
let level = 0
|
|
||||||
|
|
||||||
while !empty(pairs)
|
|
||||||
let [start, end] = remove(pairs, -1)
|
|
||||||
|
|
||||||
if end < 0
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
if start >= pending_end
|
|
||||||
" Mark a sibling tag.
|
|
||||||
call remove(ends, 0)
|
|
||||||
|
|
||||||
while start >= ends[0]
|
|
||||||
" Mark a parent tag.
|
|
||||||
call remove(ends, 0)
|
|
||||||
let level -= 1
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
let pending_end = ends[0]
|
|
||||||
else
|
|
||||||
" Mark a child tag.
|
|
||||||
let level += 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Flatten the innermost inlined folds.
|
|
||||||
let folds[start] = get(folds, start, ('>' . level))
|
|
||||||
let folds[end] = get(folds, end, ('<' . level))
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
return folds
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" See ":help vim9-mix".
|
|
||||||
if !has("vim9script")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
def! g:htmlfold#MapBalancedTags(): dict<string>
|
|
||||||
# Describe only _a capturable-name prefix_ for start and end patterns of
|
|
||||||
# a tag so that start tags with attributes spanning across lines can also be
|
|
||||||
# matched with a single call of "getline()".
|
|
||||||
const tag: string = '\m\c</\=\([0-9A-Za-z-]\+\)'
|
|
||||||
var names: list<string> = []
|
|
||||||
var pairs: list<list<number>> = []
|
|
||||||
var ends: list<number> = []
|
|
||||||
const pos: list<number> = getpos('.')
|
|
||||||
|
|
||||||
try
|
|
||||||
cursor(1, 1)
|
|
||||||
var [lnum: number, cnum: number] = searchpos(tag, 'cnW')
|
|
||||||
|
|
||||||
# Pair up nearest non-inlined tags in scope.
|
|
||||||
while lnum > 0
|
|
||||||
const name_attr: string = synIDattr(synID(lnum, cnum, 0), 'name')
|
|
||||||
|
|
||||||
if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag'
|
|
||||||
const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
|
|
||||||
|
|
||||||
if !empty(name)
|
|
||||||
insert(names, tolower(name), 0)
|
|
||||||
insert(pairs, [lnum, -1], 0)
|
|
||||||
endif
|
|
||||||
elseif name_attr ==# 'htmlEndTag'
|
|
||||||
const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '')
|
|
||||||
|
|
||||||
if !empty(name)
|
|
||||||
const idx: number = index(names, tolower(name))
|
|
||||||
|
|
||||||
if idx >= 0
|
|
||||||
# Dismiss inlined balanced tags and opened-only tags.
|
|
||||||
if pairs[idx][0] != lnum
|
|
||||||
pairs[idx][1] = lnum
|
|
||||||
add(ends, lnum)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Claim a pair.
|
|
||||||
names[: idx] = repeat([''], (idx + 1))
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Advance the cursor, at "<", past "</a", "<a>", etc.
|
|
||||||
cursor(lnum, (cnum + 3))
|
|
||||||
[lnum, cnum] = searchpos(tag, 'cnW')
|
|
||||||
endwhile
|
|
||||||
finally
|
|
||||||
setpos('.', pos)
|
|
||||||
endtry
|
|
||||||
|
|
||||||
if empty(ends)
|
|
||||||
return {}
|
|
||||||
endif
|
|
||||||
|
|
||||||
var folds: dict<string> = {}
|
|
||||||
var pending_end: number = ends[0]
|
|
||||||
var level: number = 0
|
|
||||||
|
|
||||||
while !empty(pairs)
|
|
||||||
const [start: number, end: number] = remove(pairs, -1)
|
|
||||||
|
|
||||||
if end < 0
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
|
|
||||||
if start >= pending_end
|
|
||||||
# Mark a sibling tag.
|
|
||||||
remove(ends, 0)
|
|
||||||
|
|
||||||
while start >= ends[0]
|
|
||||||
# Mark a parent tag.
|
|
||||||
remove(ends, 0)
|
|
||||||
level -= 1
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
pending_end = ends[0]
|
|
||||||
else
|
|
||||||
# Mark a child tag.
|
|
||||||
level += 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Flatten the innermost inlined folds.
|
|
||||||
folds[start] = get(folds, start, ('>' .. level))
|
|
||||||
folds[end] = get(folds, end, ('<' .. level))
|
|
||||||
endwhile
|
|
||||||
|
|
||||||
return folds
|
|
||||||
enddef
|
|
||||||
|
|
||||||
" vim: fdm=syntax sw=2 ts=8 noet
|
|
@@ -1,92 +0,0 @@
|
|||||||
" Vim formatting plugin file
|
|
||||||
" Language: Java
|
|
||||||
" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com>
|
|
||||||
" Repository: https://github.com/zzzyxwvut/java-vim.git
|
|
||||||
" Last Change: 2024 Sep 26
|
|
||||||
|
|
||||||
" Documented in ":help ft-java-plugin".
|
|
||||||
if &cp || exists("g:loaded_javaformat") || exists("g:java_ignore_javadoc") || exists("g:java_ignore_markdown")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
let g:loaded_javaformat = 1
|
|
||||||
|
|
||||||
"""" STRIVE TO REMAIN COMPATIBLE FOR AT LEAST VIM 7.0.
|
|
||||||
|
|
||||||
function! javaformat#RemoveCommonMarkdownWhitespace() abort
|
|
||||||
if mode() != 'n'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
let pattern = '\(^\s*///\)\(\s*\)\(.*\)'
|
|
||||||
|
|
||||||
" E121 for v:numbermax before v8.2.2388.
|
|
||||||
" E15 for expr-<< before v8.2.5003.
|
|
||||||
let common = 0x7fffffff
|
|
||||||
let comments = []
|
|
||||||
|
|
||||||
for n in range(v:lnum, (v:lnum + v:count - 1))
|
|
||||||
let parts = matchlist(getline(n), pattern)
|
|
||||||
let whitespace = get(parts, 2, '')
|
|
||||||
let nonwhitespace = get(parts, 3, '')
|
|
||||||
|
|
||||||
if !empty(whitespace)
|
|
||||||
let common = min([common, strlen(whitespace)])
|
|
||||||
elseif !empty(nonwhitespace) || empty(parts)
|
|
||||||
" No whitespace prefix or not a Markdown comment.
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(comments, [whitespace, parts[1], nonwhitespace])
|
|
||||||
endfor
|
|
||||||
|
|
||||||
let cursor = v:lnum
|
|
||||||
|
|
||||||
for line in comments
|
|
||||||
call setline(cursor, join(line[1 :], strpart(line[0], common)))
|
|
||||||
let cursor += 1
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return 0
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" See ":help vim9-mix".
|
|
||||||
if !has("vim9script")
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
def! g:javaformat#RemoveCommonMarkdownWhitespace(): number
|
|
||||||
if mode() != 'n'
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
const pattern: string = '\(^\s*///\)\(\s*\)\(.*\)'
|
|
||||||
var common: number = v:numbermax
|
|
||||||
var comments: list<list<string>> = []
|
|
||||||
|
|
||||||
for n in range(v:lnum, (v:lnum + v:count - 1))
|
|
||||||
const parts: list<string> = matchlist(getline(n), pattern)
|
|
||||||
const whitespace: string = get(parts, 2, '')
|
|
||||||
const nonwhitespace: string = get(parts, 3, '')
|
|
||||||
|
|
||||||
if !empty(whitespace)
|
|
||||||
common = min([common, strlen(whitespace)])
|
|
||||||
elseif !empty(nonwhitespace) || empty(parts)
|
|
||||||
# No whitespace prefix or not a Markdown comment.
|
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
|
|
||||||
add(comments, [whitespace, parts[1], nonwhitespace])
|
|
||||||
endfor
|
|
||||||
|
|
||||||
var cursor: number = v:lnum
|
|
||||||
|
|
||||||
for line in comments
|
|
||||||
setline(cursor, join(line[1 :], strpart(line[0], common)))
|
|
||||||
cursor += 1
|
|
||||||
endfor
|
|
||||||
|
|
||||||
return 0
|
|
||||||
enddef
|
|
||||||
|
|
||||||
" vim: fdm=syntax sw=4 ts=8 noet sta
|
|
@@ -361,7 +361,7 @@ endfunction
|
|||||||
let s:MSGPACK_STANDARD_TYPES = {
|
let s:MSGPACK_STANDARD_TYPES = {
|
||||||
\type(0): 'integer',
|
\type(0): 'integer',
|
||||||
\type(0.0): 'float',
|
\type(0.0): 'float',
|
||||||
\type(''): 'string',
|
\type(''): 'binary',
|
||||||
\type([]): 'array',
|
\type([]): 'array',
|
||||||
\type({}): 'map',
|
\type({}): 'map',
|
||||||
\type(v:true): 'boolean',
|
\type(v:true): 'boolean',
|
||||||
@@ -412,15 +412,9 @@ endfunction
|
|||||||
""
|
""
|
||||||
" Dump |msgpack-special-dict| that represents a string. If any additional
|
" Dump |msgpack-special-dict| that represents a string. If any additional
|
||||||
" parameter is given then it dumps binary string.
|
" parameter is given then it dumps binary string.
|
||||||
function s:msgpack_dump_string(v) abort
|
function s:msgpack_dump_string(v, ...) abort
|
||||||
if type(a:v) == type({})
|
let ret = [a:0 ? '"' : '="']
|
||||||
let val = a:v
|
for v in a:v._VAL
|
||||||
else
|
|
||||||
let val = {'_VAL': split(a:v, "\n", 1)}
|
|
||||||
end
|
|
||||||
|
|
||||||
let ret = ['"']
|
|
||||||
for v in val._VAL
|
|
||||||
call add(
|
call add(
|
||||||
\ret,
|
\ret,
|
||||||
\substitute(
|
\substitute(
|
||||||
@@ -432,6 +426,16 @@ function s:msgpack_dump_string(v) abort
|
|||||||
return join(ret, '')
|
return join(ret, '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
""
|
||||||
|
" Dump binary string.
|
||||||
|
function s:msgpack_dump_binary(v) abort
|
||||||
|
if type(a:v) == type({})
|
||||||
|
return s:msgpack_dump_string(a:v, 1)
|
||||||
|
else
|
||||||
|
return s:msgpack_dump_string({'_VAL': split(a:v, "\n", 1)}, 1)
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
""
|
""
|
||||||
" Dump array value.
|
" Dump array value.
|
||||||
function s:msgpack_dump_array(v) abort
|
function s:msgpack_dump_array(v) abort
|
||||||
@@ -445,7 +449,7 @@ function s:msgpack_dump_map(v) abort
|
|||||||
let ret = ['{']
|
let ret = ['{']
|
||||||
if msgpack#special_type(a:v) is 0
|
if msgpack#special_type(a:v) is 0
|
||||||
for [k, v] in items(a:v)
|
for [k, v] in items(a:v)
|
||||||
let ret += [s:msgpack_dump_string({'_VAL': split(k, "\n")}),
|
let ret += [s:msgpack_dump_string({'_VAL': split(k, "\n", 1)}),
|
||||||
\': ',
|
\': ',
|
||||||
\msgpack#string(v),
|
\msgpack#string(v),
|
||||||
\', ']
|
\', ']
|
||||||
@@ -475,7 +479,7 @@ endfunction
|
|||||||
" Dump extension value.
|
" Dump extension value.
|
||||||
function s:msgpack_dump_ext(v) abort
|
function s:msgpack_dump_ext(v) abort
|
||||||
return printf('+(%i)%s', a:v._VAL[0],
|
return printf('+(%i)%s', a:v._VAL[0],
|
||||||
\s:msgpack_dump_string({'_VAL': a:v._VAL[1]}))
|
\s:msgpack_dump_string({'_VAL': a:v._VAL[1]}, 1))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
""
|
""
|
||||||
@@ -615,7 +619,9 @@ function msgpack#eval(s, special_objs) abort
|
|||||||
throw '"-invalid:Invalid string: ' . s
|
throw '"-invalid:Invalid string: ' . s
|
||||||
endif
|
endif
|
||||||
call add(expr, '{''_TYPE'': v:msgpack_types.')
|
call add(expr, '{''_TYPE'': v:msgpack_types.')
|
||||||
if empty(match[1]) || match[1] is# '='
|
if empty(match[1])
|
||||||
|
call add(expr, 'binary')
|
||||||
|
elseif match[1] is# '='
|
||||||
call add(expr, 'string')
|
call add(expr, 'string')
|
||||||
else
|
else
|
||||||
call add(expr, 'ext')
|
call add(expr, 'ext')
|
||||||
@@ -766,7 +772,7 @@ function msgpack#equal(a, b)
|
|||||||
let a = aspecial is 0 ? a:a : a:a._VAL
|
let a = aspecial is 0 ? a:a : a:a._VAL
|
||||||
let b = bspecial is 0 ? a:b : a:b._VAL
|
let b = bspecial is 0 ? a:b : a:b._VAL
|
||||||
return msgpack#equal(a, b)
|
return msgpack#equal(a, b)
|
||||||
elseif atype is# 'string'
|
elseif atype is# 'binary'
|
||||||
let a = (aspecial is 0 ? split(a:a, "\n", 1) : a:a._VAL)
|
let a = (aspecial is 0 ? split(a:a, "\n", 1) : a:a._VAL)
|
||||||
let b = (bspecial is 0 ? split(a:b, "\n", 1) : a:b._VAL)
|
let b = (bspecial is 0 ? split(a:b, "\n", 1) : a:b._VAL)
|
||||||
return a ==# b
|
return a ==# b
|
||||||
@@ -781,17 +787,13 @@ function msgpack#equal(a, b)
|
|||||||
" Non-special mapping cannot have non-string keys
|
" Non-special mapping cannot have non-string keys
|
||||||
return 0
|
return 0
|
||||||
endif
|
endif
|
||||||
if type(k) == type({})
|
if (empty(k._VAL)
|
||||||
if (empty(k._VAL)
|
\|| k._VAL ==# [""]
|
||||||
\|| k._VAL ==# [""]
|
\|| !empty(filter(copy(k._VAL), 'stridx(v:val, "\n") != -1')))
|
||||||
\|| !empty(filter(copy(k._VAL), 'stridx(v:val, "\n") != -1')))
|
" Non-special mapping cannot have zero byte in key or an empty key
|
||||||
" Non-special mapping cannot have zero byte in key or an empty key
|
return 0
|
||||||
return 0
|
|
||||||
endif
|
|
||||||
let kstr = join(k._VAL, "\n")
|
|
||||||
else
|
|
||||||
let kstr = k
|
|
||||||
endif
|
endif
|
||||||
|
let kstr = join(k._VAL, "\n")
|
||||||
if !has_key(akeys, kstr)
|
if !has_key(akeys, kstr)
|
||||||
" Protects from both missing and duplicate keys
|
" Protects from both missing and duplicate keys
|
||||||
return 0
|
return 0
|
||||||
|
12734
runtime/autoload/netrw.vim
Normal file
12734
runtime/autoload/netrw.vim
Normal file
File diff suppressed because it is too large
Load Diff
363
runtime/autoload/netrwFileHandlers.vim
Normal file
363
runtime/autoload/netrwFileHandlers.vim
Normal file
@@ -0,0 +1,363 @@
|
|||||||
|
" netrwFileHandlers: contains various extension-based file handlers for
|
||||||
|
" netrw's browsers' x command ("eXecute launcher")
|
||||||
|
" Maintainer: This runtime file is looking for a new maintainer.
|
||||||
|
" Original Author: Charles E. Campbell
|
||||||
|
" Date: Sep 18, 2020
|
||||||
|
" Version: 11
|
||||||
|
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell {{{1
|
||||||
|
" Permission is hereby granted to use and distribute this code,
|
||||||
|
" with or without modifications, provided that this copyright
|
||||||
|
" notice is copied with it. Like anything else that's free,
|
||||||
|
" netrwFileHandlers.vim is provided *as is* and comes with no
|
||||||
|
" warranty of any kind, either expressed or implied. In no
|
||||||
|
" event will the copyright holder be liable for any damages
|
||||||
|
" resulting from the use of this software.
|
||||||
|
"
|
||||||
|
" Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1
|
||||||
|
" is eternal life in Christ Jesus our Lord.
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" Load Once: {{{1
|
||||||
|
if exists("g:loaded_netrwFileHandlers") || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_netrwFileHandlers= "v11"
|
||||||
|
if v:version < 702
|
||||||
|
echohl WarningMsg
|
||||||
|
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
|
||||||
|
echohl Normal
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let s:keepcpo= &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" netrwFileHandlers#Invoke: {{{1
|
||||||
|
fun! netrwFileHandlers#Invoke(exten,fname)
|
||||||
|
" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
|
||||||
|
let exten= a:exten
|
||||||
|
" list of supported special characters. Consider rcs,v --- that can be
|
||||||
|
" supported with a NFH_rcsCOMMAv() handler
|
||||||
|
if exten =~ '[@:,$!=\-+%?;~]'
|
||||||
|
let specials= {
|
||||||
|
\ '@' : 'AT',
|
||||||
|
\ ':' : 'COLON',
|
||||||
|
\ ',' : 'COMMA',
|
||||||
|
\ '$' : 'DOLLAR',
|
||||||
|
\ '!' : 'EXCLAMATION',
|
||||||
|
\ '=' : 'EQUAL',
|
||||||
|
\ '-' : 'MINUS',
|
||||||
|
\ '+' : 'PLUS',
|
||||||
|
\ '%' : 'PERCENT',
|
||||||
|
\ '?' : 'QUESTION',
|
||||||
|
\ ';' : 'SEMICOLON',
|
||||||
|
\ '~' : 'TILDE'}
|
||||||
|
let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge')
|
||||||
|
" call Decho('fname<'.fname.'> done with dictionary')
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:exten != "" && exists("*NFH_".exten)
|
||||||
|
" support user NFH_*() functions
|
||||||
|
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
|
||||||
|
exe "let ret= NFH_".exten.'("'.a:fname.'")'
|
||||||
|
elseif a:exten != "" && exists("*s:NFH_".exten)
|
||||||
|
" use builtin-NFH_*() functions
|
||||||
|
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
|
||||||
|
exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")'
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
|
||||||
|
return 0
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_html: handles html when the user hits "x" when the {{{1
|
||||||
|
" cursor is atop a *.html file
|
||||||
|
fun! s:NFH_html(pagefile)
|
||||||
|
" call Dfunc("s:NFH_html(".a:pagefile.")")
|
||||||
|
|
||||||
|
let page= substitute(a:pagefile,'^','file://','')
|
||||||
|
|
||||||
|
if executable("mozilla")
|
||||||
|
" call Decho("executing !mozilla ".page)
|
||||||
|
exe "!mozilla ".shellescape(page,1)
|
||||||
|
elseif executable("netscape")
|
||||||
|
" call Decho("executing !netscape ".page)
|
||||||
|
exe "!netscape ".shellescape(page,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_html 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_html 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_htm: handles html when the user hits "x" when the {{{1
|
||||||
|
" cursor is atop a *.htm file
|
||||||
|
fun! s:NFH_htm(pagefile)
|
||||||
|
" call Dfunc("s:NFH_htm(".a:pagefile.")")
|
||||||
|
|
||||||
|
let page= substitute(a:pagefile,'^','file://','')
|
||||||
|
|
||||||
|
if executable("mozilla")
|
||||||
|
" call Decho("executing !mozilla ".page)
|
||||||
|
exe "!mozilla ".shellescape(page,1)
|
||||||
|
elseif executable("netscape")
|
||||||
|
" call Decho("executing !netscape ".page)
|
||||||
|
exe "!netscape ".shellescape(page,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_htm 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_htm 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_jpg: {{{1
|
||||||
|
fun! s:NFH_jpg(jpgfile)
|
||||||
|
" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
|
||||||
|
|
||||||
|
if executable("gimp")
|
||||||
|
exe "silent! !gimp -s ".shellescape(a:jpgfile,1)
|
||||||
|
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||||
|
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
|
||||||
|
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_jpg 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_jpg 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_gif: {{{1
|
||||||
|
fun! s:NFH_gif(giffile)
|
||||||
|
" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
|
||||||
|
|
||||||
|
if executable("gimp")
|
||||||
|
exe "silent! !gimp -s ".shellescape(a:giffile,1)
|
||||||
|
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||||
|
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_gif 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_gif 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_png: {{{1
|
||||||
|
fun! s:NFH_png(pngfile)
|
||||||
|
" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
|
||||||
|
|
||||||
|
if executable("gimp")
|
||||||
|
exe "silent! !gimp -s ".shellescape(a:pngfile,1)
|
||||||
|
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||||
|
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_png 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_png 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_pnm: {{{1
|
||||||
|
fun! s:NFH_pnm(pnmfile)
|
||||||
|
" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
|
||||||
|
|
||||||
|
if executable("gimp")
|
||||||
|
exe "silent! !gimp -s ".shellescape(a:pnmfile,1)
|
||||||
|
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||||
|
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_pnm 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_pnm 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_bmp: visualize bmp files {{{1
|
||||||
|
fun! s:NFH_bmp(bmpfile)
|
||||||
|
" call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)")
|
||||||
|
|
||||||
|
if executable("gimp")
|
||||||
|
exe "silent! !gimp -s ".a:bmpfile
|
||||||
|
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||||
|
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_bmp 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_bmp 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_pdf: visualize pdf files {{{1
|
||||||
|
fun! s:NFH_pdf(pdf)
|
||||||
|
" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
|
||||||
|
if executable("gs")
|
||||||
|
exe 'silent! !gs '.shellescape(a:pdf,1)
|
||||||
|
elseif executable("pdftotext")
|
||||||
|
exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1)
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_pdf 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_pdf 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_doc: visualize doc files {{{1
|
||||||
|
fun! s:NFH_doc(doc)
|
||||||
|
" call Dfunc("s:NFH_doc(doc<".a:doc.">)")
|
||||||
|
|
||||||
|
if executable("oowriter")
|
||||||
|
exe 'silent! !oowriter '.shellescape(a:doc,1)
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_doc 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_doc 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_sxw: visualize sxw files {{{1
|
||||||
|
fun! s:NFH_sxw(sxw)
|
||||||
|
" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
|
||||||
|
|
||||||
|
if executable("oowriter")
|
||||||
|
exe 'silent! !oowriter '.shellescape(a:sxw,1)
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_sxw 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_sxw 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_xls: visualize xls files {{{1
|
||||||
|
fun! s:NFH_xls(xls)
|
||||||
|
" call Dfunc("s:NFH_xls(xls<".a:xls.">)")
|
||||||
|
|
||||||
|
if executable("oocalc")
|
||||||
|
exe 'silent! !oocalc '.shellescape(a:xls,1)
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_xls 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_xls 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_ps: handles PostScript files {{{1
|
||||||
|
fun! s:NFH_ps(ps)
|
||||||
|
" call Dfunc("s:NFH_ps(ps<".a:ps.">)")
|
||||||
|
if executable("gs")
|
||||||
|
" call Decho("exe silent! !gs ".a:ps)
|
||||||
|
exe "silent! !gs ".shellescape(a:ps,1)
|
||||||
|
redraw!
|
||||||
|
elseif executable("ghostscript")
|
||||||
|
" call Decho("exe silent! !ghostscript ".a:ps)
|
||||||
|
exe "silent! !ghostscript ".shellescape(a:ps,1)
|
||||||
|
redraw!
|
||||||
|
elseif executable("gswin32")
|
||||||
|
" call Decho("exe silent! !gswin32 ".shellescape(a:ps,1))
|
||||||
|
exe "silent! !gswin32 ".shellescape(a:ps,1)
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_ps 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_ps 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_eps: handles encapsulated PostScript files {{{1
|
||||||
|
fun! s:NFH_eps(eps)
|
||||||
|
" call Dfunc("s:NFH_eps()")
|
||||||
|
if executable("gs")
|
||||||
|
exe "silent! !gs ".shellescape(a:eps,1)
|
||||||
|
redraw!
|
||||||
|
elseif executable("ghostscript")
|
||||||
|
exe "silent! !ghostscript ".shellescape(a:eps,1)
|
||||||
|
redraw!
|
||||||
|
elseif executable("ghostscript")
|
||||||
|
exe "silent! !ghostscript ".shellescape(a:eps,1)
|
||||||
|
redraw!
|
||||||
|
elseif executable("gswin32")
|
||||||
|
exe "silent! !gswin32 ".shellescape(a:eps,1)
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_eps 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
" call Dret("s:NFH_eps 0")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_fig: handles xfig files {{{1
|
||||||
|
fun! s:NFH_fig(fig)
|
||||||
|
" call Dfunc("s:NFH_fig()")
|
||||||
|
if executable("xfig")
|
||||||
|
exe "silent! !xfig ".a:fig
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_fig 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_fig 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" s:NFH_obj: handles tgif's obj files {{{1
|
||||||
|
fun! s:NFH_obj(obj)
|
||||||
|
" call Dfunc("s:NFH_obj()")
|
||||||
|
if has("unix") && executable("tgif")
|
||||||
|
exe "silent! !tgif ".a:obj
|
||||||
|
redraw!
|
||||||
|
else
|
||||||
|
" call Dret("s:NFH_obj 0")
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
" call Dret("s:NFH_obj 1")
|
||||||
|
return 1
|
||||||
|
endfun
|
||||||
|
|
||||||
|
let &cpo= s:keepcpo
|
||||||
|
unlet s:keepcpo
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" Modelines: {{{1
|
||||||
|
" vim: fdm=marker
|
249
runtime/autoload/netrwSettings.vim
Normal file
249
runtime/autoload/netrwSettings.vim
Normal file
@@ -0,0 +1,249 @@
|
|||||||
|
" netrwSettings.vim: makes netrw settings simpler
|
||||||
|
" Date: Nov 15, 2021
|
||||||
|
" Maintainer: This runtime file is looking for a new maintainer.
|
||||||
|
" Former Maintainer: Charles E Campbell
|
||||||
|
" Version: 18
|
||||||
|
" Last Change:
|
||||||
|
" 2024 May 08 by Vim Project: cleanup legacy Win9X checks
|
||||||
|
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
|
||||||
|
" Permission is hereby granted to use and distribute this code,
|
||||||
|
" with or without modifications, provided that this copyright
|
||||||
|
" notice is copied with it. Like anything else that's free,
|
||||||
|
" netrwSettings.vim is provided *as is* and comes with no
|
||||||
|
" warranty of any kind, either expressed or implied. By using
|
||||||
|
" this plugin, you agree that in no event will the copyright
|
||||||
|
" holder be liable for any damages resulting from the use
|
||||||
|
" of this software.
|
||||||
|
"
|
||||||
|
" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1
|
||||||
|
" synagogues, preaching the gospel of the kingdom, and healing
|
||||||
|
" every disease and every sickness among the people.
|
||||||
|
" Load Once: {{{1
|
||||||
|
if exists("g:loaded_netrwSettings") || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_netrwSettings = "v18"
|
||||||
|
if v:version < 700
|
||||||
|
echohl WarningMsg
|
||||||
|
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
||||||
|
echohl Normal
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" NetrwSettings: {{{1
|
||||||
|
fun! netrwSettings#NetrwSettings()
|
||||||
|
" this call is here largely just to insure that netrw has been loaded
|
||||||
|
call netrw#WinPath("")
|
||||||
|
if !exists("g:loaded_netrw")
|
||||||
|
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
above wincmd s
|
||||||
|
enew
|
||||||
|
setlocal noswapfile bh=wipe
|
||||||
|
set ft=vim
|
||||||
|
file Netrw\ Settings
|
||||||
|
|
||||||
|
" these variables have the following default effects when they don't
|
||||||
|
" exist (ie. have not been set by the user in his/her .vimrc)
|
||||||
|
if !exists("g:netrw_liststyle")
|
||||||
|
let g:netrw_liststyle= 0
|
||||||
|
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_silent")
|
||||||
|
let g:netrw_silent= 0
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_use_nt_rcp")
|
||||||
|
let g:netrw_use_nt_rcp= 0
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_ftp")
|
||||||
|
let g:netrw_ftp= 0
|
||||||
|
endif
|
||||||
|
if !exists("g:netrw_ignorenetrc")
|
||||||
|
let g:netrw_ignorenetrc= 0
|
||||||
|
endif
|
||||||
|
|
||||||
|
put ='+ ---------------------------------------------'
|
||||||
|
put ='+ NetrwSettings: by Charles E. Campbell'
|
||||||
|
put ='+ Press <F1> with cursor atop any line for help'
|
||||||
|
put ='+ ---------------------------------------------'
|
||||||
|
let s:netrw_settings_stop= line(".")
|
||||||
|
|
||||||
|
put =''
|
||||||
|
put ='+ Netrw Protocol Commands'
|
||||||
|
put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd
|
||||||
|
put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd
|
||||||
|
put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd
|
||||||
|
put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd
|
||||||
|
put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd
|
||||||
|
put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd
|
||||||
|
put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd
|
||||||
|
put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd
|
||||||
|
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
|
||||||
|
let s:netrw_protocol_stop= line(".")
|
||||||
|
put = ''
|
||||||
|
|
||||||
|
put ='+Netrw Transfer Control'
|
||||||
|
put = 'let g:netrw_cygwin = '.g:netrw_cygwin
|
||||||
|
put = 'let g:netrw_ftp = '.g:netrw_ftp
|
||||||
|
put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
|
||||||
|
put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
|
||||||
|
put = 'let g:netrw_sshport = '.g:netrw_sshport
|
||||||
|
put = 'let g:netrw_silent = '.g:netrw_silent
|
||||||
|
put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
|
||||||
|
let s:netrw_xfer_stop= line(".")
|
||||||
|
put =''
|
||||||
|
put ='+ Netrw Messages'
|
||||||
|
put ='let g:netrw_use_errorwindow = '.g:netrw_use_errorwindow
|
||||||
|
|
||||||
|
put = ''
|
||||||
|
put ='+ Netrw Browser Control'
|
||||||
|
if exists("g:netrw_altfile")
|
||||||
|
put = 'let g:netrw_altfile = '.g:netrw_altfile
|
||||||
|
else
|
||||||
|
put = 'let g:netrw_altfile = 0'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_alto = '.g:netrw_alto
|
||||||
|
put = 'let g:netrw_altv = '.g:netrw_altv
|
||||||
|
put = 'let g:netrw_banner = '.g:netrw_banner
|
||||||
|
if exists("g:netrw_bannerbackslash")
|
||||||
|
put = 'let g:netrw_bannerbackslash = '.g:netrw_bannerbackslash
|
||||||
|
else
|
||||||
|
put = '\" let g:netrw_bannerbackslash = (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_browse_split = '.g:netrw_browse_split
|
||||||
|
if exists("g:netrw_browsex_viewer")
|
||||||
|
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
|
||||||
|
else
|
||||||
|
put = '\" let g:netrw_browsex_viewer = (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_compress = '.g:netrw_compress
|
||||||
|
if exists("g:Netrw_corehandler")
|
||||||
|
put = 'let g:Netrw_corehandler = '.g:Netrw_corehandler
|
||||||
|
else
|
||||||
|
put = '\" let g:Netrw_corehandler = (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_ctags = '.g:netrw_ctags
|
||||||
|
put = 'let g:netrw_cursor = '.g:netrw_cursor
|
||||||
|
let decompressline= line("$")
|
||||||
|
put = 'let g:netrw_decompress = '.string(g:netrw_decompress)
|
||||||
|
if exists("g:netrw_dynamic_maxfilenamelen")
|
||||||
|
put = 'let g:netrw_dynamic_maxfilenamelen='.g:netrw_dynamic_maxfilenamelen
|
||||||
|
else
|
||||||
|
put = '\" let g:netrw_dynamic_maxfilenamelen= (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
||||||
|
put = 'let g:netrw_errorlvl = '.g:netrw_errorlvl
|
||||||
|
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
|
||||||
|
let fnameescline= line("$")
|
||||||
|
put = 'let g:netrw_fname_escape = '.string(g:netrw_fname_escape)
|
||||||
|
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
|
||||||
|
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
|
||||||
|
put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
|
||||||
|
put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd
|
||||||
|
let globescline= line("$")
|
||||||
|
put = 'let g:netrw_glob_escape = '.string(g:netrw_glob_escape)
|
||||||
|
put = 'let g:netrw_hide = '.g:netrw_hide
|
||||||
|
if exists("g:netrw_home")
|
||||||
|
put = 'let g:netrw_home = '.g:netrw_home
|
||||||
|
else
|
||||||
|
put = '\" let g:netrw_home = (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
|
||||||
|
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
|
||||||
|
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
|
||||||
|
put = 'let g:netrw_liststyle = '.g:netrw_liststyle
|
||||||
|
put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd
|
||||||
|
put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt
|
||||||
|
put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir
|
||||||
|
put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt
|
||||||
|
put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd
|
||||||
|
put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt
|
||||||
|
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
|
||||||
|
put = 'let g:netrw_menu = '.g:netrw_menu
|
||||||
|
put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps
|
||||||
|
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
|
||||||
|
if exists("g:netrw_nobeval")
|
||||||
|
put = 'let g:netrw_nobeval = '.g:netrw_nobeval
|
||||||
|
else
|
||||||
|
put = '\" let g:netrw_nobeval = (not defined)'
|
||||||
|
endif
|
||||||
|
put = 'let g:netrw_remote_mkdir = '.g:netrw_remote_mkdir
|
||||||
|
put = 'let g:netrw_preview = '.g:netrw_preview
|
||||||
|
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
|
||||||
|
put = 'let g:netrw_retmap = '.g:netrw_retmap
|
||||||
|
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
|
||||||
|
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
|
||||||
|
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
|
||||||
|
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
|
||||||
|
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
|
||||||
|
put = 'let g:netrw_sort_options = '.g:netrw_sort_options
|
||||||
|
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
|
||||||
|
put = 'let g:netrw_servername = '.g:netrw_servername
|
||||||
|
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
|
||||||
|
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
||||||
|
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
|
||||||
|
put = 'let g:netrw_scpport = '.g:netrw_scpport
|
||||||
|
put = 'let g:netrw_sepchr = '.g:netrw_sepchr
|
||||||
|
put = 'let g:netrw_sshport = '.g:netrw_sshport
|
||||||
|
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
|
||||||
|
let tmpfileescline= line("$")
|
||||||
|
put ='let g:netrw_tmpfile_escape...'
|
||||||
|
put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf
|
||||||
|
put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen
|
||||||
|
put = 'let g:netrw_winsize = '.g:netrw_winsize
|
||||||
|
|
||||||
|
put =''
|
||||||
|
put ='+ For help, place cursor on line and press <F1>'
|
||||||
|
|
||||||
|
1d
|
||||||
|
silent %s/^+/"/e
|
||||||
|
res 99
|
||||||
|
silent %s/= \([^0-9].*\)$/= '\1'/e
|
||||||
|
silent %s/= $/= ''/e
|
||||||
|
1
|
||||||
|
|
||||||
|
call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1',''))
|
||||||
|
call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'")
|
||||||
|
call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'")
|
||||||
|
call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'")
|
||||||
|
|
||||||
|
set nomod
|
||||||
|
|
||||||
|
nmap <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
|
||||||
|
nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call NetrwSettingHelp()<cr>
|
||||||
|
let tmpfile= tempname()
|
||||||
|
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" NetrwSettingHelp: {{{2
|
||||||
|
fun! NetrwSettingHelp()
|
||||||
|
" call Dfunc("NetrwSettingHelp()")
|
||||||
|
let curline = getline(".")
|
||||||
|
if curline =~ '='
|
||||||
|
let varhelp = substitute(curline,'^\s*let ','','e')
|
||||||
|
let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
||||||
|
" call Decho("trying help ".varhelp)
|
||||||
|
try
|
||||||
|
exe "he ".varhelp
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E149/
|
||||||
|
echo "***sorry*** no help available for <".varhelp.">"
|
||||||
|
endtry
|
||||||
|
elseif line(".") < s:netrw_settings_stop
|
||||||
|
he netrw-settings
|
||||||
|
elseif line(".") < s:netrw_protocol_stop
|
||||||
|
he netrw-externapp
|
||||||
|
elseif line(".") < s:netrw_xfer_stop
|
||||||
|
he netrw-variables
|
||||||
|
else
|
||||||
|
he netrw-browse-var
|
||||||
|
endif
|
||||||
|
" call Dret("NetrwSettingHelp")
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" ---------------------------------------------------------------------
|
||||||
|
" Modelines: {{{1
|
||||||
|
" vim:ts=8 fdm=marker
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user