Commit Graph

237 Commits

Author SHA1 Message Date
matveyt
8ce0929418 Remove EXMODE_NORMAL 2021-07-23 18:08:40 +02:00
Sean Dewar
b5c0ade437
fix(doc): :sleep! does not hide cursor
:sleep is the same as :sleep! in the port of v8.2.2366
2021-06-19 16:58:50 +01:00
Sean Dewar
7d025f2e8e
fix(doc): remove :promptfind and :promptrepl
:promptfind and :promptrepl are N/A for Nvim.
2021-06-19 16:58:39 +01:00
Yegappan Lakshmanan
e0a01bdf7f
Update vim diff and credits (#14566)
Patch 8.2.2524 added the support for the fields 'foldopen', 'foldclose'
and 'foldsep' to the 'fillchars' option in Vim:

http://ftp.vim.org/pub/vim/patches/8.2/8.2.2524

Update the credits in intro.txt based on Vim credits.
2021-05-16 13:55:53 -04:00
Jan Edmund Lazo
e612a0a76a
vim-patch:d1caa941d876
Update runtime files
d1caa941d8

Cherry-pick error E452 from patch v8.2.0486.
2021-04-27 22:40:39 -04:00
Jan Edmund Lazo
01a629ca03
vim-patch:8.1.1726: the eval.txt help file is too big
Problem:    The eval.txt help file is too big.
Solution:   Split off testing support to testing.txt.  Move function details
            to where the functionality is explained.
ed997adaa1

Vim commit 5477506a9f01d40fad2e8f0555bc37adee30478f
contains the duplicate tag fix in runtime/doc/testing.txt.
2021-04-27 09:21:26 -04:00
Marco Hinz
2b663c061b
viml: embed Lua syntax highlighting [skip ci] (#14213) 2021-03-28 00:43:06 +01:00
Yegappan Lakshmanan
03383ee27b
doc: Update vim_diff.txt (#13954)
Update vim_diff.txt to reflect the following patches:

patch 8.1.1113: making an autocommand trigger once is not so easy
patch 8.2.2128: there is no way to do something on CTRL-Z
patch 8.2.2508: cannot change the character displayed in non existing lines
patch 8.2.2518: 'listchars' should be window-local
2021-02-16 19:50:06 +01:00
Yegappan Lakshmanan
e20ee69952 Update vim_diff.txt 2020-11-30 20:48:52 -08:00
shade-of-noon
5c92ee5d71
Update vim_diff.txt
Update for restricted mode removal.
2020-11-21 11:18:23 -04:00
Yegappan Lakshmanan
f67b3ea39c
Update the differences with Vim. (#13239)
:cquit can use count to set the exit code
	patch 8.2.0095: cannot specify exit code for :cquit

:tchdir tab-local current-directory
	patch 8.1.1218: cannot set a directory for a tab page

Autocmd Events:
	- DirChanged
	    patch 8.0.1459: cannot handle change of directory
	- TextYankPost
	    patch 8.0.1394: cannot intercept a yank command

tabpagenr() "#" argument
    g<Tab> goes to the last-accessed tabpage.
	patch 8.2.1401: cannot jump to the last used tabpage

hl-QuickFixLine
	patch 8.0.0641: cannot set a separate highlighting for the quickfix line

v:event
	patch 8.0.1394: cannot intercept a yank command

K in help documents can be used like CTRL-].
	Updated as part of a runtime update.
	4c05fa08c9
2020-11-09 23:01:54 -05:00
Jan Edmund Lazo
d69a8a3fc4
vim-patch:8.2.0952: no simple way to interrupt Vim
Problem:    No simple way to interrupt Vim.
Solution:   Add the SigUSR1 autocommand, triggered by SIGUSR1. (Jacob Hayes,
            closes vim/vim#1718)
be5ee8686a
2020-10-22 18:24:08 -04:00
Matt Wozniski
2f06413dfb Treat unmapped ALT/META as ESC+c in all modes
In #8226 <A-x> and <M-x> were changed to behave like <Esc>x in insert
mode when no mapping exists. This commit backs out that change and
replaces it with a more general one that makes unmapped ALT and META
keypresses as <Esc>+char in all modes. This fixes an unnecessary and
confusing inconsistency between modes.
2020-10-05 15:27:04 -04:00
Jan Edmund Lazo
c14d2399f6
doc: test_garbagecollect_now() was ported 2020-09-26 10:14:50 -04:00
Justin M. Keyes
858c056133
Support for :perl, :perlfile, :perldo and perleval() (#12809)
* support for :perl, :perlfile, :perldo and perleval()

* document that the perl provider doesn't currently work on Windows

* document that the perl legacy interface is now also supported

* added perleval() documentation

* import legacy perl interface tests

* only perl 5.22+ is supported

* healtcheck: use g:perl_host_prog if its set instead

using just 'perl' isn't correct as it may not be the version requested.
ditto for 'cpanm', rather go through 'App::cpanminus' to find the latest
perl version
2020-09-05 13:55:06 -07:00
Justin M. Keyes
c2662210b5
docs, remove 'guifontset' #11708
- remove redundant autocmd list
  This "grouped" list is useless, it only gets in the way when searching
  for event names.
- intro.txt: cleanup
- starting.txt: update, revisit
- doc: `:help bisect`
- mbyte.txt: update aliases 1656367b90. closes #11960
- options: remove 'guifontset'. Why:
  - It is complicated and is used by almost no one.
  - It is unlikely to be implemented by Nvim GUIs (complicated to parse,
    specific to Xorg...).
2020-08-31 00:51:35 -07:00
Jacques Germishuys
9bef25314e support for :perl, :perlfile, :perldo and perleval() 2020-08-30 17:19:05 +01:00
Jan Edmund Lazo
c219d3eec4
defaults: sessionoptions+=unix,slash #12760
Since 1c3ca4f18f, 2c1d12d0be, #7836, the "unix" and "slash" behavior
of 'sessionoptions'/'viewoptions' is always enabled, and the flags are
just ignored. There is no reason for that behavior to be configurable.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2020-08-15 19:19:06 -07:00
Jan Edmund Lazo
273ad7d66f
fixup! mksession: always unix slashes "/" for filepaths 2020-08-15 10:57:17 -04:00
Christian Clason
f2894bffb0
lua: Add highlight.on_yank (#12279)
* add lua function to highlight yanked region

* extract namespace, better naming, default values

* add default for event argument

* free timer

* factor out mark to position calculation

* d'oh

* make sure timer stops before callback (cf. luv example)

* factor out timer, more documentation

* fixup

* validate function argument for schedule

* fix block selection past eol

* correct handling of multibyte characters

* move arguments around, some cleanup

* move utility functions to vim.lua

* use anonymous namespaces, avoid local api

* rename function

* add test for schedule_fn

* fix indent

* turn hl-yank into proper (hightlight) module

* factor out position-to-region function

mark extraction now part of highlight.on_yank

* rename schedule_fn to defer_fn

* add test for vim.region

* todo: handle double-width characters

* remove debug printout

* do not shadow arguments

* defer also callable table

* whitespace change

* move highlight to vim/highlight.lua

* add documentation

* add @return documentation

* test: add check before vim.defer fires

* doc: fixup
2020-05-18 09:49:50 -04:00
Matthieu Coudron
6f261d2394 updating doc 2020-03-02 12:59:35 +01:00
Marcos ALMEIDA
757aad92e8 autocmd: add WinClosed event
- only fire once, just before freeing mem
- trigger when on a different buffer
- avoid recursive calls in another tab
2020-01-18 17:06:03 -08:00
Justin M. Keyes
9231684986
doc [ci skip] #11656 2020-01-12 23:41:55 -08:00
Matthieu Coudron
05ea3c1997 defaults: set fillchars "foldsep" to box line #11702
"│" U+2502 BOX DRAWINGS LIGHT VERTICAL

Fallback to old default | if 'ambiwidth' is set.
2020-01-11 16:36:11 -08:00
Justin M. Keyes
93e7c7e3bd doc [ci skip] 2019-12-31 02:25:10 -08:00
butwerenotthereyet
39094b3fae jumplist: browser-style (or 'tagstack') navigation #11530
Traditionally, when navigating to a specific location from the middle of
the jumplist results in shifting the current location to the bottom of
the list and adding the new location after it.  This behavior is not
desireable to all users--see, for example
https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior.

Here, another jumplist behavior is introduced.  When jumpoptions (a new
option set added here) includes stack, the jumplist behaves like the
tagstack or like history in a web browser.  That is, when navigating to
a location from the middle of the jumplist

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

to a new location the locations after the current location in the jump
list are discarded

    2 first
    1 second
    0 third
            <-- current location

The result is that when moving forward from that location, the new
location will be appended to the jumplist:

    3 first
    2 second
    1 third
    0 new

If the new location is the same

  new == second

as some previous (but not immediately prior) entry in the jumplist,

    2 first
    1 second
    0 third <-- current location
    1 fourth
    2 fifth

both occurrences preserved

    3 first
    2 second
    1 third
    0 second (new)

when moving forward from that location.

It would be desireable to go farther and, when the new location is the
same as the location that is currently next in the jumplist,

    new == fourth

make the result of navigating to the new location by jumping (e.g. 50gg)
be the same as moving forward in the jumplist

    2 first
    1 second
    0 third
    1 new <-- current location
    2 fifth

and simply increment the jumplist index.  That change is NOT part of
this patch because it would require passing the new cursor location to
the function (setpcmark) from all of its callees.  That in turn would
require those callees to know *before* calling what the new cursor
location is, which do they do not currently.
2019-12-10 00:56:56 -08:00
Justin M. Keyes
7111fe9459
doc: LSP [ci skip] #11524 2019-12-10 00:29:39 -08:00
Matthieu Coudron
3beef8ee1c defaults: set nostartofline
Having the cursor change column can be surprising.

Force startofline in functional and old tests.
Remove the functional breakindent test, as it's a subset of the oldtest one.
2019-12-03 13:31:17 +01:00
Justin M. Keyes
af53a0c012
doc: Lua [ci skip] #11378
- Rework :help lua-commands
- Rename if_lua.txt => lua.txt
2019-11-17 19:06:59 -08:00
Justin M. Keyes
589f612adf rename: UIAttach/UIDetach => UIEnter/UILeave
"enter"/"leave" is more conventional for Vim events, and
"attach"/"detach" distinction does not gain much.
2019-09-12 17:04:05 -07:00
Rui Abreu Ferreira
e9cf515888 UIAttach, UIDetach 2019-09-12 15:52:54 -07:00
Justin M. Keyes
a3849abc31 doc: StatusLineTerm, StatusLineTermNC
N/A:
vim-patch:8.0.0941: existing color schemes don't like StatusLineTerm
vim-patch:8.0.0937: user highlight groups not adjusted for terminal
vim-patch:8.0.0825: not easy to see that a window is a terminal window
2019-09-09 10:52:12 -07:00
Justin M. Keyes
81c3fa6c9d doc 2019-09-09 09:53:19 -07:00
Justin M. Keyes
45c34bd84a
:doautocmd : Never show "No matching autocommands" #10689
The message is useless, it doesn't even mention the event name.

vim_dev discussion:
https://groups.google.com/forum/#!msg/vim_dev/RTbq58TMq9w/Xr4rSoUTCgAJ

ref: https://github.com/vim/vim/issues/4300
2019-08-05 03:33:45 +02:00
Justin M. Keyes
5342342426 runtime: move matchit.vim to /pack/dist/opt/
Align matchit.vim with upstream Vim. We don't want to maintain a fork of
matchit.vim; our small changes should be sent to
https://github.com/chrisbra/matchit
2019-08-01 15:43:53 +02:00
Justin M. Keyes
097f85ae6c
defaults: wildoptions=pum,tagfile #10384
ref #6289
2019-07-01 23:59:24 +02:00
Justin M. Keyes
bb24fec333
defaults: exclude "S" from 'shortmess' #10136
ref #6289
2019-06-07 23:11:28 +02:00
Justin M. Keyes
ddd0eb6f51
startup: -es/-Es (silent/batch mode): skip swapfile #8540
To use Nvim as a scripting engine the side-effects of swapfiles and user
config should be avoided by default.
2019-04-10 03:27:25 +02:00
Abdelhakeem Osama
35362495c9 jumplist: avoid extra tail entry #9805
fixes #9775
2019-04-02 00:50:28 +02:00
Justin M. Keyes
fbaee922d1 doc [ci skip]
closes #9719
2019-03-26 19:55:33 +01:00
Dan Aloni
36762a00a8 signs: support multiple columns #9295
closes #990
closes #9295

- Support for multiple auto-adjusted sign columns.
  With this change, having more than one sign on a line, and with the
  'auto' setting on 'signcolumn', extra columns will shown automatically
  to accomodate all the existing signs.

  For example, suppose we have this view:

   5147             }
   5148
   5149             return sign->typenr;
   5150         }
   5151     }
   5152     return 0;
   5153 }
   5154

  We have GitGutter installed, so it tells us about modified lines that
  are not commmited. So let's change line 5152:

     5147             }
     5148
     5149             return sign->typenr;
     5150         }
     5151     }
   ~ 5152     return 0;
     5153 }
     5154

  Now we add a mark over line 5152 using 'ma' in normal mode:

      5147             }
      5148
      5149             return sign->typenr;
      5150         }
      5151     }
  a ~ 5152     return 0;
      5153 }
      5154

  Previously, Vim/Nvim would have picked only one of the signs,
  because there was no support for having multiple signs in a line.

