aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/man_spec.lua
Commit message (Collapse)AuthorAge
* test(plugin/man_spec): use pesc() on actual_file in pattern (#25199)zeertzjq2023-09-17
|
* test: add more tests for :Man section extractionzeertzjq2023-05-08
|
* fix(man.lua): tests, namingJustin M. Keyes2023-03-07
|
* feat(man.lua): support spaces in manpage namesEriks Muhins2023-03-07
| | | | | | | | | | Problem: :Man command errors if given more than two arguments. Thus, it is impossible to open man pages that contain spaces in their names. Solution: Adjust :Man so that it tries variants with spaces and underscores, and uses the first found.
* fix(man): use italics for `<bs>_` (#22086)Lewis Russell2023-02-01
| | | | | | | | | | | | fix(man): use italics for <bs>_ Even though underline is strictly what this should be. <bs>_ was used by nroff to indicate italics which wasn't possible on old typewriters so underline was used. Modern terminals now support italics so lets use that now. See: - https://unix.stackexchange.com/questions/274658/purpose-of-ascii-text-with-overstriking-file-format/274795#274795 - https://cmd.inp.nsk.su/old/cmd2/manuals/unix/UNIX_Unleashed/ch08.htm
* test: simplify platform detection (#21020)dundargoc2022-11-22
| | | | | 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")`.
* test: introduce skip() #21010dundargoc2022-11-13
| | | | | | | This is essentially a convenience wrapper around the `pending()` function, similar to `skip_fragile()` but more general-purpose. Also remove `pending_win32` function as it can be replaced by `skip(iswin())`.
* ci: add cirrus to isCI function to skip tests (#20526)dundargoc2022-10-17
| | | | The environment variable CIRRUS_CI is manually passed to RunTests.cmake as it doesn't get passed when using cmake script mode.
* fix(man): handle absolute paths as `:Man` targets (#20624)Mahmoud Al-Qudsi2022-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix(man): handle absolute paths as :Man targets Previously, attempting to provide `:Man` with an absolute path as the name would cause neovim to return the following error: ``` Error detected while processing command line: /usr/local/share/nvim/runtime/lua/man.lua:690: /usr/local/share/nvim/runtime/lua/man.lua:683: Vim:E426: tag not found: nil(nil) Press ENTER or type command to continue ``` ..because it would try to validate the existence of a man page for the provided name by executing `man -w /some/path` which (on at least some Linux machines [0]) returns `/some/path` instead of the path to the nroff files that would be formatted to satisfy the man(1) lookup. While man pages are not normally named after absolute paths, users shouldn't be blamed for trying. Given such a name/path, neovim would **not** complain that the path didn't have a corresponding man file but would error out when trying to call the tag function for the null-propagated name-and-section `nil(nil)`. (The same underlying error existed before this function was ported to lua, but did not exhibit the lua-specific `nil(nil)` name; instead a tag lookup for `()` would fail and error out.) With this patch, we detect the case where `man -w ...` returns the same value as the provided name to not only prevent invoking the tag function for a non-existent/malformed name+sect but also to properly report the non-existence of a man page for the provided lookup (the absolute path). While man(1) can be used to directly read an nroff-formatted document via `man /path/to/nroff.doc`, `:Man /path/to/nroff.doc` never supported this behavior so no functionality is lost in case the provided path _was_ an nroff file. [0]: `man -w /absolute/path` returning `/absolute/path` observed on an Ubuntu 18.04 installation. * test: add regression test for #20624 Add a functional test to `man_spec.lua` to check for a regression for #20624 by first obtaining an absolute path to a random file and materializing it to disk, then attempting to query `:Man` for an entry by that same name/path. The test passes if nvim correctly reports that there is no man page correspending to the provided name/path and fails if any other error (or no error) is shown.
* feat(Man): port to Lua (#19912)Lewis Russell2022-09-02
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* fix(exceptions): restore `did_throw` (#20000)Sean Dewar2022-08-30
| | | | | | | | | | | | | | | | | | `!did_throw` doesn't exactly imply `!current_exception`, as `did_throw = false` is sometimes used to defer exception handling for later (without forgetting the exception). E.g: uncaught exception handling in `do_cmdline()` may be deferred to a different call (e.g: when `try_level > 0`). In #7881, `current_exception = NULL` in `do_cmdline()` is used as an analogue of `did_throw = false`, but also causes the pending exception to be lost, which also leaks as `discard_exception()` wasn't used. It may be possible to fix this by saving/restoring `current_exception`, but handling all of `did_throw`'s edge cases seems messier. Maybe not worth diverging over. This fix also uncovers a `man_spec.lua` bug on Windows: exceptions are thrown due to Windows missing `man`, but they're lost; skip these tests if `man` isn't executable.
* fix(man.vim): q in "$MANPAGER mode" does not quit #18443Arsham Shirvani2022-05-13
| | | | | | | | | | | | | | | | | Problem: q in "$MANPAGER mode" does not quit Nvim. This is because ftplugin/man.vim creates its own mapping: nnoremap <silent> <buffer> <nowait> q :lclose<CR><C-W>c which overrides the one set by the autoload file when using :Man! ("$MANPAGER mode") Solution: Set b:pager during "$MANPAGER mode" so that ftplugin/man.vim can set the mapping correctly. Fixes #18281 Ref #17791 Helped-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* tests/ui: remove unnecessary screen:detach()Björn Linse2019-10-13
| | | | | | | | | | | | | It is perfectly fine and expected to detach from the screen just by the UI disconnecting from nvim or exiting nvim. Just keep detach() in screen_basic_spec, to get some coverage of the detach method itself. This avoids hang on failure in many situations (though one could argue that detach() should be "fast", or at least "as fast as resize", which works in press-return already). Never use detach() just to change the size of the screen, try_resize() method exists for that specifically.
* tests/ui: cleanup illegitimate usages of "attr_ignore"Björn Linse2019-10-13
| | | | | "attr_ignore" is an anti-pattern, with snapshot_util() just include all the highlights already.
* test/man_spec: remove plugin_helpers.reset()Justin M. Keyes2019-08-05
| | | | | | | | | The call to plugin_helpers.reset() is redundant with the clear() call above it. Probably just a copy-paste mistake. Avoids exit_event race #8813. Helped-by: Björn Linse <bjorn.linse@gmail.com>
* man.vim: Handle ANSI escape sequences with ":" #10267Kovas Palunas2019-06-30
| | | | closes #10267
* test: man_spec: Fix use of nested [[ quotingJames McCoy2018-02-02
| | | | | | Lua (not LuaJIT) complains about the "^[[" strings inside the expect, since it sees them as nested quotes. Change the quoting to [=[ ]=] to avoid the issue.
* Merge #7623 'man.vim: highlight bold, underlined text'Justin M. Keyes2018-01-09
|
* Address PR commentsGabriel Holodak2017-12-27
|
* Add functional tests for man highlightingGabriel Holodak2017-12-27