Skip to content

Commit 014c85a

Browse files
committed
Merge remote-tracking branch 'upstream/master' into tabsidebar
2 parents 2cb501e + 9d5487f commit 014c85a

File tree

6 files changed

+87
-39
lines changed

6 files changed

+87
-39
lines changed

CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ Contributions will be distributed with Vim under the Vim license. Providing a
2121
change to be included implies that you agree with this and your contribution
2222
does not cause us trouble with trademarks or patents. There is no CLA to sign.
2323

24+
## Signing-off commits
25+
26+
While not required, it's recommended to use **Signed-off commits** to ensure
27+
transparency, accountability, and compliance with open-source best practices.
28+
Signed-off commits follow the [Developer Certificate of Origin (DCO)][15],
29+
which confirms that contributors have the right to submit their changes under
30+
the project's license. This process adds a `Signed-off-by` line to commit
31+
messages, verifying that the contributor agrees to the project's licensing
32+
terms. To sign off a commit, simply use the -s flag when committing:
33+
34+
```sh
35+
git commit -s
36+
```
37+
38+
This ensures that every contribution is properly documented and traceable,
39+
aligning with industry standards used in projects like the Linux Kernel or
40+
the git project. By making Signed-off commits a standard practice, we help
41+
maintain a legally compliant and well-governed codebase while fostering trust
42+
within our contributor community.
43+
44+
When merging PRs into Vim, the current maintainer @chrisbra usually adds missing
45+
`Signed-off-by` trailers for the author user name and email address as well for
46+
anybody that explicitly *ACK*s a pull request as a statement that those
47+
approvers are happy with that particular change.
48+
2449
# Reporting issues
2550