- Remove signs from deleted lines.
  Suppose we have highlights on a group of lines and we delete them:

   +     6 use std::ops::Deref;
   --+   7 use std::borrow::Cow;
   --+   8 use std::io::{Cursor};
         9 use proc_macro2::TokenStream;
        10 use syn::export::ToTokens;
   --+  11 use std::io::Write;
   >>   12 use std::ops::Deref;

  Without this change, these signs will momentarily accumulate in
  the sign column until the plugins wake up to refresh them.

  + --+ --+ --+ >>  6

  Discussion: It may be better to extend the API a bit and allow this
  to happen for only certain types of signs. For example, VIM marks
  and vim-gitgutter removal signs may want to be presreved, unlike
  line additions and linter highlights.

- 'signcolumn': support 'auto:NUM' and 'yes:NUM' settings
- sort signs according to id, from lowest to highest. If you have
  git-gutter, vim-signature, and ALE, it would appear in this order:
  git-gutter - vim-signature - ALE.
- recalculate size before screen update
- If no space for all signs, prefer the higher ids (while keeping the
  rendering order from low to high).
- Prevent duplicate signs. Duplicate signs were invisible to the user,
  before using our extended non-standard signcolumn settings.
- multi signcols: fix bug related to wrapped lines.
  In wrapped lines, the wrapped parts of a line did not include the extra
  columns if they existed. The result was a misdrawing of the wrapped
  parts. Fix the issue by:
    1. initializing the signcol counter to 0 when we are on a wrap boundary
    2. allowing for the draw of spaces in that case.
