| Commit message (Collapse) | Author | Age |
|
|
| |
Related #27764
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`nvim -es` (and `nvim -Es`) is the recommended way to non-interactively
run commands/vimscript. But it enables shada by default, which is
usually not wanted.
Solution:
- Disable shada by default for `nvim -es/-Es`. This can be overridden by
`-i foo` if needed.
- Do NOT change the 'loadplugins' default.
- User config + packages _should_ be enabled by default, for both `nvim
-es` and `nvim -l`. Else any Lua packages you have can't be accessed
without `-u path/to/config`, which is clumsy.
- Use-cases:
```
nvim --headless "+Lazy! sync" +qa
would become: nvim -es "+Lazy! sync"
nvim --headless +PlugInstall +qall
would become: nvim -es +PlugInstall
```
- Opt-out (`--clean` or `-u NONE`) is much easier than opt-in (`-u
path/to/config`).
- User config/packages are analogous to pip packages, which are
expected when doing `python -c ...`.
related: 7c94bcd2d77e2e54b8836ab8325460a367b79eae
related: ddd0eb6f5120a09b97867d2561ea61309038ccd2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- `n.spawn()` is misleading because it also connects RPC, it's not just
"spawning" a process.
- It's confusing that `n.spawn()` and `n.spawn_argv()` are separate.
Solution:
- Replace `n.spawn()`/`n.spawn_argv()` with a single function `n.new_session()`.
This name aligns with the existing functions `n.set_session`/`n.get_session`.
- Note: removes direct handling of `prepend_argv`, but I doubt that was
important or intentional. If callers want to control use of `prepend_argv`
then we should add a new flag to `test.session.Opts`.
- Move `keep` to first parameter of `n.new_session()`.
- Add a `merge` flag to `test.session.Opts`
- Mark `_new_argv()` as private. Test should use clear/new_session/spawn_wait
instead.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Tests that need to check `nvim` CLI behavior (no RPC session) create
their own ad-hoc `system()` wrappers.
Solution:
- Use `n.spawn_wait` instead of `system()`.
- Bonus: this also improves the tests by explicitly checking for
`stdout` or `stderr`. And if a signal is raised, `ProcStream.status`
will reflect it.
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Can't use `n.clear()` to test non-RPC `nvim` invocations. So tests end
up creating ad-hoc wrappers around `system()` or `jobstart()`.
Solution:
- Introduce `n.spawn_wait()`
- TODO (followup PR): Rename `n.spawn()` and `n.spawn_wait()`.
It's misleading that `n.spawn()` returns a RPC session...
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`termopen` has long been a superficial wrapper around `jobstart`, and
has no real purpose. Also, `vim.system` and `nvim_open_term` presumably
will replace all features of `jobstart` and `termopen`, so centralizing
the logic will help with that.
Solution:
- Introduce `eval/deprecated.c`, where all deprecated eval funcs will live.
- Introduce "term" flag of `jobstart`.
- Deprecate `termopen`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a terminal application running inside the terminal emulator sets
the cursor shape or blink status of the cursor, update the cursor in the
parent terminal to match.
This removes the "virtual cursor" that has been in use by the terminal
emulator since the beginning. The original rationale for using the
virtual cursor was to avoid having to support additional UI methods to
change the cursor color for other (non-TUI) UIs, instead relying on the
TermCursor and TermCursorNC highlight groups.
The TermCursor highlight group is now used in the default 'guicursor'
value, which has a new entry for Terminal mode. However, the
TermCursorNC highlight group is no longer supported: since terminal
windows now use the real cursor, when the window is not focused there is
no cursor displayed in the window at all, so there is nothing to
highlight. Users can still use the StatusLineTermNC highlight group to
differentiate non-focused terminal windows.
BREAKING CHANGE: The TermCursorNC highlight group is no longer supported.
|
|
|
|
| |
In release builds, the Compilation: line is omitted so the build is reproducible. Since the "fall-back for $VIM" line is always present, check for that instead.
|
|
|
| |
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
|
|
|
|
|
|
| |
Problem: Separate message emitted for each newline present in Lua
print() arguments.
Solution: Make msg_multiline() handle NUL bytes. Refactor print() to use
msg_multiline(). Refactor vim.print() to use print().
|
|
|
|
|
|
|
|
|
|
| |
Before calling "attach" a screen object is just a dummy container for
(row, col) values whose purpose is to be sent as part of the "attach"
function call anyway.
Just create the screen in an attached state directly. Keep the complete
(row, col, options) config together. It is still completely valid to
later detach and re-attach as needed, including to another session.
|
|
|
|
|
| |
Problem: Crash when initializing for --startuptime errors.
Solution: Report the error to stderr, as neither logging nor messages
have been initialized yet.
|
| |
|
| |
|
|
|
|
|
| |
This module is generally used by any tests that need the full Nvim TUI
instead of `screen.lua`. Thus it should live in `functional/` instead of
in `functional/terminal/`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The default "session name" for the builtin TUI is "ui".
before:
INF 2024-09-10T14:57:35.385 hello.sock os_exit:692: Nvim exit: 1
INF 2024-09-10T14:57:35.388 ?.4543 os_exit:692: Nvim exit: 1
after:
INF 2024-09-10T14:59:19.919 hello.sock os_exit:692: Nvim exit: 1
INF 2024-09-10T14:59:19.922 ui.5684 os_exit:692: Nvim exit: 1
|
|
|
|
|
|
|
| |
- `alter_slashes` belongs in `testutil.lua`, not `testnvim.lua`.
- `alter_slashes` is an unusual name. Rename it to `fix_slashes`.
- invert its behavior, to emphasize that `/` slashes are the preferred,
pervasive convention, not `\` slashes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
If $NVIM_APPNAME is a relative dir path, Nvim fails to start its
primary/default server, and `v:servername` is empty.
Root cause is d34c64e342dfba9248d1055e702d02620a1b31a8, but this wasn't
noticed until 96128a5076b7 started reporting the error more loudly.
Solution:
- `server_address_new`: replace slashes "/" in the appname before using
it as a servername.
- `vim_mktempdir`: always prefer the system-wide top-level "nvim.user/"
directory. That isn't intended to be specific to NVIM_APPNAME; rather,
each *subdirectory* ("nvim.user/xxx") is owned by each Nvim instance.
Nvim "apps" can be identified by the server socket(s) stored in those
per-Nvim subdirs.
fix #30256
|
|
|
|
|
|
|
|
|
| |
Problem:
137f98cf6428 added the `create` parameter to `tmpname()` but didn't
fully implement it.
Solution:
- Update impl for the `os.tmpname()` codepath.
- Inspect all usages of `tmpname()`, update various tests.
|
|
|
|
| |
:filetype detect should enable filetype detection when it hasn't been
enabled before.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Followup to #28515:
Rename the static os_homedir() to os_uv_homedir() to emphasize that it
is a wrapper around a libuv function.
Add the function os_get_homedir() to os/env.c to return the cached
homedir value as a const. Must be called after homedir is initialized or
it fails.
The difference between this function and the static os_uv_homedir() is
that the latter gets the homedir from libuv and is used to initialize
homedir in init_homedir(), while os_get_homedir() just returns homedir
as a const if it's initialized and is public.
Use the os_get_homedir() accessor for ~/ expansion on Windows to make
the code more concise.
Add a Windows section to main_spec.lua with tests for expanding ~/ and
~\ prefixes for files passed in on the command-line.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Specifically, functions that are run in the context of the test runner
are put in module `test/testutil.lua` while the functions that are run
in the context of the test session are put in
`test/functional/testnvim.lua`.
Closes https://github.com/neovim/neovim/issues/27004.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:
- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
- iter.flatten():
```
vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
```
- tbl_flatten:
```
vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
```
Solution:
Deprecate tbl_flatten.
Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:
local anonym = vim.iter({ -- remove nil
anonymous_num > 1 and '' or nil,
'---@class ' .. anonymous_classname,
}):flatten():totable()
Should we enhance :flatten() to work for arrays?
|
| |
|
|
|
|
| |
Work on https://github.com/neovim/neovim/issues/27004.
|
|
|
|
|
|
| |
Also close Nvim instance before removing log file, otherwise the Nvim
instance will still write to the log file.
Also adjust log level in libuv_process_spawn(). Ref #27660
|
|
|
|
|
|
|
| |
Ref #21393
- Move default user commands to _defaults.lua as that now contains all
kinds of defaults rather than just default mappings and menus.
- Remove the :aunmenu as there are no menus when _defaults.lua is run.
|
|
|
|
| |
This will remove unrelated errors in .nvimlog at the end of test output.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the first installment of a multi-PR series significantly
refactoring how highlights are being specified.
The end goal is to have a base set of 20 ish most common highlights,
and then specific files only need to add more groups to that as needed.
As a complicating factor, we also want to migrate to the new default
color scheme eventually. But by sharing a base set, that future PR
will hopefully be a lot smaller since a lot of tests will be migrated
just simply by updating the base set in place.
As a first step, fix the anti-pattern than Screen defaults to ignoring
highlights. Highlights are integral part of the screen state, not
something "extra" which we only test "sometimes". For now, we still
allow opt-out via the intentionally ugly
screen._default_attr_ids = nil
The end goal is to get rid of all of these eventually (which will be
easier as part of the color scheme migration)
|
|
|
|
|
|
|
|
| |
Problem Description: In ex_mode, the default_grid.chars are not allocated, and subsequently,
the w_grid.target in curwin is not allocated to default_grid in update_screen. This leads to
a null pointer crash when the completion function is executed in ex_mode.
Solution: Set full_screen when in ex_mode to ensure that default_grid is allocated.
|
| |
|
|
|
| |
Minor "best practices" nudge.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Since 24488169564c39a506c235bf6a33b8e23a8cb528, the --startuptime report shows
two blocks of data. The TUI process and its embedded nvim process write to the
file concurrently, which may interleave the two startup sequences into the same
timeline.
Solution:
Report each process as a separate section in the same file.
1. Each process buffers the full report.
2. After startup is finished, the buffer is flushed (appended) to the file.
Fix #23036
Sample report:
--- Startup times for process: Primary/TUI ---
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.006 000.006: --- NVIM STARTING ---
000.428 000.422: event init
000.728 000.301: early init
...
005.880 000.713: init highlight
005.882 000.002: --- NVIM STARTED ---
--- Startup times for process: Embedded ---
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.006 000.006: --- NVIM STARTING ---
000.409 000.403: event init
000.557 000.148: early init
000.633 000.077: locale set
...
014.383 000.430: first screen update
014.387 000.003: --- NVIM STARTED ---
|
|
|
| |
Follow-up to #25236
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem: :drop does not re-use empty buffer
(Rocco Mao)
Solution: Make :drop re-use an empty buffer
(Rocco Mao)
fixes: vim/vim#13851
closes: vim/vim#13881
https://github.com/vim/vim/commit/f96dc8d07f752ddd96d1447d85278a85255a1462
Co-authored-by: Rocco Mao <dapeng.mao@qq.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
rbuffer_consumed assertion fails if Unpacker fails to parse msgpack,
because it doesn't consume bytes on errors
Solution:
Call rbuffer_consumed_compact only if Unpacker isn't closed
|
|
|
|
|
|
|
|
|
|
|
|
| |
The motivation for this update is Issue #15365, where background=light
is not properly set for Nvim running from an Nvim :terminal. This can be
encountered when e.g., opening a terminal to make git commits, which
opens EDITOR=nvim in the nested terminal.
Under the implementation of this commit, the OSC response always
indicates a black or white foreground/background. While this may not
reflect the actual foreground/background color, it permits 'background'
to be retained for a nested Nvim instance running in the terminal
emulator. The behaviour matches Vim.
|
| |
|
|
|
|
|
| |
- remove helpers.cur*meths
- remove helpers.nvim
|
| |
|
| |
|
| |
|