feat(vimscript): scripts can detect 'android', 'termux' #38218

Problem:
The 'android' and 'termux' feature flags have been shipped in the
downstream neovim/neovim-nightly package for 5+ years but were never
properly documented in the downstream patch.

Solution:
Upstream the 'android' and 'termux' feature flags into Neovim as
decoupled feature flags, this enables the 'android' feature in
particular to be available independently of the 'termux' feature
for builds of Neovim against the Android NDK, but not including
the Termux NDK patchset.

Co-authored-by: Lethal Lisa <43791059+lethal-lisa@users.noreply.github.com>
Co-authored-by: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com>
This commit is contained in:
TomIO
2026-03-17 00:12:12 +01:00
committed by GitHub
parent 33b357d01f
commit 6edae88052
5 changed files with 13 additions and 0 deletions

View File

@@ -464,6 +464,7 @@ VIMSCRIPT
• |chdir()| allows optionally specifying a scope argument.
• |cmdcomplete_info()| gets current cmdline completion info.
• |getcompletiontype()| gets command-line completion type for any string.
• |has()| gained two new system dependent feature flags, |android| and |termux|.
• |prompt_getinput()| gets current user-input in prompt-buffer.
• |wildtrigger()| triggers command-line expansion.
• |v:vim_did_init| is set after sourcing |init.vim| but before |load-plugins|.

View File

@@ -4689,6 +4689,7 @@ has({feature}) *has()*
< *feature-list*
List of supported pseudo-feature names:
acl |ACL| support.
*android* Android system (not necessarily |termux|).
bsd BSD system (not macOS, use "mac" for that).
clipboard |clipboard| provider is available.
fname_case Case in file names matters (for Darwin and MS-Windows
@@ -4702,6 +4703,7 @@ has({feature}) *has()*
python3 Legacy Vim |python3| interface. |has-python|
pythonx Legacy Vim |python_x| interface. |has-pythonx|
sun SunOS system.
*termux* Termux, an |android| terminal app and packaging environment.
ttyin input is a terminal (tty).
ttyout output is a terminal (tty).
unix Unix system.

View File

@@ -4236,6 +4236,7 @@ function vim.fn.globpath(path, expr, nosuf, list, allinks) end
--- < *feature-list*
--- List of supported pseudo-feature names:
--- acl |ACL| support.
--- *android* Android system (not necessarily |termux|).
--- bsd BSD system (not macOS, use "mac" for that).
--- clipboard |clipboard| provider is available.
--- fname_case Case in file names matters (for Darwin and MS-Windows
@@ -4249,6 +4250,7 @@ function vim.fn.globpath(path, expr, nosuf, list, allinks) end
--- python3 Legacy Vim |python3| interface. |has-python|
--- pythonx Legacy Vim |python_x| interface. |has-pythonx|
--- sun SunOS system.
--- *termux* Termux, an |android| terminal app and packaging environment.
--- ttyin input is a terminal (tty).
--- ttyout output is a terminal (tty).
--- unix Unix system.

View File

@@ -5221,6 +5221,7 @@ M.funcs = {
< *feature-list*
List of supported pseudo-feature names:
acl |ACL| support.
*android* Android system (not necessarily |termux|).
bsd BSD system (not macOS, use "mac" for that).
clipboard |clipboard| provider is available.
fname_case Case in file names matters (for Darwin and MS-Windows
@@ -5234,6 +5235,7 @@ M.funcs = {
python3 Legacy Vim |python3| interface. |has-python|
pythonx Legacy Vim |python_x| interface. |has-pythonx|
sun SunOS system.
*termux* Termux, an |android| terminal app and packaging environment.
ttyin input is a terminal (tty).
ttyout output is a terminal (tty).
unix Unix system.

View File

@@ -2654,6 +2654,9 @@ static void f_gettext(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
static const char *const has_list[] = {
#ifdef __ANDROID__
"android",
#endif
#if defined(BSD) && !defined(__APPLE__) && !defined(__GNU__)
"bsd",
#endif
@@ -2666,6 +2669,9 @@ static void f_has(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
#ifdef SUN_SYSTEM
"sun",
#endif
#ifdef __TERMUX__
"termux",
#endif
#ifdef UNIX
"unix",
#endif