2651
We use GitHub issues, but that is not a requirement. Writing to the Vim
@@ -113,3 +138,4 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website,
113138
[12]: https://github.com/vim/vim/blob/master/src/testdir/test_filetype.vim
114139
[13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt
115140
[14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt
141+
[15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin

runtime/doc/testing.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*testing.txt* For Vim version 9.1. Last change: 2025 Mar 23
1+
*testing.txt* For Vim version 9.1. Last change: 2025 Mar 25
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -68,7 +68,7 @@ test_feedinput({string}) *test_feedinput()*
6868

6969

7070
test_garbagecollect_now() *test_garbagecollect_now()*
71-
Like garbagecollect(), but executed right away. This must
71+
Like |garbagecollect()|, but executed right away. This must
7272
only be called directly to avoid any structure to exist
7373
internally, and |v:testing| must have been set before calling
7474
any function. *E1142*

src/term.c

+40-35
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,20 @@ static int term_is_builtin(char_u *name);
6767
static int term_7to8bit(char_u *p);
6868
static void accept_modifiers_for_function_keys(void);
6969

70-
# if 0 // Change to 1 to enable ch_log() calls for termresponse debugging.
71-
# define DEBUG_TERMRESPONSE
72-
# define LOG_TR(fmt,...) \
73-
ch_log(NULL, "TermResp: %s " fmt, \
74-
must_redraw == UPD_NOT_VALID ? "NV" \
75-
: must_redraw == UPD_CLEAR ? "CL" : " ", ##__VA_ARGS__)
76-
# else
77-
# define LOG_TR(fmt,...) do { /**/ } while (0)
78-
# endif
70+
#if 0 // Change to 1 to enable ch_log() calls for termresponse debugging.
71+
# define DEBUG_TERMRESPONSE
72+
# define LOG_TR1(str) \
73+
ch_log(NULL, "TermResp: %s " str, \
74+
must_redraw == UPD_NOT_VALID ? "NV" \
75+
: must_redraw == UPD_CLEAR ? "CL" : " ")
76+
# define LOG_TRN(fmt,...) \
77+
ch_log(NULL, "TermResp: %s " fmt, \
78+
must_redraw == UPD_NOT_VALID ? "NV" \
79+
: must_redraw == UPD_CLEAR ? "CL" : " ", __VA_ARGS__)
80+
#else
81+
# define LOG_TR1(str) do { /**/ } while (0)
82+
# define LOG_TRN(fmt,...) do { /**/ } while (0)
83+
#endif
7984

8085
#ifdef HAVE_TGETENT
8186
static char *invoke_tgetent(char_u *, char_u *);
@@ -1691,7 +1696,7 @@ may_adjust_color_count(int val)
16911696
{
16921697
int r = redraw_asap(UPD_CLEAR);
16931698

1694-
LOG_TR("Received t_Co, redraw_asap(): %d", r);
1699+
LOG_TRN("Received t_Co, redraw_asap(): %d", r);
16951700
}
16961701
#else
16971702
redraw_asap(UPD_CLEAR);
@@ -2300,7 +2305,7 @@ set_termname(char_u *term)
23002305
full_screen = TRUE; // we can use termcap codes from now on
23012306
set_term_defaults(); // use current values as defaults
23022307
#ifdef FEAT_TERMRESPONSE
2303-
LOG_TR("setting crv_status to STATUS_GET");
2308+
LOG_TR1("setting crv_status to STATUS_GET");
23042309
crv_status.tr_progress = STATUS_GET; // Get terminal version later
23052310
write_t_8u_state = FALSE;
23062311
#endif
@@ -4080,7 +4085,7 @@ may_req_termresponse(void)
40804085
&& *T_CRV != NUL)
40814086
{
40824087
MAY_WANT_TO_LOG_THIS;
4083-
LOG_TR("Sending CRV request");
4088+
LOG_TR1("Sending CRV request");
40844089
out_str(T_CRV);
40854090
termrequest_sent(&crv_status);
40864091
// check for the characters now, otherwise they might be eaten by
@@ -4119,7 +4124,7 @@ check_terminal_behavior(void)
41194124
// changes cursor position, so it must be called immediately after
41204125
// entering termcap mode.
41214126
MAY_WANT_TO_LOG_THIS;
4122-
LOG_TR("Sending request for ambiwidth check");
4127+
LOG_TR1("Sending request for ambiwidth check");
41234128
// Do this in the second row. In the first row the returned sequence
41244129
// may be CSI 1;2R, which is the same as <S-F3>.
41254130
term_windgoto(1, 0);
@@ -4148,7 +4153,7 @@ check_terminal_behavior(void)
41484153
// handles test sequence incorrectly, a garbage string is displayed and
41494154
// the cursor does move.
41504155
MAY_WANT_TO_LOG_THIS;
4151-
LOG_TR("Sending xterm compatibility test sequence.");
4156+
LOG_TR1("Sending xterm compatibility test sequence.");
41524157
// Do this in the third row. Second row is used by ambiguous
41534158
// character width check.
41544159
term_windgoto(2, 0);
@@ -4199,7 +4204,7 @@ may_req_bg_color(void)
41994204
if (rfg_status.tr_progress == STATUS_GET && *T_RFG != NUL)
42004205
{
42014206
MAY_WANT_TO_LOG_THIS;
4202-
LOG_TR("Sending FG request");
4207+
LOG_TR1("Sending FG request");
42034208
out_str(T_RFG);
42044209
termrequest_sent(&rfg_status);
42054210
didit = TRUE;
@@ -4210,7 +4215,7 @@ may_req_bg_color(void)
42104215
if (rbg_status.tr_progress == STATUS_GET && *T_RBG != NUL)
42114216
{
42124217
MAY_WANT_TO_LOG_THIS;
4213-
LOG_TR("Sending BG request");
4218+
LOG_TR1("Sending BG request");
42144219
out_str(T_RBG);
42154220
termrequest_sent(&rbg_status);
42164221
didit = TRUE;
@@ -4828,7 +4833,7 @@ switch_to_8bit(void)
48284833
need_gather = TRUE; // need to fill termleader[]
48294834
}
48304835
detected_8bit = TRUE;
4831-
LOG_TR("Switching to 8 bit");
4836+
LOG_TR1("Switching to 8 bit");
48324837
}
48334838

48344839
#ifdef CHECK_DOUBLE_CLICK
@@ -4981,7 +4986,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
49814986
{
49824987
char *aw = NULL;
49834988

4984-
LOG_TR("Received U7 status: %s", tp);
4989+
LOG_TRN("Received U7 status: %s", tp);
49854990
u7_status.tr_progress = STATUS_GOT;
49864991
did_cursorhold = TRUE;
49874992
if (arg[1] == 2)
@@ -4998,7 +5003,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
49985003
{
49995004
int r = redraw_asap(UPD_CLEAR);
50005005

5001-
LOG_TR("set 'ambiwidth', redraw_asap(): %d", r);
5006+
LOG_TRN("set 'ambiwidth', redraw_asap(): %d", r);
50025007
}
50035008
#else
50045009
redraw_asap(UPD_CLEAR);
@@ -5014,7 +5019,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
50145019
{
50155020
int value;
50165021

5017-
LOG_TR("Received compatibility test result: %s", tp);
5022+
LOG_TRN("Received compatibility test result: %s", tp);
50185023
xcc_status.tr_progress = STATUS_GOT;
50195024

50205025
// Third row: xterm compatibility test.
@@ -5038,7 +5043,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
50385043
// version.
50395044
int version = arg[1];
50405045

5041-
LOG_TR("Received CRV response: %s", tp);
5046+
LOG_TRN("Received CRV response: %s", tp);
50425047
crv_status.tr_progress = STATUS_GOT;
50435048
did_cursorhold = TRUE;
50445049

@@ -5081,7 +5086,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
50815086
// terminals the request should be ignored.
50825087
if (version >= 141 && p_xtermcodes)
50835088
{
5084-
LOG_TR("Enable checking for XT codes");
5089+
LOG_TR1("Enable checking for XT codes");
50855090
check_for_codes = TRUE;
50865091
need_gather = TRUE;
50875092
req_codes_from_term();
@@ -5251,7 +5256,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
52515256
&& *T_CRS != NUL)
52525257
{
52535258
MAY_WANT_TO_LOG_THIS;
5254-
LOG_TR("Sending cursor style request");
5259+
LOG_TR1("Sending cursor style request");
52555260
out_str(T_CRS);
52565261
termrequest_sent(&rcs_status);
52575262
need_flush = TRUE;
@@ -5266,7 +5271,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
52665271
&& *T_CRC != NUL)
52675272
{
52685273
MAY_WANT_TO_LOG_THIS;
5269-
LOG_TR("Sending cursor blink mode request");
5274+
LOG_TR1("Sending cursor blink mode request");
52705275
out_str(T_CRC);
52715276
termrequest_sent(&rbm_status);
52725277
need_flush = TRUE;
@@ -5638,7 +5643,7 @@ handle_csi(
56385643
{
56395644
initial_cursor_blink = (arg[1] == '1');
56405645
rbm_status.tr_progress = STATUS_GOT;
5641-
LOG_TR("Received cursor blinking mode response: %s", tp);
5646+
LOG_TRN("Received cursor blinking mode response: %s", tp);
56425647
key_name[0] = (int)KS_EXTRA;
56435648
key_name[1] = (int)KE_IGNORE;
56445649
*slen = csi_len;
@@ -5771,7 +5776,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
57715776
char *new_bg_val = (3 * '6' < *tp_r + *tp_g +
57725777
*tp_b) ? "light" : "dark";
57735778

5774-
LOG_TR("Received RBG response: %s", tp);
5779+
LOG_TRN("Received RBG response: %s", tp);
57755780
#ifdef FEAT_TERMRESPONSE
57765781
rbg_status.tr_progress = STATUS_GOT;
57775782
# ifdef FEAT_TERMINAL
@@ -5793,7 +5798,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
57935798
#if defined(FEAT_TERMRESPONSE) && defined(FEAT_TERMINAL)
57945799
else
57955800
{
5796-
LOG_TR("Received RFG response: %s", tp);
5801+
LOG_TRN("Received RFG response: %s", tp);
57975802
rfg_status.tr_progress = STATUS_GOT;
57985803
fg_r = rval;
57995804
fg_g = gval;
@@ -5816,7 +5821,7 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
58165821
}
58175822
if (i == len)
58185823
{
5819-
LOG_TR("not enough characters for RB");
5824+
LOG_TR1("not enough characters for RB");
58205825
return FAIL;
58215826
}
58225827
return OK;
@@ -5846,7 +5851,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
58465851
{
58475852
int i, j;
58485853

5849-
LOG_TR("Received DCS response: %s", (char*)tp);
5854+
LOG_TRN("Received DCS response: %s", (char*)tp);
58505855
j = 1 + (tp[0] == ESC);
58515856
if (len < j + 3)
58525857
i = len; // need more chars
@@ -5903,7 +5908,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
59035908
(number & 1) ? FALSE : TRUE;
59045909
rcs_status.tr_progress = STATUS_GOT;
59055910
#endif
5906-
LOG_TR("Received cursor shape response: %s", tp);
5911+
LOG_TRN("Received cursor shape response: %s", tp);
59075912

59085913
key_name[0] = (int)KS_EXTRA;
59095914
key_name[1] = (int)KE_IGNORE;
@@ -5922,7 +5927,7 @@ handle_dcs(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
59225927
{
59235928
// These codes arrive many together, each code can be
59245929
// truncated at any point.
5925-
LOG_TR("not enough characters for XT");
5930+
LOG_TR1("not enough characters for XT");
59265931
return FAIL;
59275932
}
59285933
return OK;
@@ -6274,7 +6279,7 @@ check_termcode(
62746279
{
62756280
#ifdef DEBUG_TERMRESPONSE
62766281
if (resp == -1)
6277-
LOG_TR("Not enough characters for CSI sequence");
6282+
LOG_TR1("Not enough characters for CSI sequence");
62786283
#endif
62796284
return resp;
62806285
}
@@ -6565,7 +6570,7 @@ check_termcode(
65656570
}
65666571

65676572
#ifdef FEAT_TERMRESPONSE
6568-
LOG_TR("normal character");
6573+
LOG_TR1("normal character");
65696574
#endif
65706575

65716576
return 0; // no match found
@@ -7107,7 +7112,7 @@ req_more_codes_from_term(void)
71077112
char *key_name = key_names[xt_index_out];
71087113

71097114
MAY_WANT_TO_LOG_THIS;
7110-
LOG_TR("Requesting XT %d: %s", xt_index_out, key_name);
7115+
LOG_TRN("Requesting XT %d: %s", xt_index_out, key_name);
71117116
if (key_name[2] != NUL)
71127117
sprintf(buf, "\033P+q%02x%02x%02x\033\\", key_name[0], key_name[1], key_name[2]);
71137118
else
@@ -7161,7 +7166,7 @@ got_code_from_term(char_u *code, int len)
71617166
}
71627167
}
71637168

7164-
LOG_TR("Received XT %d: %s", xt_index_in, (char *)name);
7169+
LOG_TRN("Received XT %d: %s", xt_index_in, (char *)name);
71657170

71667171
if (key_names[i] != NULL)
71677172
{

src/testdir/test_window_cmd.vim

+12
Original file line numberDiff line numberDiff line change
@@ -1979,6 +1979,18 @@ func Test_splitkeep_misc()
19791979
set splitkeep&
19801980
endfunc
19811981

1982+
func Test_splitkeep_screen_cursor_pos()
1983+
new
1984+
set splitkeep=screen
1985+
call setline(1, ["longer than the last", "shorter"])
1986+
norm! $
1987+
wincmd s
1988+
close
1989+
call assert_equal([0, 1, 20, 0], getpos('.'))
1990+
%bwipeout!
1991+
set splitkeep&
1992+
endfunc
1993+
19821994
func Test_splitkeep_cursor()
19831995
CheckScreendump
19841996
let lines =<< trim END

src/version.c

+4
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,10 @@ static char *(features[]) =
709709

710710
static int included_patches[] =
711711
{ /* Add new patch number below this line */
712+
/**/
713+
1238,
714+
/**/
715+
1237,
712716
/**/
713717
1236,
714718
/**/

src/window.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -7048,7 +7048,7 @@ win_fix_scroll(int resize)
70487048
{
70497049
int diff = (wp->w_winrow - wp->w_prev_winrow)
70507050
+ (wp->w_height - wp->w_prev_height);
7051-
linenr_T lnum = wp->w_cursor.lnum;
7051+
pos_T cursor = wp->w_cursor;
70527052
wp->w_cursor.lnum = wp->w_botline - 1;
70537053

70547054
// Add difference in height and row to botline.
@@ -7062,7 +7062,8 @@ win_fix_scroll(int resize)
70627062
wp->w_fraction = FRACTION_MULT;
70637063
scroll_to_fraction(wp, wp->w_prev_height);
70647064

7065-
wp->w_cursor.lnum = lnum;
7065+
wp->w_cursor = cursor;
7066+
wp->w_valid &= ~VALID_WCOL;
70667067
}
70677068
else if (wp == curwin)
70687069
wp->w_valid &= ~VALID_CROW;

0 commit comments

Comments
 (0)