Commit Graph

10796 Commits

Author SHA1 Message Date
ZyX
6c2b442ee0 eval/typval: Silence PVS/V576: format is correct 2018-04-22 20:20:53 +03:00
ZyX
f50670aeff ugrid: Silence PVS/V625: UGRID_FOREACH_CELL may be used for one row 2018-04-22 20:18:29 +03:00
ZyX
f9b728e2f8 tui: Silence PVS/V560: condition is set to true in prev-previous if() 2018-04-22 20:16:58 +03:00
ZyX
9da2e7b021 syntax: Fix PVS/V560: condition was checked in previous if(), breaking 2018-04-22 20:15:42 +03:00
ZyX
3f4ec1aed2 syntax: Fix PVS/V547: condition was checked
In surrounding if() `off` was checked for being non-zero and in previous if() it
was checked for being positive.
2018-04-22 20:15:42 +03:00
ZyX
e724667ef4 syntax: Silence PVS/V560: condition is always true at that point 2018-04-22 20:12:23 +03:00
ZyX
2a951d16a4 syntax: Silence PVS/V522: retval is always non-NULL on this round 2018-04-22 20:08:49 +03:00
ZyX
5ba267722c syntax: Fix PVS/V560: condition checked in previous if() 2018-04-22 20:06:35 +03:00
ZyX
0eaecbaf47 strings: Fix PVS/V547: condition already checked by surrounding if 2018-04-22 20:05:32 +03:00
ZyX
b9b17a58da strings: Fix PVS/V779: wrong assert() position 2018-04-22 20:03:48 +03:00
ZyX
fb0c35105f spellfile: Silence PVS/V547: expression may be true on other systems 2018-04-22 20:02:50 +03:00
ZyX
f45df71081 spellfile: Fix PVS/V547: allocator never returns NULL now 2018-04-22 20:02:50 +03:00
ZyX
0ba2ec0bae spellfile: Fix PVS/V560: allocator never returns NULL now 2018-04-22 19:54:40 +03:00
ZyX
60577eeaf5 spell: Fix PVS/V512: use of sprintf() 2018-04-22 19:53:06 +03:00
ZyX
9f3e67a814 search: Fix PVS/V547: allocator never returns NULL now 2018-04-22 19:50:13 +03:00
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