Commit Graph

10890 Commits

Author SHA1 Message Date
ZyX
2cdf9d1388 search: Fix PVS/V560: condition checked in previous if with goto 2018-04-22 19:47:45 +03:00
ZyX
db1c9b625c search: Fix PVS/V547: condition already checked in surrounding if 2018-04-22 19:46:27 +03:00
ZyX
b144a77f38 search: Fix PVS/V547: checking variable right after assigning it 2018-04-22 19:44:56 +03:00
ZyX
3c7cc03f34 screen: Fix PVS/V560: col never reassigned in this part of code 2018-04-22 19:43:27 +03:00
ZyX
4ff4e66fd7 screen: Fix PVS/V519: duplicate successive assignment 2018-04-22 19:40:47 +03:00
ZyX
9c981f5a19 screen: Fix PVS/V560: condition was checked in surrounding if 2018-04-22 19:39:39 +03:00
ZyX
e3bffa47a6 globals: Do not use false for enc_dbcs
Based on screen.c code this value is not a boolean, so `false` is not 
appropriate. It should be either 0 or one of DBCS_… values.
2018-04-22 19:33:46 +03:00
ZyX
d42f934bcb screen: Get rid of ScreenLines2 as it is no longer used
Should also fix some PVS warnings in process.
2018-04-22 19:32:17 +03:00
ZyX
adfc1212b5 regexp_nfa: Silence PVS/V560: current code is more obvious
While warning is technically true (cannot enter this case with `state->c` 
greater then NFA_Z…9) it makes condition less readable and relies on knownledge 
of enum internal structure.
2018-04-22 19:09:20 +03:00
ZyX
190cc43cf3 quickfix: Silence PVS/V560: memory is referenced and may be changed 2018-04-22 18:59:23 +03:00
ZyX
3ee187b770 quickfix: Fix PVS/V547: allocator never returns NULL now 2018-04-22 18:57:34 +03:00
ZyX
4d43ce85f1 quickfix: Fix PVS/V547,V560: no conversion with fixed &encoding 2018-04-22 18:54:52 +03:00
Justin M. Keyes
d05712fbe7
inccommand: pause :terminal redraws (#8307)
fix #5584
2018-04-22 12:26:16 +02:00
Nimit Bhardwaj
51af911a27 inccommand: do not execute trailing commands #8256
fix #7494
2018-04-21 13:06:46 +02:00
Justin M. Keyes
b71697bc67 lint 2018-04-21 12:51:27 +02:00
Justin M. Keyes
9139bf81cf defaults: disable 'fsync'
ref #6725

fsync() is very slow on some systems.  And since the parent commit, Nvim
is smarter about flushing files at certain times (e.g. CursorHold),
regardless of whether 'fsync' is enabled.  So it's less risky to disable
'fsync'.

Profiling showed slow (2-4s) :write and :quit caused by fsync():

:quit
    shada_write_file(NULL, false);

:write + fsync
    0  0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84
    1  0x0000000000638970 in uv__fs_fsync (req=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150
    2  uv__fs_work (w=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953
    3  0x0000000000639a70 in uv_fs_fsync (loop=<optimized out>, req=<optimized out>, file=41, cb=0x7f72da567b2d <fsync+45>)
       at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094
    4  0x0000000000573694 in os_fsync (fd=41) at ../src/nvim/os/fs.c:631
    5  0x00000000004ec9dc in buf_write (buf=<optimized out>, fname=<optimized out>, sfname=<optimized out>, start=1, end=1997, eap=0x7fffc864c570,
       append=<optimized out>, forceit=<optimized out>, reset_changed=<optimized out>, filtering=<optimized out>) at ../src/nvim/fileio.c:3387
    6  0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745
    ...

:write + nofsync
    0  0x00007f72da567b2d in fsync () at ../sysdeps/unix/syscall-template.S:84
    1  0x0000000000638970 in uv__fs_fsync (req=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:150
    2  uv__fs_work (w=<optimized out>) at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:953
    3  0x0000000000639a70 in uv_fs_fsync (loop=<optimized out>, req=<optimized out>, file=36, cb=0x7f72da567b2d <fsync+45>)
       at /home/vagrant/neovim/.deps/build/src/libuv/src/unix/fs.c:1094
    4  0x0000000000573694 in os_fsync (fd=36) at ../src/nvim/os/fs.c:631
    5  0x0000000000528f5a in mf_sync (mfp=0x7f72d8968d00, flags=5) at ../src/nvim/memfile.c:466
    6  0x000000000052d569 in ml_preserve (buf=0x7f72d890f000, message=0) at ../src/nvim/memline.c:1659
    7  0x00000000004ebadf in buf_write (buf=<optimized out>, fname=<optimized out>, sfname=<optimized out>, start=1, end=1997, eap=0x7fffc864c570,
       append=<optimized out>, forceit=<optimized out>, reset_changed=<optimized out>, filtering=<optimized out>) at ../src/nvim/fileio.c:3071
    8  0x00000000004b44ff in do_write (eap=0x7fffc864c570) at ../src/nvim/ex_cmds.c:1745
    ...
2018-04-21 12:51:27 +02:00
Justin M. Keyes
498731615c IO: let 'fsync' option control more cases
Vim has the 'swapsync' option which we removed in 62d137ce09.
Instead let 'fsync' control swapfile-fsync.

These cases ALWAYS force fsync (ignoring 'fsync' option):
- Idle (CursorHold).
- Exit caused by deadly signal.
- SIGPWR signal.
- Explicit :preserve command.
2018-04-21 12:51:27 +02:00
Justin M. Keyes
a02d22cca8 IO: shada should respect 'fsync' option
shada_write_file() is called on exit (:quit and friends), this can be
very slow.

Note: AFAICT Vim (do_viminfo()) does not appear to fsync() viminfo.
2018-04-21 12:50:28 +02:00
Justin M. Keyes
fe5f38d8bd
terminal: do not call redraw_buf_later() (#8306)
fixes #8290
2018-04-21 04:11:45 +02:00
Justin M. Keyes
be2a3ddd58
test: "Command-line option -s": avoid indeterminism (#8305)
closes #8303
2018-04-21 03:15:18 +02:00
Justin M. Keyes
c10a207a20
test/util: throttle retry() (#8296)
Avoid a hot loop in retry(), there's no need to retry more than 50/s.

Also use luv.sleep() to implement sleep() instead of spinning the
event-loop, so events are not silently discarded.
2018-04-20 23:56:50 +02:00
Andy Russell
d29c243bef doc: platform-specific config locations (#8297)
Fixes #7374.
2018-04-20 19:04:30 +02:00
ZyX
b7a46f2299 eval/typval: Remove struct dictitem_S which is not used anywhere 2018-04-20 00:04:25 +03:00
Björn Linse
be1448213c
Merge pull request #8291 from bfredl/ui_resize
ui_events: correct wrong argument order in resize event
2018-04-19 10:22:19 +02:00
Justin M. Keyes
a1530ece87
Merge #8293 from justinmk/test-nodejs
test: nodejs_spec: allow more time for nodejs init
2018-04-18 19:58:05 +02:00
Justin M. Keyes
522443d6bf test/util: retry(): also decorate non-string error 2018-04-18 09:47:51 +02:00
Justin M. Keyes
1dc497398e test: nodejs_spec: allow more time for nodejs init 2018-04-18 09:42:56 +02:00
Björn Linse
c8189096e8 ui_events: correct wrong argument order 2018-04-17 19:09:18 +02:00
Justin M. Keyes
7a13611ba2
Merge #8276 'startup: Make -s - read from stdin' 2018-04-17 10:33:36 +02:00
ZyX
8cdaac0d80 event/process: Silence PVS/V547: assuming stream->num_bytes changes
Not familiar with the code, but I assume that loop_poll_events can actually 
change stream->num_bytes, so condition is not always false.
2018-04-17 01:49:46 +03:00
ZyX
cb3bb0becb pvscheck: Add --update switch 2018-04-17 01:44:11 +03:00
ZyX
57c66bc168 pvscheck: Remove outputs before running plog-converter
plog-converter behaviour is not the best one when creating fullhtml report and
directory already exists: it puts report inside an existing directory. Not sure
what exactly it does if inside exists as well, but if I am not mistaking report
will not be created.
2018-04-17 01:37:58 +03:00
ZyX
eba61fbc97 path: Silence PVS/V557: impossible to reach with NUL-terminated string 2018-04-17 01:36:18 +03:00
ZyX
4a1251206a path: Fix PVS/V560: condition is essentially A && A 2018-04-17 01:07:16 +03:00
Justin M. Keyes
48967695c4
test: tui_spec.lua: relax test (#8289)
Sometimes an extra FocusGained/FocusLost event might trigger. This
doesn't matter, we just want to test that the events were received in
cmdline-mode.
2018-04-16 23:35:58 +02:00
Justin M. Keyes
0cec184cd6 startup: ignore -X
closes #8285
2018-04-16 22:38:02 +02:00
Andrew Pyatkov
84359a467f terminal: resize to the max dimensions (#8249)
closes #8096
2018-04-16 22:25:23 +02:00
Marco Hinz
9a1f57b488
contrib: fix local.mk.example (#8286)
We have two ways to disable third-party/

  1. make USE_BUNDLED_DEPS=OFF
  2. cmake USE_BUNDLED=OFF

The example used the make option in a cmake context.
2018-04-16 21:21:44 +02:00
ZyX
fab09ea0d6 option: Silence PVS/V547: expression is true on 64-bit systems 2018-04-16 11:37:39 +03:00
ZyX
d0850586df option: Fix PVS/V547: var is always NULL at that point 2018-04-16 11:36:06 +03:00
ZyX
6a5b9de546 option: Fix PVS/V560: EXPAND_BOOL_SETTINGS already caused early return 2018-04-16 11:34:26 +03:00
ZyX
61b6eb926d option: Fix PVS/V547: allocator never returns NULL now 2018-04-16 11:33:11 +03:00
ZyX
d66217ab6d option: Fix PVS/V517: duplicate check for titlelen 2018-04-16 11:32:00 +03:00
ZyX
0eb1d7ca4c option: Silence PVS/V594: GLOBAL_WO macros is not really necessary
In that case it is completely possible to just use w_allbuf_opt directly.
2018-04-16 11:31:27 +03:00
ZyX
95cc2507c9 ops: Fix PVS/V560: pre may not be zero as that was already checked 2018-04-16 11:23:22 +03:00
Justin M. Keyes
ed6a113804
Merge #8273 'job-control: avoid kill-timer race' 2018-04-16 08:44:28 +02:00
ZyX
fc1ebb060e ops: Fix PVS/V614: use of uninitialized variable
I have actually no idea how code managed to work and not trigger ASAN/etc here. 
It does not look like a false positive at all.
2018-04-15 21:49:47 +03:00
ZyX
dae1975394 ops: Fix PVS/V547: allocator never returns NULL 2018-04-15 21:46:32 +03:00
ZyX
2b7a8ceeb6 ops: Fix PVS/V547: did_change is almost always set
Only exception is early `goto theend`.
2018-04-15 21:44:36 +03:00
ZyX
4a145f2036 ops: Silence PVS/V614: regtype is always initialized 2018-04-15 21:40:30 +03:00