Commit Graph

12784 Commits

Author SHA1 Message Date
Justin M. Keyes
a8783012e4 Merge #9815 'vim-patch:8.1.1068: complete_info()' 2019-03-30 21:30:16 +01:00
Shougo Matsushita
2d63b6d2c1 vim-patch:8.1.1068: cannot get all the information about current completion
Problem:    Cannot get all the information about current completion.
Solution:   Add complete_info(). (Shougo, Hirohito Higashi, closes vim/vim#4106)
fd133323d4
2019-03-30 22:24:35 +09:00
Justin M. Keyes
dfb7f6b349 Merge #9792
fixes #9791
closes #9792
2019-03-29 03:29:50 +01:00
Abdelhakeem
842e6fb92f fixup: use vim_snprintf, ASCII_ISALNUM
ASCII_ISALNUM is part of vim-patch:8.1.0540
2019-03-29 03:28:15 +01:00
Abdelhakeem
b22ca804dd lint 2019-03-29 03:28:15 +01:00
Olivier G-R
f6fb370b1b keymap: add more (keypad) keycodes #9793
- K_KORIGIN instead of K_KCENTER: This name is similar to what is used
  by xev. Alternative could be K_KBEGIN as hinted here:
  https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keys
  But I find Begin and Home too similar, and it might induced some
  confusion. The naming looked related to some old keyboard
  configuration.

- keymap.c: alias KPPeriod to kDel instead of kPoint.
  This might seems weird, but this is actually the behaviour that should
  be expected. libtermkey produces "KPPeriod" when num lock is off. To
  fix this would need to change this name in termkey.

closes #9780
closes #9793
2019-03-29 01:11:57 +01:00
Justin M. Keyes
33f99431dc
Merge #9803 from janlazo/vim-8.0.0504
Benchmarked using RelWithDebInfo build and the `:Time` command from
https://github.com/tpope/vim-scriptease .

    :Time for i in range(0,99999)|call exists(':abbreviate')|endfor

- before (8698830cbd):   0.431 seconds
- after (63025a1d65): 0.345 seconds
- Vim 8.1.1005 : 0.361 seconds
2019-03-28 21:48:50 +01:00
Abdelhakeem
c933378b9b vim-patch:8.1.0544: setting 'filetype' in a modeline causes an error
Problem:    Setting 'filetype' in a modeline causes an error (Hirohito
            Higashi).
Solution:   Don't add the P_INSECURE flag when setting 'filetype' from a
            modeline.  Also for 'syntax'.
916a818cea
2019-03-28 18:12:30 +02:00
Abdelhakeem
ebfff8e802 vim-patch:8.1.0540: may evaluate insecure value when appending to option
Problem:    May evaluate insecure value when appending to option.
Solution:   Set the secure flag when changing an option that was previously
            set insecurely.  Also allow numbers for the characters from
            'spelllang' that are used for LANG.vim.
247bb7e43b
2019-03-28 18:12:30 +02:00
Abdelhakeem
5eaa455479 vim-patch:8.1.0539: cannot build without the sandbox
Problem:    Cannot build without the sandbox.
Solution:   Set the secure option instead of using the sandbox.  Also restrict
            the characters from 'spelllang' that are used for LANG.vim.
            (suggested by Yasuhiro Matsumoto)
82e8c92ebe
2019-03-28 18:12:30 +02:00
Jan Edmund Lazo
63025a1d65 gen_ex_cmds.lua: build the command table
Lua port of create_cmdidxs.vim from 8.0.0572

N/A:
vim-patch:8.0.0572: building the command table requires Perl

Problem:    Building the command table requires Perl.
Solution:   Use a Vim script solution. (Dominique Pelle, closes vim/vim#1641)
6de5e12601
2019-03-28 07:56:21 -04:00
Justin M. Keyes
76204da1f8
Merge #9802 from janlazo/vim-8.1.0887 2019-03-28 12:32:41 +01:00
Jan Edmund Lazo
07a5c9d4f0 vim-patch:8.0.0506: can't build with ANSI C
Problem:    Can't build with ANSI C.
Solution:   Move declarations to start of block.
6c0c1e8052
2019-03-27 23:43:17 -04:00
Jan Edmund Lazo
c3158e230d vim-patch:8.0.0504: looking up an Ex command is a bit slow
Problem:    Looking up an Ex command is a bit slow.
Solution:   Instead of just using the first letter, also use the second letter
            to skip ahead in the list of commands. Generate the table with a
            Perl script. (Dominique Pelle, closes vim/vim#1589)
e5e0fbcd42
2019-03-27 23:43:16 -04:00
Jan Edmund Lazo
4b96002533 vim-patch:8.1.1061: when substitute string throws error, substitute happens anyway
Problem:    When substitute string throws error, substitute happens anyway.
Solution:   Skip substitution when aborting. (closes vim/vim#4161)
0e97b94875
2019-03-27 21:35:02 -04:00
Jan Edmund Lazo
2894d04b19 vim-patch:8.1.0887: the 'l' flag in :subsitute is sticky
Problem:    The 'l' flag in :subsitute is sticky.
Solution:   Reset the flag. (Dominique Pelle, closes vim/vim#3925)
9474716d39
2019-03-27 21:32:51 -04:00
Justin M. Keyes
2470c88291
Merge #9794 from janlazo/vim-8.0.1528 2019-03-27 11:09:54 +01:00
Jan Edmund Lazo
bf2ad145e3 vim-patch:8.1.0528: various typos in comments
Problem:    Various typos in comments.
Solution:   Fix the typos.
c4568ab37e
2019-03-26 23:59:01 -04:00
Jan Edmund Lazo
c95fdcd127 vim-patch:8.0.1528: dead code found
Problem:    Dead code found.
Solution:   Remove the useless lines. (CodeAi, closes vim/vim#2656)
81226e0310
2019-03-26 23:59:01 -04:00
Justin M. Keyes
281c011d44 gen_help_html.py [ci skip] 2019-03-27 00:50:38 +01:00
Justin M. Keyes
127e13f53e doc, lint 2019-03-26 22:56:09 +01:00
Justin M. Keyes
be676eccf1
Merge #9600 'doc, gen_vimdoc.py' 2019-03-26 21:36:33 +01:00
Justin M. Keyes
bec4066033 gen_vimdoc.py: render nested lists, etc [ci skip]
- render_node() is now the main rendering function: it traverses a node
  and builds the Vim help text recursively.
- render_para() is weird and ugly, it is the entry-point for rendering
  the help text for one docstring'd function.
2019-03-26 21:33:06 +01:00
Justin M. Keyes
eeb19a346a doc: mention "pynvim" module rename
closes #9764
2019-03-26 21:17:12 +01:00
Justin M. Keyes
d614c7932c doc: move ui-wildmenu to deprecated.txt [ci skip] 2019-03-26 19:55:33 +01:00
Justin M. Keyes
fbaee922d1 doc [ci skip]
closes #9719
2019-03-26 19:55:33 +01:00
Marco Hinz
2d50bf3498
mac: do not use libintl_setlocale() (#9789)
gettext contains libintl.h. That header file defines a macro that replaces
`setlocale` by `libintl_setlocale`. That function eventually calls the original
`setlocale()` from Apple's libc, but is known to make it fail.

Mac users with gettext from Homebrew can easily reproduce this:

    #include <stdio.h>
    #include <locale.h>
    #include <libintl.h>

    int main(void) {
      setlocale(LC_ALL, "");
      printf("locale: %s\n", setlocale(LC_CTYPE, NULL));
    }

Compile and run it:

    cc -I/usr/local/opt/gettext/include -L/usr/local/opt/gettext/lib -lintl -o test test.c && ./test

When $LC_CTYPE is set to a valid value like UTF-8, it should output:

    locale: UTF-8

But it does not. It returns C anyway. Remove libintl.h and recompile and you get
the expected UTF-8.

Fixes https://github.com/neovim/neovim/issues/9787
2019-03-26 11:42:25 +01:00
Justin M. Keyes
3441423481 tui/input.c: rename functions
- Rename the module prefix to "tinput_" instead of "term_input".
- Some of the private functions were confusing, for example
  enqueue_input() calls input_enqueue() in another module.
- It is helpful for discussion, documentation, and stacktraces if
  functions (even private) are globally unique.
2019-03-25 23:25:30 +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
Justin M. Keyes
f705ed22fd
Merge #9776 from janlazo/vim-8.1.0177 2019-03-24 12:55:41 +01:00
Björn Linse
0920c6ca81
Merge pull request #9772 from gelguy/float-inccommand
floating-window.c: fix crash when using inccommand
2019-03-24 08:49:02 +01:00
Jit Yao Yap
4e49e44259 Update to restore layout only for non-floating windows 2019-03-23 22:14:03 +01:00
Jit Yao Yap
2a618e0ad0 Update test 2019-03-23 22:14:03 +01:00
Jit Yao Yap
31fa064c68 floating-window.c: fix crash when using inccommand 2019-03-23 22:14:03 +01:00
Björn Linse
b3b8910c48
Merge pull request #9763 from bfredl/prevfloat
window: don't crash when closing two floats in a row
2019-03-23 22:13:57 +01:00
Björn Linse
ae49e8da58 window: don't crash when closing two floats in a row
prevwin can be set to the current window. Then we can't jump to it
after closing a float.
2019-03-23 20:12:37 +01:00
Jan Edmund Lazo
a73e0e8e77 vim-patch:8.1.1045: E315 ml_get error when using Python and hidden buffer
Problem:    E315 ml_get error when using Python and hidden buffer.
Solution:   Make sure the cursor position is valid. (Ben Jackson,
            closes vim/vim#4153, closes vim/vim#4154)
63dbfd33c1
2019-03-23 14:56:34 -04:00
Jan Edmund Lazo
ca71c82196 vim-patch:8.1.0538: evaluating a modeline might invoke using a shell command
Problem:    Evaluating a modeline might invoke using a shell command. (Paul
            Huber)
Solution:   Set the sandbox flag when setting options from a modeline.
5958f95a40
2019-03-23 08:09:27 -04:00
Jan Edmund Lazo
6b3775bbe2 vim-patch:8.1.0189: function defined in sandbox not tested
Problem:    Function defined in sandbox not tested.
Solution:   Add a text.
d90a144eda
2019-03-23 01:26:13 -04:00
Jan Edmund Lazo
b5582d1b32 vim-patch:8.1.0177: defining function in sandbox is inconsistent
Problem:    Defining function in sandbox is inconsistent, cannot use :function
            but can define a lambda.
Solution:   Allow defining a function in the sandbox, but also use the sandbox
            when executing it. (closes vim/vim#3182)
93343725b5
2019-03-23 01:25:33 -04:00
Marco Hinz
3e78319ac6
help: ignore snapshotted window if invalid (#9774)
Nvim doesn't expect a window-changing command on an created-window event.

    autocmd WinNew * wincmd p
    help help

- A snapshot for window 1000 is created.
- The window is split and the cursor changes to the new window 1001.
- The autocmd kicks in and switches back to 1000.
- The help buffer is opened.
- On closing the help window 1000, it tries to go back to the snapshotted window
  which is... 1000.
- wp1000->w_buffer == NULL
- w_buffer is used by check_cursor()
- 🧨 -> 💥

Fixes https://github.com/neovim/neovim/issues/9773
2019-03-23 00:23:39 +01:00
Marco Hinz
3edf7fc64f
api: ignore floating windows for laststatus=1 (#9771)
ONE_WINDOW considers all windows whereas one_window() ignores floating windows.

Fixes https://github.com/neovim/neovim/issues/9768
2019-03-22 17:17:33 +01:00
Justin M. Keyes
fa6ed5f759
Merge #9769 from janlazo/vim-8.1.1025 2019-03-21 19:35:30 +01:00
Jan Edmund Lazo
ea538f8799 vim-patch:8.1.1026: unused condition
Problem:    Unused condition. (Coverity)
Solution:   Remove the condition.  Also remove unused #define.
d00e024d9f
2019-03-21 07:55:48 -04:00
Jan Edmund Lazo
5c97bfb1e2 vim-patch:8.1.1025: checking NULL pointer after addition
Problem:    Checking NULL pointer after addition. (Coverity)
Solution:   First check for NULL, then add the column.
64c8ed366d
2019-03-21 07:44:52 -04:00
Chris LaRose
c5631338b1 :mksession : restore tab-local working directories #9754 2019-03-21 11:53:38 +01:00
Aman
8698830cbd doc #9751
closes #9750
2019-03-20 12:44:06 +01:00
Marco Hinz
f282324e1b
test: add more debuggings tips [ci skip] (#9761)
Mention the common press-enter issue and how to visualize the screen.
2019-03-19 17:44:35 +01:00
Jan Edmund Lazo
24d7513dc4 vim-patch:8.1.0384: sign ordering #9758
Problem:    Sign ordering depends on +netbeans feature.
Solution:   Also order signs without +netbeans. (Christian Brabandt,
            closes vim/vim#3224)
8aeb504fc6
2019-03-19 12:42:17 +01:00
Justin M. Keyes
6f7b81bd6d
vim-patch:8.1.{0849,1001}: 'cursorline' highlight #9757
- Lua test correctly fails when 8.1.0849 is reverted.
- 8.1.1001 bug does not manifest in Neovim.

vim-patch:8.1.0849: cursorline highlight is not always updated
Problem:    Cursorline highlight is not always updated.
Solution:   Set w_last_cursorline when redrawing.  Fix resetting cursor flags
            when using the popup menu.
c07ff5c60a

vim-patch:8.1.1001: Visual area not correct when using 'cursorline'
Problem:    Visual area not correct when using 'cursorline'.
Solution:   Update w_last_cursorline also in Visual mode. (Hirohito Higashi,
            closes vim/vim#4086)
8156ed3755
2019-03-19 12:24:41 +01:00