Commit Graph

11299 Commits

Author SHA1 Message Date
Jan Edmund Lazo
1ec5485db4 fold: add const to checkSmall() variables 2018-08-02 17:15:53 -04:00
Jan Edmund Lazo
20eeb61fb2 fold: declare and init vars in deleteFoldEntry()
Use sizeof() on pointer value, not explicit type, for memmove.
2018-08-02 13:10:25 -04:00
Jan Edmund Lazo
a515401cf0 fold: add const to foldMoveTo() variables
Declare and initialize variables on same line if possible.
2018-08-02 12:50:50 -04:00
Jan Edmund Lazo
407ac8b42d fold: add const to deleteFold() variables
Declare and initialize variables on same line if possible.
2018-08-02 11:58:50 -04:00
Jan Edmund Lazo
3de785e7b5 fold: add const to hasFoldingWin() variables
cache is bool so update callers to pass true/false, not TRUE/FALSE.
2018-08-02 08:44:42 -04:00
Jan Edmund Lazo
d2c1d9c466 ex_cmds: add const to helptags_one() variables 2018-08-01 23:21:17 -04:00
Jan Edmund Lazo
144e85b7b9 ex_cmds: add const to fix_help_buffer() variables 2018-08-01 23:02:52 -04:00
Jan Edmund Lazo
d29c02710e hardcopy: refactor mch_print_start_line()
Refactor the following affected functions:
- prt_line_number()
- prt_header()

These use prt_set_font(), refactored in 872a76f3dac14fdcb7dc7b34cecd3acb4370d56f for TriState.
2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
d536fb018f hardcopy: bold,italic,underline are TriState 2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
c0dbd8df95 fold: use_level,maybe_small are bool
use_levelp, maybe_smallp in check_closed() are bool ptrs.
2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
44cb491f6e globals: virtual_op is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
faa9869a9e fold: recursive in deleteFoldEntry() is bool 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
14cffc3d1d fold: fold_changed is bool 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
667b8cd108 fold: finish in foldUpdateIEMSRecurse() is bool 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
3f8ba68895 screen: screen_cleared is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
971e9370ad fold: lineFolded() is bool 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
6dfaf8e914 fold: check_closed() returns bool
Update affected variables (ie. had_folded).
Add const to params to restrict usage.

TODO: refactor win_T.w_lines[idx].wl_folded from char to bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
4fb9b42869 search: refactor variables in findmatchlimit()
Combine declaration and initialization.
Refactor int variables, that use TRUE/FALSE macros (not MAYBE), to bool.
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
ba6417091c search: start_in_quotes in findmatchlimit is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
0e55d88639 edit: dont_sync_undo is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
deae2e8434 ex_cmds: refactor utf8 variables to TriState
- utf8 in helptags_one()
- this_utf in fix_help_buffer()
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
f35df8d697 menu: enable in ex_menu() is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
f193b5241f fold: fold_T.fd_small is TriState 2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
9e20398908 diff: refactor diff_a_works to use TriState 2018-08-01 15:28:44 -04:00
Jan Edmund Lazo
a095a48987 clint: detect MAYBE and recommend TriState
Vim uses MAYBE for 3-value boolean with FALSE/TRUE/MAYBE.
Use TriState type instead to restrict to 3 values, kFalse/kTrue/kNone.
2018-08-01 15:23:01 -04:00
Marcos Almeida
a2253744c9 system(): handle profiling and 'verbose' #8730
closes #8362

Vim's code calls `call_shell` directly from `get_system_output_as_rettv`
whereas in Nvim this function has been rewritten to not call `call_shell` but to call
`os_system` via `do_os_system`, losing the support for profiling and verbose.

