Commit Graph

10808 Commits

Author SHA1 Message Date
ZyX
4ce8521ee4 pvscheck: Disable V011 warning 2018-04-22 20:54:17 +03:00
ZyX
a37819dbb1 spellfile: Fix clint error 2018-04-22 20:35:17 +03:00
ZyX
953d167015 syntax: Fix PVS/V560: condition was already checked 2018-04-22 20:34:32 +03:00
ZyX
76c2a60ff3 spellfile: Fix PVS/V547: allocator now never returns NULL 2018-04-22 20:33:42 +03:00
ZyX
03c2844b53 functests: Fix testlint errors 2018-04-22 20:32:25 +03:00
ZyX
4bab9d34e6 *: Fix clint errors 2018-04-22 20:31:40 +03:00
symphorien
ffb8904913 tui/input.c: add support for mouse release events in urxvt (#8309)
Some terminals don't report which buttons are involved in some mouse
events. For example, the urxvt protocol
(http://www.huge-man-linux.net/man7/urxvt.html section "Mouse
reporting") does not report which button has been released.
In this case libtermkey reports button 0
(http://www.leonerd.org.uk/code/libtermkey/doc/termkey_interpret_mouse.3.html)

Up to now, forward_mouse_event did not handle button==0.
On press events there is not much we can do, and we keep the
current behavior which is dropping the event. But on drag-and-release
events we can compensate by remembering the last button pressed.

fixes #3182 for urxvt
fixes #5400
2018-04-22 19:26:04 +02:00
ZyX
4b41680828 window: Fix PVS/V547: expression already checked in previous if() 2018-04-22 20:25:44 +03:00
ZyX
c8648daab3 window: Silence PVS/V547: height may be changed by curwin ptr 2018-04-22 20:24:57 +03:00
ZyX
d9c010e45d api/vim: Fix PVS/V547: node was already dereferenced, so can’t be NULL 2018-04-22 20:23:50 +03:00
ZyX
a90672fc3d undo: Silence PVS/V547: expression may be false on other system 2018-04-22 20:22:46 +03:00
ZyX
43df2edd20 ui_bridge: Silence PVS/V547: assuming stopped may be changed via ptr 2018-04-22 20:21:55 +03:00
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