Note: neovim does not exist the problems.
I have fixed two problems.
'showmode' does work even cmdheight=0
.
Double echoes :!{cmd}
when cmdheight=0
.
Fix #10881
https://github.com/vim/vim/pull/10893
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@Shougo pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
Merging #10893 (de3c3db) into master (87f3a2c) will increase coverage by
0.87%
.
The diff coverage is87.50%
.
@@ Coverage Diff @@ ## master #10893 +/- ## ========================================== + Coverage 81.80% 82.67% +0.87% ========================================== Files 158 148 -10 Lines 186293 173602 -12691 Branches 42110 39225 -2885 ========================================== - Hits 152393 143525 -8868 + Misses 21409 17482 -3927 - Partials 12491 12595 +104
Flag | Coverage Δ | |
---|---|---|
huge-clang-none | 82.67% <87.50%> (-0.01%) |
⬇️ |
linux | 82.67% <87.50%> (-0.01%) |
⬇️ |
mingw-x64-HUGE | ? |
|
mingw-x64-HUGE-gui | ? |
|
windows | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
src/ex_cmds.c | 85.80% <83.33%> (+0.11%) |
⬆️ |
src/normal.c | 90.28% <100.00%> (-0.98%) |
⬇️ |
src/screen.c | 78.75% <100.00%> (-0.62%) |
⬇️ |
src/highlight.c | 78.40% <0.00%> (-2.81%) |
⬇️ |
src/time.c | 87.08% <0.00%> (-2.56%) |
⬇️ |
src/misc2.c | 86.71% <0.00%> (-2.41%) |
⬇️ |
src/help.c | 80.06% <0.00%> (-2.34%) |
⬇️ |
src/buffer.c | 84.15% <0.00%> (-2.31%) |
⬇️ |
src/session.c | 63.15% <0.00%> (-1.94%) |
⬇️ |
src/menu.c | 81.19% <0.00%> (-1.85%) |
⬇️ |
... and 131 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I want to add the tests, but it is for screen tests.
I don't know how to add screen tests.
neovim has helper functions for it.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Not sure it helps here but there is:
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
See also the README.txt
file in src/testdir/
:
TO ADD A SCREEN DUMP TEST:
Mostly the same as writing a new style test. Additionally, see help on
"terminal-dumptest". Put the reference dump in "dumps/Test_func_name.dump".
TO ADD A NEW STYLE TEST:
1) Create a test_<subject>.vim file.
2) Add test_<subject>.res to NEW_TESTS_RES in Make_all.mak in alphabetical
order.
3) Also add an entry "test_<subject>" to NEW_TESTS in Make_all.mak.
4) Use make test_<subject> to run a single test.
At 2), instead of running the test separately, it can be included in
"test_alot". Do this for quick tests without side effects. The test runs a
bit faster, because Vim doesn't have to be started, one Vim instance runs many
tests.
At 4), to run a test in GUI, add "GUI_FLAG=-g" to the make command.
What you can use (see test_assert.vim for an example):
- Call assert_equal(), assert_true(), assert_false(), etc.
- Use assert_fails() to check for expected errors.
- Use try/catch to avoid an exception aborts the test.
- Use test_alloc_fail() to have memory allocation fail. This makes it possible
to check memory allocation failures are handled gracefully. You need to
change the source code to add an ID to the allocation. Add a new one to
alloc_id_T, before aid_last.
- Use test_override() to make Vim behave differently, e.g. if char_avail()
must return FALSE for a while. E.g. to trigger the CursorMovedI autocommand
event. See test_cursor_func.vim for an example.
- If the bug that is being tested isn't fixed yet, you can throw an exception
with "Skipped" so that it's clear this still needs work. E.g.: throw
"Skipped: Bug with <c-e> and popupmenu not fixed yet"
- The following environment variables are recognized and can be set to
influence the behavior of the test suite (see runtest.vim for details)
- $TEST_MAY_FAIL=Test_channel_one - ignore those failing tests
- $TEST_FILTER=Test_channel - only run test that match this pattern
- $TEST_SKIP_PAT=Test_channel - skip tests that match this pattern
- $TEST_NO_RETRY=yes - do not try to re-run failing tests
You can also set them in Vim:
:let $TEST_MAY_FAIL = 'Test_channel_one'
:let $TEST_FILTER = '_set_mode'
:let $TEST_SKIP_PAT = 'Test_loop_forever'
:let $TEST_NO_RETRY = 'yes'
Use an empty string to revert, e.g.:
:let $TEST_FILTER = ''
- See the start of runtest.vim for more help.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I have added tests.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
In the tests "redraw!" is used before restoring 'cmdheight', shouldn't that be the other way around?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Clearing the screen at the end of msg_clr_eos_force() looks like a brute force method. Isn't there a better way?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
@Shougo pushed 2 commits.
You are receiving this because you are subscribed to this thread.
In the tests "redraw!" is used before restoring 'cmdheight', shouldn't that be the other way around?
Fixed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Clearing the screen at the end of msg_clr_eos_force() looks like a brute force method. Isn't there a better way?
I want to just redraw msg_row
lines, but I cannot find the method in drawscreen.c
...
Do you know the function?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
The optimal would be to set b_mod_top and b_mod_bot. You need to figure
out the buffer lines then (perhaps "w_botline - 1" works if there is only
one screen line affected).
Well, but both b_mod_top
and b_mod_top
are line number
.
It is not screen position
. How to convert it?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
If only the last window is affected, then redraw_win_later(wp,
NOT_VALID) should work. If the screen scrolled, then
redraw_all_later(VALID) probaby can be used, since "msg_scrolled" is
handled in update_screen().
And how to compute what windows are affected?
I have read the code and I have not found the optimization.
It seems simple redraw routine.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Hm... I have created the routine, but it is too difficult and does not work well.
diff --git a/src/message.c b/src/message.c index 48012bb32..dbe41be04 100644 --- a/src/message.c +++ b/src/message.c @@ -3477,7 +3477,46 @@ msg_clr_eos_force(void) } } else - redraw_all_later(VALID); + { + int scrolled; + int type = VALID; + win_T *wp; + + scrolled = Rows - msg_row; + if (scrolled > Rows - 5) // clearing is faster + type = CLEAR; + else if (type != CLEAR) + { + check_for_delay(FALSE); + if (screen_ins_lines(0, 0, scrolled, (int)Rows, 0, NULL) + == FAIL) + type = CLEAR; + FOR_ALL_WINDOWS(wp) + { + if (wp->w_winrow < scrolled) + { + if (W_WINROW(wp) + wp->w_height > scrolled + && wp->w_redr_type < REDRAW_TOP + && wp->w_lines_valid > 0 + && wp->w_topline == wp->w_lines[0].wl_lnum) + { + wp->w_upd_rows = scrolled - W_WINROW(wp); + wp->w_redr_type = REDRAW_TOP; + } + else + { + wp->w_redr_type = NOT_VALID; + if (W_WINROW(wp) + wp->w_height + wp->w_status_height + <= msg_scrolled) + wp->w_redr_status = TRUE; + } + } + } + redraw_tabline = TRUE; + } + + redraw_all_later(type); + } }
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
redraw_all_later(CLEAR);
is not smart. But it works well without problems.
I like works version of code.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
message.c: In function ‘msg_clr_eos_force’:
message.c:3481:26: error: ‘CLEAR’ undeclared (first use in this function); did you mean ‘CAR’?
3481 | redraw_all_later(CLEAR);
| ^~~~~
| CAR
Why?
CLEAR
is defined in vim.h
and it is already included.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shougo pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
@Shougo pushed 15 commits.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.
The messages test fails in some builds, and there is an ASAN error. Probably the tests uncovered a problem, I'll have a look.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I have included the tests and fixed a few problems.
Are the code changes in this PR still needed? If yes, then please add a test that fails without them.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Thanks. I will rebase it later.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Closed #10893.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I think the patch is not needed anymore. But I will re-create another PR to revert some change.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
While trying out cmdheight=0 I noticed that once in a while the last
statusline goes missing, the last window is too tall. I also had to fix
a crash where an index goes over Rows, the two are probably related.
I haven't been able to reproduce it, it might have something to do with
a shell command.
Well, I don't reproduce the problem.
I will check it if it is reproduced.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Anyway, please check my question on the vim-dev maillist, discussing
whether we should keep supporting 'cmdheight' zero or revert it.
OK. I will take look later.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.