Commit Graph

7607 Commits

Author SHA1 Message Date
ZyX
cd8f07cb75 eval: Do not allocate b:changedtick dictionary item 2017-02-24 02:47:43 +03:00
ZyX
9c1865c7f8 *: Fix linter errors 2017-02-23 19:48:41 +03:00
ZyX
858ac9d8e5 api: Make sure dict_set_var doesn’t edit read-only values
Fixes #6147
2017-02-23 19:48:41 +03:00
ZyX
8faa4af396 api: Rename dict_set_value to dict_set_var
Reasonings:
1. It is not used for anything, but scope dictionaries currenly. So there is no 
   need to generalize and split it into dict_set_var (which will contain some 
   scope-dictionary-specific checks) and dict_set_value (which will work for any 
   dictionary).
2. Check for key size is no longer valid for non-scope dictionaries: you *can* 
   use empty keys there. In scope dictionaries also, but you actually are not 
   supposed to store there anything, but variables.

Note that actually one may still do

    let b:[''] = 1

and “bypass” check for variable name. It won’t change what `echo b:` will show, 
but it may affect code which iterates over scope dictionary keys and sets them 
to something (if there is such code).
2017-02-23 19:48:41 +03:00
ZyX
6550caee50 functests: Destroy accidental folds in api/vim_spec 2017-02-23 19:48:41 +03:00
ZyX
f387de4ec0 eval: Remove incorrect workaround
Was replaced by the previous patch. Also fixes legacy test 055.
2017-02-23 19:48:41 +03:00
ZyX
d8a7e5fdbb eval: Forbid (un)locking b:changedtick
Port of vim-patch:8.0.0343
2017-02-23 19:48:41 +03:00
ZyX
9668d26a43 eval: Make sure islocked('b:.changedtick') does not error out
Port of vim-patch:8.0.0345
2017-02-23 19:48:41 +03:00
ZyX
9972db79c8 eval: Specify more precise len for var_check_ro in get_lval 2017-02-23 19:46:45 +03:00
ZyX
d5ab50a040 eval: Refactor var_check_ro, tv_check_lock and var_check_fixed
- They are no longer responble for using gettext.
- They now receive string length and use %.* format specifier in messages.
- And one less global: one of the error messages is never repeated.
2017-02-23 19:46:45 +03:00
ZyX
d820daf076 functests: Add some more tests 2017-02-23 19:46:45 +03:00
ZyX
7869b978e8 eval: Fix memory leak
Ref vim/vim#1497
2017-02-23 19:46:45 +03:00
ZyX
3277eff31a buffer: Forbid unletting b:changedtick 2017-02-23 19:46:45 +03:00
ZyX
e2fbbb292f eval: Refactor item_lock
If I am not mistaking, this commit should not change any functionality.
2017-02-23 19:46:45 +03:00
ZyX
f2c9fd312c eval: Make sure that b:changedtick may not be unlocked via :unlo b:var
It still may be unlocked by `:unlock b:.var`.
2017-02-23 19:46:44 +03:00
ZyX
908e53d98d functests: Add tests
Contains a number of FIXMEs.
2017-02-23 19:46:44 +03:00
ZyX
4f10d42f82 buffer: Bind b:changedtick to b:['changedtick'], remove special cases 2017-02-23 19:46:44 +03:00
ZyX
0eab7ac4b9 api/buffer: Add nvim_buf_get_changedtick method 2017-02-23 19:46:44 +03:00
James McCoy
9752a333c3 Merge pull request #5771 from brcolow/lambda
Lambda Support
2017-02-23 07:30:20 -05:00
Shougo
4e21311f9c vim-patch:8.0.0341 (#6151)
Problem:    When using complete() and typing a character undo is saved after
            the character was inserted. (Shougo)
Solution:   Save for undo before inserting the character.

d56a79d339
2017-02-23 12:37:46 +01:00
Koichi Shiraishi
34e24cb2f7 terminal: Initialize colors in reverse order (#6160)
Closes #3601

Signed-off-by: Koichi Shiraishi <zchee.io@gmail.com>
2017-02-23 11:44:09 +01:00
James McCoy
d4dd447ded
win: test: Fix closure jobs test on Windows 2017-02-23 01:24:55 -05:00
James McCoy
bc76ce2c4f
Merge remote-tracking branch 'origin/master' into lambda 2017-02-22 19:23:20 -05:00
ZyX
31cdb227ba eval: Flush buffer in write_list
This way success/failure return from this function is more precise.
2017-02-23 01:49:05 +03:00
Jente Hidskes
1a81ec6d88 strings.c: remove unused assignment
As reported by clang-scan, `length_modifier` is never read in any code path
following this branch. It is safe to remove.
2017-02-20 20:06:38 +01:00
Sander Bosma
192fd161f9 hardcopy.c: fix dead assignment
`has_mbyte` is deprecated (globals.h), so `outputlen` is always assigned
within the if statement. Therefore, the previous initialization is
unnecessary.
2017-02-20 20:06:38 +01:00
Sander Bosma
ddd8f7d333 message.c: fix dead assignment by removing dead code
`enc_dbcs` and `enc_utf8` are deprecated (globals.h), so the second branch is
always taken.
2017-02-20 20:06:38 +01:00
Sander Bosma
8e194c53c7 misc1.c: remove dead initialization 2017-02-20 20:06:38 +01:00
Sander Bosma
83666f3ce2 screen.c: remove dead code
As stated in globals.h, mbyte flags are deprecated, and code using it can be
refractored to remove dead code. Since has_mbyte is defined to true, this
refractoring correct.
2017-02-20 20:06:38 +01:00
Jente Hidskes
04fb65fd76 screen.c: account for translated string length
`[RO]` is appended to the status line and `len` is increased with the length of
this string (4). However, the string is marked for translation and may
thus well be larger (or smaller) than 4. Therefore, we check the length at
runtime. The resulting len is never actually used, and thus could be removed.
However, by keeping this line, the body of this if-statement is kept consistent
with surrounding code, and future changes can not forget to add this line when
additional strings are added to p.
2017-02-20 19:56:58 +01:00
James McCoy
ddab4661f7 strings.h: Include <stdarg.h> for vim_vsnprintf's use of va_list
This fully resolves #6141.
2017-02-20 11:54:58 -05:00
James McCoy
a667972568
string.c: Include <stdarg.h> for va_list type and va_* macros
Closes #6141
2017-02-19 18:40:33 -05:00
Justin M. Keyes
3a2ae17062 globals.h: Avoid expression in array definition.
See aa56b24ee6 (commitcomment-20949000)
2017-02-19 02:55:27 +01:00
Justin M. Keyes
22337b1c01 Merge #6137 from justinmk/cmdline-ctrl-r
cmdline: CTRL-R: Omit trailing ^M character
2017-02-19 14:20:52 +01:00
Justin M. Keyes
baab49ee89 cmdline: CTRL-R: Omit trailing <CR>.
The "technically correct" interpretation is to execute the first line
that is seen (and this is what happens on middle-click paste in Vim).
^M is only intended to "defuse" the newline, so the user can review it.

The parent commit changed the behavior to insert <Space> between lines,
but that's a higher-risk change: it is arguably possible that some user
*wants* the literal ^M chars when e.g. assigning to a register:
    :let @a='<C-R>b'

To avoid that risk, keep the old behavior and only omit the last ^M.
This makes `yy:<C-R>0` nicer at no cost.
2017-02-18 23:24:35 +01:00
Justin M. Keyes
308ccb6f5e cmdline: CTRL-R: <Space> instead of CR between lines.
^M isn't any more "correct" than space: the "technically correct"
interpretation is to execute the first line that is seen (and this is
what happens on middle-click paste in Vim). ^M is only intended to
defuse the newline, so that the user can review the command. We can do
that with a space instead, and then the command can be executed without
having to fix it up first.
2017-02-18 14:49:05 +01:00
Kurt Bonatz
b0bbe82a60 eval.c: has("unnamedplus"). (#6136)
Return 1 for UNIX  with a functioning clipboard provider.

Closes #6103
2017-02-18 14:04:46 +01:00
Justin M. Keyes
158ea52854 options: Remove 'esckeys' (#6138)
This was never supported and it does not make sense for Nvim.
2017-02-18 14:01:20 +01:00
Justin M. Keyes
b49a74a1af doc: README.md 2017-02-17 17:44:10 +01:00
Justin M. Keyes
59254e4ae7 doc: README.md 2017-02-17 17:41:30 +01:00
Justin M. Keyes
c1bc784ad8 Merge #6110 'refactor: Move vim_*printf to strings.c'. 2017-02-17 16:25:19 +01:00
timeyyy
f017ae6115 doc/provider: python virtualenvs #6135
Closes #1887

Helped-by: Tommy Allen <tommy@esdf.io>
2017-02-17 03:44:05 +01:00
Justin M. Keyes
706b01ba79 Merge #6114 'Partial string handling refactoring'. 2017-02-17 02:08:21 +01:00
Justin M. Keyes
4a107a11a1 Merge #6105 from justinmk/win32-bindeps
Windows: ship with common tools
2017-02-16 16:53:34 +01:00
Justin M. Keyes
0095ad5693 win/CI: Cache dependencies. 2017-02-16 16:23:18 +01:00
Justin M. Keyes
ab9298ec15 win/package: Copy externals without analyzing.
These are just blobs that we jammed into the package. find_program() and
WindowsDllCopy.cmake do not make sense here, they search include paths
and try to determine DLL dependencies (GetPrerequisites).
2017-02-16 16:23:18 +01:00
Justin M. Keyes
3378ffac8a win/package: nvim-qt GUI
Closes #6126
2017-02-16 16:23:18 +01:00
Justin M. Keyes
2fbc42aa8a win/package: provide common tools
References #1507
Closes #1811

curl.exe curl_7_52_1_openssl_nghttp2_x86.7z from https://winampplugins.co.uk/curl/
    curl 7.52.1 (x86_64-pc-win32) libcurl/7.52.1 OpenSSL/1.0.2k zlib/1.2.8 nghttp2/1.19.0
    Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
    Features: AsynchDNS IPv6 Largefile NTLM SSL libz HTTP2 HTTPS-proxy

tidy.exe http://tidybatchfiles.info
    HTML Tidy for Windows
    tidy version 5.3.14 date 2017.01.09 compiled for Windows win32 x86.

7za.exe http://www.7-zip.org
    7-Zip 16.04 (2016-10-04)

cat.exe http://unxutils.sourceforge.net

from gVim:
    diff.exe GNU diffutils version 2.7
    xxd.exe V1.10 27oct98 by Juergen Weigert (Win32)
    ye olde hacked-up tee.exe
2017-02-16 16:23:18 +01:00
Rui Abreu Ferreira
7caaa106e3 win/build: Download winpty
Winpty has x86/x64 binary builds, download them when building
Neovim.
2017-02-16 16:23:18 +01:00
Rui Abreu Ferreira
bddea0caff win/build: Fix libuv recipe for Windows/NMake X86_64
The 64bit check for the libuv recipe worked for the VS generator
but not for NMake.
2017-02-16 16:23:18 +01:00