summaryrefslogtreecommitdiffstatshomepage
path: root/test/functional/ui/embed_spec.lua
AgeCommit message (Collapse)AuthorFiles
2026-02-20test: start test runners in Xtest_xdg dir (#37964)zeertzjq1
This is a better way to prevent parallel tests from interfering with each other, as there are many ways files can be created and deleted in tests, so enforcing different file names is hard. Using $TMPDIR can also work in most cases, but 'backipskip' etc. have special defaults for $TMPDIR. Symlink runtime/, src/, test/ and README.md to Xtest_xdg dir to make tests more convenient (and symlinking test/ is required for busted). Also, use README.md instead of test/README.md in the Ex mode inccommand test, as test/README.md no longer contains 'N' char.
2026-02-17fix(highlight): refresh highlight attrs before message output #25737glepnir1
Problem: When MsgArea highlight is changed, the next message may flash and disappear because msg_start() renders with stale highlight attributes. msg_puts_len() uses HL_ATTR(HLF_MSG) to render message text, which happens before update_screen() calls highlight_changed(). So the message is rendered with outdated attrs. Solution: Call highlight_changed() in msg_start().
2026-02-01test: wait for uv.pipe_connect() callback (#37640)zeertzjq1
Problem: On Windows, writing to a pipe doesn't work if the pipe isn't connected yet. This causes an RPC request to a session newly created by connect() to hang, as it's waiting for a response to a request that never reaches the server. Solution: Wait for uv.pipe_connect() callback to be called when using connect().
2026-01-31fix(ui): don't crash if maximum UI count reached (#37636)zeertzjq1
2026-01-31test: add reasons to some skipped tests (#37632)zeertzjq1
2025-11-29fix(colorscheme): adjust `StatusLine[NC]` for diagnostics #36719Evgeni Chasnovski1
Problem: It is desirable for the default statusline to contain colored diagnostics information. However, current `StatusLine` group is purposefully defined as almost inverted `Normal` to "make current window obvious". This makes diagnostic information from `vim.diagnostic.status()` barely visible: it uses established `DiagnosticSignXxx` groups which have colored foreground with lightness close to `StatusLine` background. Also the `StatusLineNC` group is fairly different from `Normal` in order to both "makes window separators clear" and "be different from `CursorLine`". But not as mush different as `StatusLine` because "`StatusLine` and `StatusLineNC` should be clearly different". Solution: Make both `StatusLine` and `StatusLineNC` be slightly closer in lightness to `Normal`. This makes `StatusLine` and `StatusLineNC` groups satisfy their conditions in the following way: - `vim.diagnostic.count()` is readable on `StatusLine` - yes. - `vim.diagnostic.count()` is readable on `StatusLineNC` - yes. - `StatusLine` makes current window obvious - I'd say yes. - `StatusLine` and `StatusLineNC` are clearly different - it depends on the eyes and monitor. The current is clearly better, but the new ones I'd say are still visibly different. - `StatusLineNC` makes window separators clear - I'd say yes, but depends on the eyes and monitor. - `StatuslineNC` is different from `CursorLine` - NO, they are same. Another approach to solve this would be to introduce dedicated `DiagnosticStatuslineXxx` groups to use in `vim.diagnostics.status()`. They can be defined using foreground colors from the same lightness as `Normal`. This would make them readable in `StatusLine`. But not `StatusLineNC`, though.
2025-10-31Merge pull request #36393 from zeertzjq/rstream-close-cbzeertzjq1
fix(channel): closing socket with pending writes leaks memory
2025-05-04feat(messages): cleanup Lua error messagesJustin M. Keyes1
"Error" in error messages is redundant. Just provide the context, don't say "Error ...".
2024-11-14fix(tests): needing two calls to setup a screen is cringebfredl1
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.
2024-11-11refactor(tests): use more global highlight definitionsbfredl1
2024-11-08refactor(message): propagate highlight id instead of attrsLuuk van Baal1
Problem: Highlight group id is not propagated to the end of the message call stack, where ext_messages are emitted. Solution: Refactor message functions to pass along highlight group id instead of attr id.
2024-04-23test: improve test conventionsdundargoc1
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.
2024-04-11test: remove unnecessary nil argument to testutil (#28270)zeertzjq1
2024-04-10refactor(test): inject after_each differentlyLewis Russell1
2024-04-08test: improve test conventionsdundargoc1
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-06fix: adjust error message for error in UI event callback (#28200)zeertzjq1
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
2024-04-02test: silence expected errorsdundargoc1
This will remove unrelated errors in .nvimlog at the end of test output.
2024-02-02feat(quickfix): support -q - to read 'errorfile' from stdin (#27303)zeertzjq1
Note that this only works when stdin is a pipe.
2024-01-19feat(ui): add chdir UI event (#27093)Gregory Anders1
When an embedded Nvim instance changes its current directory a "chdir" UI event is emitted. Attached UIs can use this information however they wish. In the TUI it is used to synchronize the cwd of the TUI process with the cwd of the embedded Nvim process.
2024-01-13fix(colorscheme): default statusline groups usability #26921Evgeni Chasnovski1
Problem: Current values of `StatusLine` and `StatusLineNC` are currently designed to be visually distinctive while being not intrusive. However, the compromise was more shifted towards "not intrusive". After the feedback, statusline highlight groups should be designed to: - Make current window clearly noticeable. Meaning `StatusLine` and `StatusLineNC` should obviously differ. - Make non-current windows clearly separable. Meaning `StatusLineNC` and `Normal`/`NormalNC` should obviously differ. Solution: - Update `StatusLineNC` to have more visible background. - Update `StatusLine` to be inverted variant of `StatusLineNC`. - Update `WinBar` and `WinBarNC` to not link to `StatusLine` and `StatusLineNC` because it makes two goals harder to achieve. - Update `TabLine` to link to `StatusLineNC` instead of `StatusLine` to not be very visually intrusive.
2024-01-12test: rename (meths, funcs) -> (api, fn)Lewis Russell1
2024-01-12test: use vim.mpack and vim.uv directlyLewis Russell1
2024-01-03refactor: format test/*Justin M. Keyes1
2023-12-16feat(highlight): tweak default color schemeEvgeni Chasnovski1
Problem: Updating default color scheme produced some feedback. Solution: Address the feedback. Outline of the changes: - Colors `Grey1` and `Grey2` are made a little bit more extreme (dark - darker, light - lighter) to increase overall contrast. - `gui` colors are treated as base with `cterm` colors falling back to using 0-15 colors which come from terminal emulator. - Update highlight group definition to not include attribute definition if it is intended to staty uncolored. - Tweak some specific highlight groups. - Add a list of Neovim specific highlight groups which are now defined differently in a breaking way. - Minor tweaks in several other places related to default color scheme.
2023-12-09test: avoid repeated screen lines in expected stateszeertzjq1
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
2023-12-06fix(startup): only send one default_colors_set event during startupbfredl1
If the color scheme is changed in a startup script, nvim used to send multiple default_colors_set events, one for the default color scheme and one for the user's chosen color scheme. This would cause flicker in some UI:s. Throttle this event until we actually start drawing on the screen. fixes #26372
2023-12-02feat(highlight): update default color schemeEvgeni Chasnovski1
Problem: Default color scheme is suboptimal. Solution: Start using new color scheme. Introduce new `vim` color scheme for opt-in backward compatibility. ------ Main design ideas - Be "Neovim branded". - Be minimal for 256 colors with a bit more shades for true colors. - Be accessible through high enough contrast ratios. - Be suitable for dark and light backgrounds via exchange of dark and light palettes. ------ Palettes - Have dark and light variants. Implemented through exporeted `NvimDark*` and `NvimLight*` hex colors. - Palettes have 4 shades of grey for UI elements and 6 colors (red, yellow, green, cyan, blue, magenta). - Actual values are computed procedurally in Oklch color space based on a handful of hyperparameters. - Each color has a 256 colors variant with perceptually closest color. ------ Highlight groups Use: - Grey shades for general UI according to their design. - Bold text for keywords (`Statement` highlight group). This is an important choice to increase accessibility for people with color deficiencies, as it doesn't rely on actual color. - Green for strings, `DiffAdd` (as background), `DiagnosticOk`, and some minor text UI elements. - Cyan as main syntax color, i.e. for function usage (`Function` highlight group), `DiffText`, `DiagnosticInfo`, and some minor text UI elements. - Red to generally mean high user attention, i.e. errors; in particular for `ErrorMsg`, `DiffDelete`, `DiagnosticError`. - Yellow very sparingly only with true colors to mean mild user attention, i.e. warnings. That is, `DiagnosticWarn` and `WarningMsg`. - Blue very sparingly only with true colors as `DiagnosticHint` and some additional important syntax group (like `Identifier`). - Magenta very carefully (if at all). ------ Notes - To make tests work without relatively larege updates, each one is prepended with an equivalent of the call `:colorscheme vim`. Plus some tests which spawn new Neovim instances also now use 'vim' color scheme. In some cases tests are updated to fit new default color scheme.
2023-11-23test: remove the pipe created by new_pipename() (#26173)zeertzjq1
2023-11-03test(ui/embed_spec): make sure server is started (#25880)zeertzjq1
2023-11-01fix(startup): trigger UIEnter for the correct channel (#25860)zeertzjq1
2023-11-01feat(server): allow embed with listen (#25709)George Harker1
connection from any channel or stdio will unblock remote_ui_wait_for_attach. Wait on stdio only if only —embed specified, if both —embed and —listen then wait on any channel.
2023-10-09test(ui/embed_spec): use notification instead of request (#25555)zeertzjq1
This avoid the hang mentioned in #24888, and also matches TUI better.
2022-11-22test: simplify platform detection (#21020)dundargoc1
Extend the capabilities of is_os to detect more platforms such as freebsd and openbsd. Also remove `iswin()` helper function as it can be replaced by `is_os("win")`.
2022-10-05feat(messages)!: graduate the 'msgsep' featurebfredl1
The old behaviour (e.g. via `set display-=msgsep`) will not be available. Assuming that messages always are being drawn on msg_grid (or not drawn at all, and forwarded to `ext_messages` enabled UI) will allows some simplifcations and enhancements moving forward.
2022-05-02refactor(ui): simplify stdin handlingbfredl1
2019-10-18tests: fix non-controversial misuse of `pending` (#11247)Daniel Hahler1
Ref: https://github.com/neovim/neovim/pull/11184
2019-09-02screen: initialize screen properly with early `set display-=msgsep`Björn Linse1
Currently `nvim -u NORC --cmd "set display-=msgsep"` will still allocate the message grid and remove it just afterwards. While inefficient, we must make sure update_screen() re-validates the default_grid completely when this happens. Fix some invalid logic: don't reallocate msg_grid on resize when the grid is not used. Elide a too early ui_flush() on startup, which caused an invalid cursor position to be used.
2019-09-01test/uname(): always lowercaseJustin M. Keyes1
2019-09-01test/OpenBSD: skip some testsJustin M. Keyes1
Temporary workaround to unblock CI for OpenBSD.
2019-09-01test/ui: update tests for new msg_grid implementationBjörn Linse1
2019-04-27test: clear(): remove `opts.headless` parameterJustin M. Keyes1
Callers can instead specify `args_rm={'--headless'}`. TODO: should `nvim_argv` have "--headless" by default? Need to inspect some uses of spawn(nvim_argv) ...
2018-11-30functionaltests: vim-patch:8.1.{550,551} fixJan Edmund Lazo1
2018-11-20defaults: background=dark #2894 (#9205)Justin M. Keyes1
By historical accident, Nvim defaults to background=light. So on a dark background, `:colorscheme default` looks completely wrong. The "smart" logic that Vim uses is confusing for anyone who uses Vim on multiple platforms, so rather than mimic that, pick the (hopefully) most common default. - Since Neovim is dark-powered, we assume most users have dark backgrounds. - Most of the GUIs tend to have a dark background by default. ref #6289
2018-10-01ui: rename ext_newgrid to ext_linegridBjörn Linse1
2018-09-22startup: always wait for UI with --embed, unless --headless also is suppliedBjörn Linse1
2018-09-20startup: don't erase screen on `:hi Normal` during startupBjörn Linse1
NB: existing `color default` test was actually enough to trigger the bug, when ext_newgrid=false is used. I created the `:hi Normal` test as I thought the builtin colors wouldn't set Normal (unless 'bg' is changed) But as the root cause actually comes from `:hi Normal`, it makes sense to still add the separate test (if `color default` here gets optimized to become a no-op, or something).
2018-09-18startup: wait for embedder before executing startup commands and filesBjörn Linse1
Give embeders a chance to set up nvim, by processing a request before startup. This allows an external UI to show messages and prompts from --cmd and buffer loading (e.g. swap files)