This allows executables to be found by :!, system(), and executable() if
they live next to ("sibling" to) nvim.exe. This is what gvim on Windows
does, and also matches the behavior of Win32 SearchPath().
c4a249a736/src/os_win32.c (L354-L370)
Closes#3689
cmake: Add `desktop-install` and `icon-install` targets. `runtime`
target will trigger them.
Specification:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#recognized-keys
Icons are stored system-wide in /usr/share/applications or user wide at
/usr/share/icons/hicolor/scalable/apps and can be overriden in ~/.local/share/icons
nvim.desktop file can be installed system wide or in
~/.local/share/applications/
To test without an installer:
$ xdg-desktop-menu install --novendor runtime/nvim.desktop
$ xdg-icon-resource install --novendor --mode user --size 64 contrib/nvim-icon.png
Once it is installed, you can test with gtk-launch if installed or
dmenu/rofi (drun mode)
This default causes too much confusion for terminal users. Until
a better approach is implemented, revert to the traditional default.
Better solution would be:
- Implement a right-click menu for TUI
- Set 'mouse=a' *only* if clipboard is working.
Closes#5938
Since `curl -s` is used, the actual error (e.g. "curl: (6) Could not
resolve host: pypi.python.org") gets not reported anyway, and s:download
returns an error message with `s:shell_error` already.
This changes `s:download` to also include `a:url` in the error message
now.
It removes
> ERROR: Command error (7) curl -sL https://pypi.python.org/pypi/neovim/json:
And changes
> ERROR: HTTP request failed: error: curl error with https://pypi.python.org/pypi/neovim/json: 6
This helps to identify where the `neovim` module is coming from, e.g.
- INFO: python3-neovim version: 0.1.10 (outdated; from ~/Vcs/neovim-python-client/neovim)
- WARNING: Latest python3-neovim is NOT installed: 0.1.12
- s:version_info: return errors from the `import`
- skip report_ok for latest version, in case the current version was
not found. status contains the error that has been reported in that
case already.
* health: Handle backslash path separators.
* health: brevity, consistency
* health: Do not set bufhidden=wipe.
In the context of CheckHealth, bufhidden=wipe loses data for no reason.
I gone through every single line, renamed the variables to be more consistent
and reordered many lines. Information is now printed as soon as it's available
and errors lead to early returns.
I altered the suggestions for each condition to be more precise and checked that
they fail properly.
This also prevents invalid arguments getting passed to s:version_cmp().
- Eliminate global test_autochdir.
- Eliminate VimL function test_autochdir()
- Use a lua test instead. Fails correctly after reverting
0c43479979 / vim-patch:7.4.2015.
Problem: getwininfo() and getbufinfo() are inefficient.
Solution: Do not make a copy of all window/buffer-local options. Make it
possible to get them with gettabwinvar() or getbufvar().
3056735ae8
Problem: The field names used by getbufinfo(), gettabinfo() and
getwininfo() are not consistent.
Solution: Use bufnr, winnr and tabnr. (Yegappan Lakshmanan)
3392883770
Problem: It's not easy to find out if a window is a quickfix or location
list window.
Solution: Add "loclist" and "quickfix" entries to the dict returnec by
getwininfo(). (Yegappan Lakshmanan)
386600f0cb
Problem: It is not easy to get information about buffers, windows and
tabpages.
Solution: Add getbufinfo(), getwininfo() and gettabinfo(). (Yegappan
Lakshmanan)
b5ae48e9ff
- Improves compatibility with shell=tcsh.
- man.vim: split read_page into get_page, put_page. Do not split the
window until we know there is going to be output.
Problem: When using a partial on a dictionary it always gets bound to that
dictionary.
Solution: Make a difference between binding a function to a dictionary
explicitly or automatically.
1d429610bf
This ameliorates use-cases like:
:!cat foo.txt
:make
where the user is interested in the last few lines of output.
Try these shell-based ex-commands before/after this commit:
:grep -r '' *
:make
:!yes
:!grep -r '' *
:!git grep ''
:!cat foo
:!echo foo
:!while true; do date; done
:!for i in `seq 1 20000`; do echo XXXXXXXXXX $i; done
In all cases the last few lines of the command should always be shown,
regardless of where throttling was triggered.
Periodically skip :! spam. This is a "cheat" that works for all UIs and greatly
improves responsiveness when :! spams MB or GB of output:
:!yes
:!while true; do date; done
:!git grep ''
:grep -r '' *
After ~10KB of data is seen from a single :! invocation, output will be skipped
for ~1s and three dots "..." will pulse in the bottom-left. Thereafter the
behavior alternates at every:
* 10KB received
* ~1s throttled
This also avoids out-of-memory which could happen with large :! outputs.
Note: This commit does not change the behavior of execute(':!foo').
execute(':!foo') returns the string ':!foo^M', it captures *only* Vim
messages, *not* shell command output. Vim behaves the same way.
Use system('foo') for capturing shell command output.
Closes#1234
Helped-by: oni-link <knil.ino@gmail.com>
- By re-enabling code blocks (every line that doesn't begin with a "-" and is
indented by at least 4 spaces), we prevent the Markdown syntax to evaluate "_"
as beginning for italic text.
That's the case for `:CheckHealth deoplete` for instance. It would output:
$ cat /tmp/log_{PID}
Since the deoplete check gets run first, almost all of the following
`:CheckHealth` output would be italic.
- Since we re-enable code blocks, we now have to tell our custom syntax that it
can be part of markdownCodeBlock as well. Otherwise there would be no
highlithing for our keywords ERROR, INFO, etc. after 4 spaces of indent.
- Since we do the above anyway, we make it work for mkdListItemLine as well.
That's a highlight group from `plasticboy/vim-markdown` opposed to the shipped
markdown syntax (which essentially is `tpope/vim-markdown`). Before this patch
there was no highlighting at all in the `:CheckHealth` output.
This option simplifies the configuration options:
1) `g:python{,3}_host_prog` is not set.
Neovim tries its best to find a suitable interpreter. This means calling
exepath(), potentially multiple times, and a system('python -c ...') with
the first found interpreter, to get the Python version.
2) `g:python{,3}_host_prog` is set.
Avoids everything of the above. No safety checks, no training wheels. Fast
host startup time!
Many people have `runtime ftplugin/man.vim` in their init file, as was
required in Vim to have the `:Man` command generally available.
7a4d069b removed the &filetype check, which caused these setups to
always create a blank `man://` buffer.
Contains the exit value nvim will use.
Before exiting, it is v:null. That way jobs or autocmds (in VimLeavePre or
VimLeave) can check if Neovim is about to quit and with what exit value.
Closes#4666.
Problem: It is not possible to only see part of the message history. It is
not possible to clear messages.
Solution: Add a count to ":messages" and a clear argument. (Yasuhiro
Matsumoto)
451f849fd6
In order to not conflict with new error codes that Vim adds, all Neovim
error codes should be above 5000. The three existing sub-5000 error
codes (E926, E951, and E952) are now E50003, E5004, and E5005
respectively.
E953 was removed in 6167ce6df2, so just
remove it from the help.
Problem: Crash when an autocommand changes a quickfix list. (Dominique)
Solution: Check wether an entry is still valid. (Yegappan Lakshmanan,
Hirohito Higashi)
ffec3c5349
command_line_changed:
- Check (current_SID == 0) instead of KeyTyped
- We want to update during mappings (KeyTyped is false then).
- Check vpeekc_any()
- Avoids unnecessary work.
- Avoids triggering live preview during macros.
- Caveat: This makes the redraw "stutter" if user spams (holds a key)
in the replace pattern. But that scenario is not important.
- Update screen if the command is changed to a non-live command.
(`s->live` goes from true => false) => clears the preview
command_line_execute:
- Let CTRL-C cancel live preview
do_sub:
- Enforce a time limit ('redrawtime').
- Unset 'inccommand' if time limit is reached.
Closes#5602Closes#5585
* health.vim: Include v:throwpoint in error message
* health/provider.vim: Check for ruby executable
* health/provider.vim: Combine subprocess stdout and stderr
* test: Updated CheckHealth test
- Use a standard scratch buffer instead of a new 'buftype', functions
like curbufIsChanged() already have special handling for scratch bufs.
- Cleanup some stuff from the previous merge.
- Add support for :smagic, :snomagic. Closes#5578
'inccommand' allows us to expand the feature to other commands, such as:
:cdo
:cfdo
:global
Also rename "IncSubstitute" highlight group to "Substitute".
- Eliminate/isolate static/global variables
- Remove special-case parameter from buflist_new()
- Remove special-case ECMD_RESERVED_BUFNR
- To determine when u_undo_and_forget() should be done, check
b_changedtick instead of a heuristic.
- use mb_string2cells() instead of strlen() to measure the :sub patterns
- call ml_close() before buf_clear_file(). Avoids leaks caught by ASan.
Original patch by:
Robin Elrharbi-Fleury (Robinhola)
Audrey Rayé (Adrey06)
Philémon Hullot (DesbyP)
Aymeric Collange (aym7)
Clément Guyomard (Clement0)
We can now use help links like in normal help pages. The bars around them will
be concealed as well.
* Health: link string "SUCCESS" to ModeMsg
So far we linked "SUCCESS" to the Function highlight group.
The newly introduced healthHelp group links to Idenfifier as it does for links
in normal help pages.
Now the problem is that the Function group links again to Identifier as well, so
both, "SUCCESS" and help links, would use the same colors.
* Health: don't use Markdown code blocks
Every line indented by more than 4 spaces would lose its highlighting otherwise.
* Health: add helper health#help_to_link()
Never throw an error when provider/clipboard.vim is sourced for the first time.
Save the error instead and expose it via `provider#clipboard#Error()`, mimicking
provider/python.vim.
Originally implemented by
* Clement0
* DesbyP
* aym7
* Adrey06
* Robinhola
in #4811. Major reworkings and bug
fixes by
* bfredl
Most tests suggested by ZyX-l, suggestions for improvements by oni-link.
API level is disconnected from NVIM version. The API metadata holds the
current API level, and the lowest backwards-compatible level supported
by this instance.
Release 0.1.6 is the first release that reports the Nvim version and API
level.
metadata['version'] = {
major: 0,
minor: 1,
patch: 6,
api_level: 1,
api_compatible: 0,
api_prerelease: false,
}
The API level may remain unchanged across Nvim releases if the API has
not changed.
When changing the API,
- set NVIM_API_PRERELEASE to true
- increment NVIM_API_LEVEL (at most once per Nvim version)
- adjust NVIM_API_LEVEL_COMPAT if backwards-compatibility was broken
api_level_0.mpack was generated from Nvim 0.1.5 with:
nvim --api-info
The API level is disconnected from the NVIM version. The API metadata
holds the current API level, and the lowest backwards-compatible level
supported by this instance.
Release 0.1.6 will be the first release reporting the Nvim version and
API level.
metadata['version'] = {
major: 0,
minor: 1,
patch: 6,
prerelease: true,
api_level: 1,
api_compatible: 0,
}
The API level may remain unchanged across Neovim releases if the API has
not changed.
When changing the API the CMake variable NVIM_API_PRERELEASE is set to
true, and NVIM_API_CURRENT/NVIM_API_COMPATIBILITY are incremented
accordingly.
The functional tests check the API table against fixtures of past
versions of Neovim. It compares all the functions in the old table with
the new one, it does ignore some metadata attributes that do not alter
the function signature or were removed since 0.1.5. Currently the only
fixture is 0.mpack, generated from Neovim 0.1.5 with nvim --api-info.
Closes#5449
A file containing the string "vim" followed by a very large number in a modeline
location will trigger an overflow in getdigits() which is called by
chk_modeline() when trying to parse the version number.
Add getdigits_safe(), which does not assert overflows, but reports them to the
caller.
vim-patch:7.4.2109
Problem: Setting 'display' to "lastline" is a drastic change, while
omitting it results in lots of "@" lines.
Solution: Add "truncate" to show "@@@" for a truncated line.
ad9c2a08f0
When a file is opened by nvim with ft=man already set, and
"has('vim_starting')", ftplugin/man.vim calls
'execute 'file man://'.ref', this causes nvim to display something like
this:
````
"<name of original file>" 977, 41017C
"man://foo(1)" [Not edited] 977 lines --0%--
Press ENTER or type command to continue
````
This is annoying, because nothing of note has actually happened.
Use cases why you might want to read a man page from a file:
`MANPAGER='bash -c "nvim -c \"set ft=man\" </dev/tty <(col -bx)"' man git`
`nvim -c 'set ft=man' <(man -P cat git)`
Closes#3529Closes#5241
In Vim,
:echo system('cat - &', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).
In Nvim,
:echo system('cat - &', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.
This still works:
:%w !tee > foo1358.txt &
but this does not:
:%w !tee foo1358.txt &
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
These tests are essentially affirming a regression vs Vim. In Vim,
:echo system('cat - &', 'foo')
returns "foo", because Vim internally wraps the command with shell-specific
syntax to redirect the streams from /dev/null[1].
That can't work in Nvim because we use pipes directly (instead of temp files)
and don't wrap the command with shell-specific redirection syntax.
References #3529
References #5241
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
`:CheckHealth nvim` would always report an outdated manifest if symlinks were
used, because the manifest file contains unresolved paths that get compared
against resolved paths.
Now we resolve paths before they get written to the manifest file.
If multiple versions of a package are installed, the provider health check could
choose a wrong path:
/usr/local/lib/python3.5/site-packages/neovim-0.1.10-py3.5.egg-info/PKG-INFO
/usr/local/lib/python3.5/site-packages/neovim-0.1.9-py3.5.egg-info/PKG-INFO
Prior to this change :CheckHealth could falsely show 0.1.9 as the installed
version, since glob() doesn't enforce any predictable order.
Now we sort all potential paths numerically in descending order and just look at
the first path instead.
Problem: Cannot use a window ID where a window number is expected.
Solution: Add LOWEST_WIN_ID, so that the window ID can be used where a
number is expected.
888ccac890
Problem: Non-GUI specific settings in the gvimrc_example file.
Solution: Move some settings to the vimrc_example file. Remove setting
'hlsearch' again. (suggested by Hirohito Higashi)
54f1b7abf8
Problem: Although emoji characters are ambiguous width, best is to treat
them as full width.
Solution: Update the Unicode character tables. Add the 'emoji' options.
(Yasuhiro Matsumoto)
3848e00e01
`deprecated.txt` is a place for deprecated tags to live.
- Encourages aggressive documentation of deprecations without cluttering
the main help files.
- Provides a single browsable reference of all deprecations.
Other changes:
- Move tags to doc/vim_diff.txt.
- Remove doc/quotes.txt. It has little historical value, except maybe the
Larry Wall quote.
Compare current version number to that of the latest released neovim
rubygem, rather than a hard-coded version.
Note: The `gem list` command introduced here adds about 4 seconds to the
execution time of the CheckHealth command.
- fix synopsis highlighting in other locales. Cannot always rely on the first
line for the section in some locales; instead, use the file path and
explicitly set b:man_sect to the actual section.
- eliminate separate s:man_args function
- simplify logic: do not reuse buffer content
- introduce b:man_default_sects Fixes#5233
- introduce <Plug>(man_vsplit), <Plug>(man_tab)
- simplify regexps
This is necessary incase the buffer was previously opened in a different
tab, in which the window options there do not carry over. It is not
explicitly documented in ':help local-options' but that is how it works.
:silent does not silence this message, even :redir does not consume it.
But execute() _does_ consume it, which interferes with the current
implementation of health.vim. It's prudent to avoid it in any case, even
if the implementation of health.vim changes in the future.
We can add this later if it is proven necessary, but it should not be
because:
1. User can run a subset of checkers via `:CheckHealth plugin1, ...,`
2. Healthcheck is a very rare operation. Optimizing it is not worth the
code/API complexity.
To healthcheck the "foo" plugin:
:CheckHealth foo
To healthcheck the "foo" and "bar" plugins:
:CheckHealth foo bar
To run all auto-discovered healthchecks:
:CheckHealth
- Use execute() instead of redir
- Fixed logic on suboptimal pyenv/virtualenv checks.
- Move system calls from strings to lists. Fixes#5218
- Add highlighting
- Automatically discover health checkers
- Add tests
Helped-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Helped-by: Tommy Allen <tommy@esdf.io>
Closes#4932
- Links to Search by default
screen.c: Combine CursorLine with QuickFixLine
- HLF_QFL takes priority over HLF_CUL
docs: Updated to mention QuickFixLine
runtime: Added QuickFixLine to nvimHLGroup
tests: QuickFixLine highlight
- Weird tab+space combination used for alignment. All spaces now
- Added back <C-T> mapping (somehow we missed that completely)
- Fixed mistake that <Plug>(Man) opens in a new tab. Also added note at
top on how the window is chosen/opened.
- Clarified q local mapping
- Removed section that shows an example autocmd to add desired folding
style.
- Removed random line in `usr_12.txt` about `<Leader>` and backslash.
- :Man supports completion, not auto-completion.
Closes#5171
In 3b12bb225a, ":oldfiles" was taught to
behave like Vim's ":browse oldfiles" if ":oldfiles!" was used. However,
this conflates the use of ! for abandoning a modified buffer with
choosing one file out of a list of oldfiles.
Now that ":browse" is supported again, ":browse oldfiles" will allow the
user to select an old file, while still complaining if that would cause
a modified buffer to be abandoned. ":browse oldfiles!" will just
abandon the buffer, as expected.
With -count, if the first argument is a number, it is made available
with <count>. Problem is, there is always a default count it is impossible
to tell whether the user set it.
Since v:count and v:count1 still work with 'keywordprg', -count is
unnecessary. But 'keywordprg' still calls ':Man' with a count prefixed.
So it must still accept a count in the line number position, but not consume
the first argument. This is done with -range.
Fixes#5202.
Regression from #5168. Also changed the Man command's nargs to '+' so
that man#open_page does not need to handle 0 arguments, because that
will never occur.
- Use the default buffer text provided by before_each (avoids extra steps and
makes the tests more consistent with each other)
- Indent
- Adjust help doc
- Smart autocomplete. It's automatically sorted, filtered for duplicates
and even formats the candidates based on what is needed. For example,
`:Man 1 printf<TAB>` will show the pages that are in section 1m as
'page(sect)' to let you know they are in a more specific section.
- Instead of trying to unset $MANPAGER we use the -P flag to set the
pager to cat
- Always use the section arg '-s', it makes the code much simpler
(see comment in s:man-args).
- A manpage name starting with '-' is invalid. It's fine for sections
because of the use of '-s'.
- The tagstack is an actual stack now, makes it much simpler.
- By using v:count and v:count1, the plugin can explicitly check whether
the user set a count, instead of relying on a default value (0) that
is actually a real manpage section.
- Extraction of a manpage reference is much more simple. No giant long
complicated regexes. Now, the plugin lets `man` handle the actual
validation. We merely extract the section and page. Syntax regexes are
a bit more specific though to prevent highlighting everything.
- Multilingual support in the syntax file. Removed the cruft that was only
relevent to vim. Also simplified and improved many of the regexes.
- Using shellescape when sending the page and sect as arguments
- In general, the code flow is much more obvious.
- man#get_page has been split up into smaller functions with explicit
responsibilties
- ':help' behavior in opening splits and manpages
- Comments explaining anything that needs explaining and isn't
immediately obvious.
- If a manpage has already been loaded but if it were to reloaded at the
current width which is the same as the width at which it was loaded at
previously, it is not reloaded.
- Use substitute to remove the backspaced instead of `col -b`, as the
latter doesn't work with other languages.
- Open paths to manpages
- It uses cWORD instead of cword to get the manpage under the cursor, this
helps with files that do not have (,) in iskeyword. It also means the
plugin does not set iskeyword locally anymore.
- <Plug>(Man) mapping for easy remapping
- Switched to single quotes wherever possible.
- Updated docs in $VIMRUNTIME/doc/filetype.txt (still need to update
user-manual)
- Always call tolower on section name. See comment in
s:extract_page_and_sect_fpage
- Formatting/consistency cleanup
- Automatically map q to ':q<CR>' when invoked as $MANPAGER
- It also fully supports being used as $MANPAGER. Setting the name and
stuff automatically.
- Split up the setlocals into multiple lines for easier readability
- Better detection of errors by redirecting stderr to /dev/null. If an
error occured, stdout will be empty.
- Functions return [sect, page] not [page, sect]. Makes more sense with
how man takes the arguments as sect and then page.
- Pretty prints errors on a single line.
- If no section is given, automatically finds the correct section for
the buffer name. It also gets the correct page. See the comment in
s:get_page
- If $MANWIDTH is not set, do not assign directly to $MANWIDTH because
then $MANWIDTH will always stay set to the same value as we only use
winwidth(0) when the global $MANWIDTH is empty. Instead we set it
locally for the command.
- Maintainer notes on all files.
Problem: The justify plugin has to be copied or sourced to be used.
Solution: Turn it into a package.
2946d0236d
Justification for changes that do not carry over
- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`
vim-patch:7.4.2011
Problem: It is not easy to get a list of command arguments.
Solution: Add getcompletion(). (Yegappan Lakshmanan)
aa4d73235b
vim-patch:7.4.2012
Problem: Test for getcompletion() does not pass on all systems.
Solution: Only test what is supported.
0d3e24be56
vim-patch:7.4.2066
Problem: getcompletion() not well tested.
Solution: Add more testing.
c1fb763184
Problem: The shellmenu plugin has to be copied or sourced to be used.
Solution: Turn it into a package.
fead3ac9a3
Justification for changes that do not carry over
- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`
Problem: The swapmous plugin has to be copied or sourced to be used.
Solution: Turn it into the swapmouse package.
e101204906
Justification for changes that do not carry over
- `Filelist` does not exist in neovim
- neovim does not have a `README.txt` in `runtime/macros`