mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 18:54:18 +00:00
docs: api, messages, lsp, trust
gen_vimdoc.lua: In prepare for the upcoming release, comment-out the "Experimental" warning for prerelease features.
This commit is contained in:
@@ -512,6 +512,9 @@ local function should_render_field_or_param(p)
|
||||
and not vim.startswith(p.name, '_')
|
||||
end
|
||||
|
||||
--- Gets a field's description and its "(default: …)" value, if any (see `lsp/client.lua` for
|
||||
--- examples).
|
||||
---
|
||||
--- @param desc? string
|
||||
--- @return string?, string?
|
||||
local function get_default(desc)
|
||||
@@ -801,13 +804,18 @@ local function render_fun(fun, classes, cfg)
|
||||
|
||||
if fun.since then
|
||||
local since = assert(tonumber(fun.since), 'invalid @since on ' .. fun.name)
|
||||
local info = nvim_api_info()
|
||||
if since == 0 or (info.prerelease and since == info.level) then
|
||||
local nvim_api = nvim_api_info()
|
||||
_ = nvim_api -- Disable prerelease "WARNING" doc, in preparation for for upcoming release.
|
||||
|
||||
if
|
||||
since == 0 --[[or (nvim_api.prerelease and since == nvim_api.level)]]
|
||||
then
|
||||
-- Experimental = (since==0 or current prerelease)
|
||||
local s = 'WARNING: This feature is experimental/unstable.'
|
||||
table.insert(ret, md_to_vimdoc(s, INDENTATION, INDENTATION, TEXT_WIDTH))
|
||||
table.insert(ret, '\n')
|
||||
else
|
||||
end
|
||||
if since > 0 then
|
||||
local v = assert(util.version_level[since], 'invalid @since on ' .. fun.name)
|
||||
fun.attrs = fun.attrs or {}
|
||||
table.insert(fun.attrs, fmt('Since: %s', v))
|
||||
|
||||
@@ -39,26 +39,19 @@
|
||||
|
||||
#include "api/win_config.c.generated.h"
|
||||
|
||||
/// Opens a new split window, or a floating window if `relative` is specified,
|
||||
/// or an external window (managed by the UI) if `external` is specified.
|
||||
/// Opens a new split window, floating window, or external window.
|
||||
///
|
||||
/// Floats are windows that are drawn above the split layout, at some anchor
|
||||
/// position in some other window. Floats can be drawn internally or by external
|
||||
/// GUI with the |ui-multigrid| extension. External windows are only supported
|
||||
/// with multigrid GUIs, and are displayed as separate top-level windows.
|
||||
///
|
||||
/// For a general overview of floats, see |api-floatwin|.
|
||||
///
|
||||
/// The `width` and `height` of the new window must be specified when opening
|
||||
/// a floating window, but are optional for normal windows.
|
||||
///
|
||||
/// If `relative` and `external` are omitted, a normal "split" window is created.
|
||||
/// The `win` property determines which window will be split. If no `win` is
|
||||
/// provided or `win == 0`, a window will be created adjacent to the current window.
|
||||
/// If -1 is provided, a top-level split will be created. `vertical` and `split` are
|
||||
/// only valid for normal windows, and are used to control split direction. For `vertical`,
|
||||
/// the exact direction is determined by 'splitright' and 'splitbelow'.
|
||||
/// Split windows cannot have `bufpos`, `row`, `col`, `border`, `title`, `footer` properties.
|
||||
/// - Specify `relative` to create a floating window. Floats are drawn over the split layout,
|
||||
/// relative to a position in some other window. See |api-floatwin|.
|
||||
/// - Floats must specify `width` and `height`.
|
||||
/// - Specify `external` to create an external window. External windows are displayed as separate
|
||||
/// top-level windows managed by the |ui-multigrid| UI (not Nvim).
|
||||
/// - If `relative` and `external` are omitted, a normal "split" window is created.
|
||||
/// - The `win` key decides which window to split. If nil or 0, the split will be adjacent to
|
||||
/// the current window. If -1, a top-level split will be created.
|
||||
/// - Use `vertical` and `split` to control split direction. For `vertical`, the exact direction
|
||||
/// is determined by 'splitright' and 'splitbelow'.
|
||||
/// - Split windows cannot have `bufpos`, `row`, `col`, `border`, `title`, `footer`.
|
||||
///
|
||||
/// With relative=editor (row=0,col=0) refers to the top-left corner of the
|
||||
/// screen-grid and (row=Lines-1,col=Columns-1) refers to the bottom-right
|
||||
@@ -618,11 +611,11 @@ resize:
|
||||
#undef HAS_KEY_X
|
||||
}
|
||||
|
||||
/// Reconfigures the layout of a window.
|
||||
/// Reconfigures the layout and properties of a window.
|
||||
///
|
||||
/// - Absent (`nil`) keys will not be changed.
|
||||
/// - `row` / `col` / `relative` must be reconfigured together.
|
||||
/// - Cannot be used to move the last window in a tabpage to a different one.
|
||||
/// - Updates only the given keys; unspecified (`nil`) keys will not be changed.
|
||||
/// - Keys `row` / `col` / `relative` must be specified together.
|
||||
/// - Cannot move the last window in a tabpage to a different one.
|
||||
///
|
||||
/// Example: to convert a floating window to a "normal" split window, specify the `win` field:
|
||||
///
|
||||
|
||||
@@ -1668,6 +1668,7 @@ char *file_name_in_line(char *line, int col, int options, int count, char *rel_f
|
||||
|
||||
// Search forward for the last char of the file name.
|
||||
// Also allow ":/" when ':' is not in 'isfname'.
|
||||
// TODO(justinmk): Check for driveletter "x:/" at start, regardless of 'isfname'.
|
||||
len = path_has_drive_letter(ptr, strlen(ptr)) ? 2 : 0;
|
||||
while (vim_isfilec((uint8_t)ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
|
||||
|| ((options & FNAME_HYP) && path_is_url(ptr + len))
|
||||
|
||||
@@ -17,7 +17,7 @@ enum {
|
||||
enum {
|
||||
FNAME_MESS = 1, ///< give error message
|
||||
FNAME_EXP = 2, ///< expand to path
|
||||
FNAME_HYP = 4, ///< check for hypertext link
|
||||
FNAME_HYP = 4, ///< check for hyperlink url ("foo://")
|
||||
FNAME_INCL = 8, ///< apply 'includeexpr'
|
||||
FNAME_REL = 16, ///< ".." and "./" are relative to the (current)
|
||||
///< file instead of the current directory
|
||||
|
||||
@@ -887,12 +887,12 @@ void nlua_init(char **argv, int argc, int lua_arg0)
|
||||
|
||||
lua_State *lstate = luaL_newstate();
|
||||
if (lstate == NULL) {
|
||||
fprintf(stderr, _("E970: Failed to initialize lua interpreter\n"));
|
||||
fprintf(stderr, _("E970: Failed to initialize Lua interpreter\n"));
|
||||
os_exit(1);
|
||||
}
|
||||
luaL_openlibs(lstate);
|
||||
if (!nlua_state_init(lstate)) {
|
||||
fprintf(stderr, _("E970: Failed to initialize builtin lua modules\n"));
|
||||
fprintf(stderr, _("E970: Failed to initialize builtin Lua modules\n"));
|
||||
#ifdef EXITFREE
|
||||
nlua_common_free_all_mem(lstate);
|
||||
#endif
|
||||
|
||||
@@ -3985,6 +3985,7 @@ local options = {
|
||||
|
||||
Examples of cursor highlighting: >vim
|
||||
highlight Cursor gui=reverse guifg=NONE guibg=NONE
|
||||
" Note: gui=reverse overrides colors.
|
||||
highlight Cursor gui=NONE guifg=bg guibg=fg
|
||||
<
|
||||
]=],
|
||||
@@ -4000,10 +4001,11 @@ local options = {
|
||||
abbreviation = 'gfn',
|
||||
defaults = {
|
||||
if_true = macros('DFLT_GFN', 'string'),
|
||||
doc = [[(MS-Windows) "Cascadia Code,Cascadia Mono,Consolas,Courier New,monospace"
|
||||
(Mac) "SF Mono,Menlo,Monaco,Courier New,monospace"
|
||||
(Linux) "Source Code Pro,DejaVu Sans Mono,Courier New,monospace"
|
||||
(others) "DejaVu Sans Mono,Courier New,monospace"]],
|
||||
doc = [["DejaVu Sans Mono,Courier New,monospace"
|
||||
Mac: "SF Mono,Menlo,Monaco,Courier New,monospace"
|
||||
Linux: "Source Code Pro,DejaVu Sans Mono,Courier New,monospace"
|
||||
MS-Windows: "Cascadia Code,Cascadia Mono,Consolas,Courier New,monospace"]],
|
||||
meta = 'DFLT_GFN',
|
||||
},
|
||||
desc = [=[
|
||||
This is a list of fonts which will be used for the GUI version of Vim.
|
||||
|
||||
@@ -1775,10 +1775,10 @@ int path_is_url(const char *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Check if "fname" starts with "name://" or "name:\\".
|
||||
/// Check if "fname" starts with "name:/" or "name:\".
|
||||
///
|
||||
/// @param fname is the filename to test
|
||||
/// @return URL_SLASH for "name://", URL_BACKSLASH for "name:\\", zero otherwise.
|
||||
/// @return URL_SLASH for "name:/", URL_BACKSLASH for "name:\", zero otherwise.
|
||||
int path_with_url(const char *fname)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
|
||||
@@ -4,26 +4,27 @@ M.vars = {
|
||||
argf = {
|
||||
type = 'string[]',
|
||||
desc = [=[
|
||||
The list of file arguments passed on the command line at startup.
|
||||
|
||||
Each filename is expanded to an absolute path, so that v:argf
|
||||
remains valid even if the current working directory changes later.
|
||||
File arguments (expanded to absolute paths) given at startup.
|
||||
|
||||
Unlike |v:argv|, this does not include option arguments
|
||||
such as `-u`, `--cmd`, or `+cmd`. Unlike |argv()|, it is not
|
||||
affected by later |:args|, |:argadd|, or plugin modifications.
|
||||
It also handles the `--` separator correctly, including only
|
||||
files specified after it.
|
||||
|
||||
This is a read-only snapshot of the original startup file arguments.
|
||||
Example: >
|
||||
nvim file1.txt +ls -- file2.txt
|
||||
:echo v:argf
|
||||
" ['/path/to/cwd/file1.txt', '/path/to/cwd/file2.txt']
|
||||
<
|
||||
]=],
|
||||
},
|
||||
argv = {
|
||||
type = 'string[]',
|
||||
desc = [=[
|
||||
The command line arguments Vim was invoked with. This is a
|
||||
list of strings. The first item is the Vim command.
|
||||
See |v:progpath| for the command with full path.
|
||||
Command line arguments (`-u`, `--cmd`, `+cmd`, …) Nvim was
|
||||
invoked with. The first item is the Nvim command.
|
||||
|
||||
See |v:progpath| to get the full path to Nvim.
|
||||
See |v:argf| to get only file args, without other options.
|
||||
]=],
|
||||
},
|
||||
char = {
|
||||
|
||||
Reference in New Issue
Block a user