Changing the code to call `call_shell` from `get_system_output_as_rettv`
seems to be too complicated to be worth it on the current version of the
code. So this commit duplicates the relevant code.
2018-07-29 03:49:11 +02:00
Justin M. Keyes
befc7de26f
Merge pull request #8770 from janlazo/vim-8.0.0726 2018-07-29 02:00:48 +02:00
Daniel Hahler
a4494b7cbc checkhealth: always report stderr with errors (#8783)
This also reports the exit code (e.g. 127 for when pyenv-which fails).
2018-07-29 01:46:59 +02:00
Daniel Hahler
ade88fe4cc checkhealth: do not use exepath with host_prog (#8784)
This would need to get `expand`ed to not become empty, and is being
handled by s:check_bin already.

`s:check_bin` will also complain about e.g.
"~/.pyenv/versions/3.6.6/bin/python" not being executable, but that
reflects that the host will fail to start with it.

Fixes #8778
2018-07-29 01:44:46 +02:00
hyatskov
bb33fc4f55 log.c: Fix possible truncation in buffer (#8791) 2018-07-29 01:38:17 +02:00
Justin M. Keyes
8951304c10
Merge #8793 from janlazo/vim-8.0.0837 2018-07-29 01:32:39 +02:00
Jan Edmund Lazo
e09e9ca810 lint 2018-07-27 18:43:53 -04:00
Jan Edmund Lazo
882782f0fb screen: add const and reindent update_debug_signs() 2018-07-27 18:43:53 -04:00
Jan Edmund Lazo
243d16688a vim-patch:8.0.0837: signs can be drawn on top of console messages
Problem:    Signs can be drawn on top of console messages.
Solution:   don't redraw at a prompt or when scrolled up. (Christian Brabandt,
            closes vim/vim#1907)
0792048842
2018-07-27 18:40:31 -04:00
Björn Linse
9abe0bdb54
Merge pull request #8789 from bfredl/updatehl
screen.c: add update_window_hl to special redrawing entrypoints, fixes a crash
2018-07-27 23:20:58 +02:00
Björn Linse
9a584773b5 screen.c: add update_window_hl to special redrawing entrypoints
The following (run as a script) used to cause a crash due to :sign using a
special redraw (not updating nvim's specific highlight data structures)
without proper redraw first, as split just flags for redraw later.

set cursorline
sign define piet text=>> texthl=Search
split
sign place 3 line=2 name=piet buffer=1
2018-07-27 17:11:01 +02:00
James McCoy
85a7170f19
Merge pull request #8767 from janlazo/vim-8.0.0493
[RDY] vim-patch:8.0.0493
2018-07-27 10:50:57 -04:00
James McCoy
594859fdd6
Merge pull request #8485 from janlazo/vim-8.0.1012
[RDY] vim-patch:8.0.{805,806,810,1012,1017}
2018-07-27 10:44:29 -04:00
James McCoy
e42688fcf3
Merge pull request #8769 from janlazo/vim-8.0.1502
[RDY] vim-patch:8.0.{1502,1512,1622}
2018-07-27 10:06:46 -04:00
Björn Linse
5f15788dc3
tui: clip invalid regions on resize (#8779), fixes #8774 2018-07-26 19:55:26 +02:00
Justin M. Keyes
9c0c5e8bc6
Merge #8729 'log: milliseconds, format' 2018-07-25 16:29:23 +02:00
Justin M. Keyes
27dc42160f log.c: format: padding
- milliseconds: leading zeroes
- PID: whitespace padding
2018-07-25 15:29:57 +02:00
Jan Edmund Lazo
30bba7a10c vim-patch:8.0.1017: test for MS-Windows $HOME always passes
Problem:    Test for MS-Windows $HOME always passes.
Solution:   Rename the test function.  Make the test pass.
dde6034111

Assume $HOME contains the literal absolute path.
Nested environment variable expansion is unsupported.
2018-07-24 23:17:36 -04:00
Jan Edmund Lazo
5ed0975ea2 vim-patch:8.0.1012: MS-Windows: problem with $HOME when is was set internally
Problem:    MS-Windows: Problem with $HOME when is was set internally.
Solution:   Only use the $HOME default internally. (Yasuhiro Matsumoto, closes
            vim/vim#2013)
48340b62e8

Restore vim_getenv() behaviour for $HOME on Windows.
2018-07-24 23:17:28 -04:00
Jan Edmund Lazo
b0ab46056f vim-patch:8.0.0810: MS-Windows: tests still hang
Problem:    MS-Windows: tests still hang.
Solution:   Only create the XfakeHOME directory if it does not exist yet.
d0b6c6c54e
2018-07-24 22:31:26 -04:00
Jan Edmund Lazo
290a9632d6 vim-patch:8.0.0806: tests may try to create XfakeHOME twice
Problem:    Tests may try to create XfakeHOME twice.
Solution:   Avoid loading setup.vim twice.
f98246d484
2018-07-24 22:31:26 -04:00
Jan Edmund Lazo
28c3679b64 vim-patch:8.0.0805: GUI test fails with gnome2
Problem:    GUI test fails with gnome2.
Solution:   Set $HOME to an existing directory.
d1ee0043c0
2018-07-24 22:31:26 -04:00
Justin M. Keyes
ef86aad878 log.c: ISO 8601 date/time
After:
    INFO  2018-07-17T22:05:46.175 656 main:560: starting main loop
2018-07-24 19:36:38 +02:00
Justin M. Keyes
3258c6a2f4 log.c: include milliseconds
closes #8727

Before:
    INFO  180711.233956 11124 main:560: starting main loop
After:
    INFO  180711.233956.807 11124 main:560: starting main loop

Note:
  - Can't use uv_hrtime() nor uv_now(), they are not "since the epoch".
    Also, log.c can't assume a loop exists.
2018-07-24 19:36:38 +02:00
Justin M. Keyes
4d6a1e5566 log.c: message format
- Log-level name (INFO/ERROR/…) should be in the first column, so that
  filtering by log-level is maximally trivial.
- Use 2-digit year. 4-digit year is useless, logs don't survive for
  decades without context.

Before:
    2018/07/05 17:49:41 INFO  27596 on_process_exit:393: foo
After:
    INFO  180705.174941 27596 on_process_exit:393: foo
2018-07-24 19:25:51 +02:00