2019-03-25 02:17:47 +01:00
Björn Linse
be8ebba325 Allow using internal popupmenu or ext_popupmenu for wildmenu
Deprecate ext_wildmenu. ext_popupmenu already contains more state (anchor
position), and will allow further expansion (info about items).
2019-03-16 19:53:21 +01:00
Justin M. Keyes
3259e45f92 autocmd: rename: "++nested", "++once"
Based on feedback from upstream:
https://github.com/vim/vim/pull/4100
2019-03-14 01:30:11 +01:00
Björn Linse
81e84f2aae floats: add NormalFloat highlight and 'nonumber' default 2019-03-12 17:17:54 +01:00
Justin M. Keyes
c12cf5bde7 autocmd: introduce "once" feature
Adds a new feature to :autocmd which sets the handler to be executed at
most one times.

Before:

    augroup FooGroup
      autocmd!
      autocmd FileType foo call Foo() | autocmd! FooGroup * <buffer>
    augroup END

After:

    autocmd FileType foo once call Foo()
2019-03-10 04:58:30 +01:00
Justin M. Keyes
c5173230f0 UI: 'pumblend' for cterm (256-color TUI)
hl_rgb2cterm_color, hl_cterm2rgb_color were adapted from Vim 8.1
(color2index, cterm_color2rgb).
ref: c5cd88554f
2019-02-12 09:26:06 +01:00
Björn Linse
37f8df8824 UI: implement 'pumblend' option for semi-transparent popupmenu
Why?

- Because we can.
- Because the TUI is just another GUI™
- Because it looks kinda nice, and provides useful context like 1 out of 100
  times

Complies with "don't pay for what you don't use".

Some crashes for resizing were unfolded, add tests for those.
2019-02-07 16:43:51 +01:00
Marco Hinz
70f6939fd4 events: add "Signal" event #9564
..which gets triggered when SIGUSR1 is sent to the nvim process.

Closes #9562
2019-02-04 02:39:05 +01:00
Marco Hinz
28f87c505d
Merge #9539 "options: make 'listchars' and 'fillchars' local to window" 2019-01-28 00:45:59 +01:00
Justin M. Keyes
c70c8b607f doc [ci skip] #9478
- Lua
- developer guidelines
- MAINTAIN.md
- TUI: cleanup
- TUI: mention Windows terminfo builtins
- cleanup if_pyth, redirect python-bindeval tag

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>
2019-01-26 20:38:14 +01:00