-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
enhance(main/neovim{,-nightly},main/vim,x11/vim-gtk): document has('termux') feature flag
#28681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../neovim/has-termux.patch |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| The first two hunks of patch are applied directly to the pregenerated documentation files. | ||
| This means it must be (re)created from the release tarballs if it needs to be regenerated! | ||
|
|
||
| Modifying `src/nvim/eval.lua` and then recreating the documentation files with `make doc` | ||
| would in principle be possible as part of the `termux_step_host_build()` function. | ||
| However as of time of writing, March 6. 2026 (Neovim version 0.11.6) I have not been able | ||
| to successfully produce modified docs for Neovim at build time. | ||
|
|
||
| Please make sure to retain this header comment if you regenerating this patch. | ||
| diff --git a/runtime/doc/vimfn.txt b/runtime/doc/vimfn.txt | ||
| index 8f52e14..7c35094 100644 | ||
| --- a/runtime/doc/vimfn.txt | ||
| +++ b/runtime/doc/vimfn.txt | ||
| @@ -4624,6 +4624,10 @@ has({feature}) *has()* | ||
| win32 Windows system (32 or 64 bit). | ||
| win64 Windows system (64 bit). | ||
| wsl WSL (Windows Subsystem for Linux) system. | ||
| + android Alias for has('termux') | ||
| + termux Termux environment (The *termux* and *android* | ||
| + feature flags are {included additionally} | ||
| + in Termux's Neovim package.) | ||
|
|
||
| *has-patch* | ||
| 3. Vim patch. For example the "patch123" feature means that | ||
| diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua | ||
| index 1a13885..491a48b 100644 | ||
| --- a/runtime/lua/vim/_meta/vimfn.lua | ||
| +++ b/runtime/lua/vim/_meta/vimfn.lua | ||
| @@ -4175,6 +4175,10 @@ function vim.fn.globpath(path, expr, nosuf, list, allinks) end | ||
| --- win32 Windows system (32 or 64 bit). | ||
| --- win64 Windows system (64 bit). | ||
| --- wsl WSL (Windows Subsystem for Linux) system. | ||
| +--- android Alias for has('termux') | ||
| +--- termux Termux environment (The *termux* and *android* | ||
| +--- feature flags are {included additionally} | ||
| +--- in Termux's Neovim package.) | ||
| --- | ||
| --- *has-patch* | ||
| --- 3. Vim patch. For example the "patch123" feature means that | ||
| diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c | ||
| index 752b367..76a3327 100644 | ||
| --- a/src/nvim/eval/funcs.c | ||
| +++ b/src/nvim/eval/funcs.c | ||
| @@ -3087,6 +3087,12 @@ static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) | ||
| #ifdef _WIN64 | ||
| "win64", | ||
| #endif | ||
| +#ifdef __ANDROID__ | ||
| + "android", | ||
| +#endif | ||
| +#ifdef __TERMUX__ | ||
| + "termux", | ||
| +#endif | ||
| #ifndef CASE_INSENSITIVE_FILENAME | ||
| "fname_case", | ||
| #endif | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt | ||
| index d95f459a9..4ddd8099d 100644 | ||
| --- a/runtime/doc/builtin.txt | ||
| +++ b/runtime/doc/builtin.txt | ||
| @@ -13104,6 +13104,7 @@ acl Compiled with |ACL| support. | ||
| all_builtin_terms Compiled with all builtin terminals enabled. (always | ||
| true) | ||
| amiga Amiga version of Vim. | ||
| +android Android version of Vim. *+android* | ||
| arabic Compiled with Arabic support |Arabic|. | ||
| arp Compiled with ARP support (Amiga). | ||
| autocmd Compiled with autocommand support. (always true) | ||
| @@ -13274,6 +13275,7 @@ termguicolors Compiled with true color in terminal support. | ||
| terminal Compiled with |terminal| support. | ||
| terminfo Compiled with terminfo instead of termcap. | ||
| termresponse Compiled with support for |t_RV| and |v:termresponse|. | ||
| +termux Termux version of Vim. *+termux* | ||
| textobjects Compiled with support for |text-objects|. | ||
| textprop Compiled with support for |text-properties|. | ||
| tgetent Compiled with tgetent support, able to use a termcap | ||
| diff --git a/runtime/doc/tags b/runtime/doc/tags | ||
| index a881c0acf..cc1977134 100644 | ||
| --- a/runtime/doc/tags | ||
| +++ b/runtime/doc/tags | ||
| @@ -1403,6 +1403,7 @@ $quote eval.txt /*$quote* | ||
| +GUI_neXtaw various.txt /*+GUI_neXtaw* | ||
| +X11 various.txt /*+X11* | ||
| +acl various.txt /*+acl* | ||
| ++android builtin.txt /*+android* | ||
| +arabic various.txt /*+arabic* | ||
| +autochdir various.txt /*+autochdir* | ||
| +autocmd various.txt /*+autocmd* | ||
| @@ -1530,6 +1531,7 @@ $quote eval.txt /*$quote* | ||
| +terminal various.txt /*+terminal* | ||
| +terminfo various.txt /*+terminfo* | ||
| +termresponse various.txt /*+termresponse* | ||
| ++termux builtin.txt /*+termux* | ||
| +textobjects various.txt /*+textobjects* | ||
| +textprop various.txt /*+textprop* | ||
| +tgetent various.txt /*+tgetent* | ||
| diff --git a/src/evalfunc.c b/src/evalfunc.c | ||
| index 3c872af56..ff37f8902 100644 | ||
| --- a/src/evalfunc.c | ||
| +++ b/src/evalfunc.c | ||
| @@ -6791,6 +6791,20 @@ f_has(typval_T *argvars, typval_T *rettv) | ||
| 1 | ||
| #else | ||
| 0 | ||
| +#endif | ||
| + }, | ||
| + {"android", | ||
| +#ifdef __ANDROID__ | ||
| + 1 | ||
| +#else | ||
| + 0 | ||
| +#endif | ||
| + }, | ||
| + {"termux", | ||
| +#ifdef __TERMUX__ | ||
| + 1 | ||
| +#else | ||
| + 0 | ||
| #endif | ||
| }, | ||
| {"ebcdic", 0 }, |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../packages/vim/has-termux.patch |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an objection, just curious: does
vim.uv.os_uname()return enough info to achieve this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's gonna be terribly useful unfortunately.
I get the same result with
neovim-nightly(0.12.0~dev-2508+g61f166ec40)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anything else come to mind that could be a useful proxy?
For compile time Android checking we usually use
#ifdef __ANDROID__and/or__TERMUX__.We should be able to apply that to the
src/nvim/eval/funcs.cpart of this patch at least.Which is taken from this prior original patch
https://github.com/termux/termux-packages/blob/994dcc0/packages/neovim/src-nvim-eval-funcs.c.patch
An equivalent patch also exists for our
vim/vim-gtkpackage, so I should at least update that patch to include documentation of the feature flags as well.I'm not sure how we could cleanly extrapolate the presence of those definitions from the C preprocessor to the doc generation,
or if we can use an equivalent proxy for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could add a build flag so that
has('foo')works for an arbitrary build-time value, but yeah the docs are less obvious.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm working on updating the
vimpatch right now,but yeah I'm still drawing a blank for making that conditional for the docs.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, we can just update the docs directly upstream. PR would be appreciated
mention this issue/PR so we have a reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guess I'm making a PR to Vim and Neovim then.
I just finished reworking the
vimpatch as well.I'm guessing specific wording can be worked out there, what I have here is just the first things that came to mind.
With the C pre-proc macro checks this also decouples the
termuxandandroidfeature flags.So if some other project wants to compile Vim/Neovim on Android they wouldn't necessarily inherit the
termuxfeature, since the__TERMUX__macro is added as part of out Android NDK patches.termux-packages/ndk-patches/29/sys-cdefs.h.patch
Lines 1 to 9 in 0c87916