Skip to content

Commit de1949d

Browse files
committed
updated for version 7.3.748
Problem: Cannot properly test conceal mode. Solution: Add the screencol() and screenrow() functions. Use them in test88. (Simon Ruderich)
1 parent 4c297d4 commit de1949d

File tree

13 files changed

+171
-8
lines changed

13 files changed

+171
-8
lines changed

runtime/doc/eval.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,8 @@ repeat( {expr}, {count}) String repeat {expr} {count} times
19031903
resolve( {filename}) String get filename a shortcut points to
19041904
reverse( {list}) List reverse {list} in-place
19051905
round( {expr}) Float round off {expr}
1906+
screencol() Number current cursor column
1907+
screenrow() Number current cursor row
19061908
search( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
19071909
Number search for {pattern}
19081910
searchdecl( {name} [, {global} [, {thisblock}]])

src/eval.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,8 @@ static void f_reverse __ARGS((typval_T *argvars, typval_T *rettv));
668668
#ifdef FEAT_FLOAT
669669
static void f_round __ARGS((typval_T *argvars, typval_T *rettv));
670670
#endif
671+
static void f_screencol __ARGS((typval_T *argvars, typval_T *rettv));
672+
static void f_screenrow __ARGS((typval_T *argvars, typval_T *rettv));
671673
static void f_search __ARGS((typval_T *argvars, typval_T *rettv));
672674
static void f_searchdecl __ARGS((typval_T *argvars, typval_T *rettv));
673675
static void f_searchpair __ARGS((typval_T *argvars, typval_T *rettv));
@@ -8033,6 +8035,8 @@ static struct fst
80338035
#ifdef FEAT_FLOAT
80348036
{"round", 1, 1, f_round},
80358037
#endif
8038+
{"screencol", 0, 0, f_screencol},
8039+
{"screenrow", 0, 0, f_screenrow},
80368040
{"search", 1, 4, f_search},
80378041
{"searchdecl", 1, 3, f_searchdecl},
80388042
{"searchpair", 3, 7, f_searchpair},
@@ -15724,6 +15728,30 @@ f_round(argvars, rettv)
1572415728
}
1572515729
#endif
1572615730

15731+
/*
15732+
* "screencol()" function
15733+
*
15734+
* First column is 1 to be consistent with virtcol().
15735+
*/
15736+
static void
15737+
f_screencol(argvars, rettv)
15738+
typval_T *argvars UNUSED;
15739+
typval_T *rettv;
15740+
{
15741+
rettv->vval.v_number = screen_screencol() + 1;
15742+
}
15743+
15744+
/*
15745+
* "screenrow()" function
15746+
*/
15747+
static void
15748+
f_screenrow(argvars, rettv)
15749+
typval_T *argvars UNUSED;
15750+
typval_T *rettv;
15751+
{
15752+
rettv->vval.v_number = screen_screenrow() + 1;
15753+
}
15754+
1572715755
/*
1572815756
* "search()" function
1572915757
*/

src/proto/screen.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,6 @@ int redrawing __ARGS((void));
5050
int messaging __ARGS((void));
5151
void showruler __ARGS((int always));
5252
int number_width __ARGS((win_T *wp));
53+
int screen_screencol __ARGS((void));
54+
int screen_screenrow __ARGS((void));
5355
/* vim: set ft=c : */

src/screen.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10264,3 +10264,23 @@ number_width(wp)
1026410264
return n;
1026510265
}
1026610266
#endif
10267+
10268+
/*
10269+
* Return the current cursor column. This is the actual position on the
10270+
* screen. First column is 0.
10271+
*/
10272+
int
10273+
screen_screencol()
10274+
{
10275+
return screen_cur_col;
10276+
}
10277+
10278+
/*
10279+
* Return the current cursor row. This is the actual position on the screen.
10280+
* First row is 0.
10281+
*/
10282+
int
10283+
screen_screenrow()
10284+
{
10285+
return screen_cur_row;
10286+
}

src/testdir/Make_amiga.mak

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
3131
test66.out test67.out test68.out test69.out test70.out \
3232
test71.out test72.out test73.out test74.out test75.out \
3333
test76.out test77.out test78.out test79.out test80.out \
34-
test81.out test82.out test83.out test84.out
34+
test81.out test82.out test83.out test84.out test88.out
3535

3636
.SUFFIXES: .in .out
3737

@@ -135,3 +135,4 @@ test81.out: test81.in
135135
test82.out: test82.in
136136
test83.out: test83.in
137137
test84.out: test84.in
138+
test88.out: test88.in

src/testdir/Make_dos.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
3030
test68.out test69.out test71.out test72.out test73.out \
3131
test74.out test75.out test76.out test77.out test78.out \
3232
test79.out test80.out test81.out test82.out test83.out \
33-
test84.out test85.out test86.out test87.out
33+
test84.out test85.out test86.out test87.out test88.out
3434

3535
SCRIPTS32 = test50.out test70.out
3636

src/testdir/Make_ming.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
5050
test68.out test69.out test71.out test72.out test73.out \
5151
test74.out test75.out test76.out test77.out test78.out \
5252
test79.out test80.out test81.out test82.out test83.out \
53-
test84.out test85.out test86.out test87.out
53+
test84.out test85.out test86.out test87.out test88.out
5454

5555
SCRIPTS32 = test50.out test70.out
5656

src/testdir/Make_os2.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
3131
test66.out test67.out test68.out test69.out test70.out \
3232
test71.out test72.out test73.out test74.out test75.out \
3333
test76.out test77.out test78.out test79.out test80.out \
34-
test81.out test82.out test83.out test84.out
34+
test81.out test82.out test83.out test84.out test88.out
3535

3636
.SUFFIXES: .in .out
3737

src/testdir/Make_vms.mms

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Authors: Zoltan Arpadffy, <[email protected]>
55
# Sandor Kopanyi, <[email protected]>
66
#
7-
# Last change: 2012 Oct 06
7+
# Last change: 2012 Dec 05
88
#
99
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
1010
# Edit the lines in the Configuration section below to select.
@@ -76,7 +76,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
7676
test66.out test67.out test68.out test69.out \
7777
test71.out test72.out test74.out test75.out test76.out \
7878
test77.out test78.out test79.out test80.out test81.out \
79-
test82.out test83.out test84.out
79+
test82.out test83.out test84.out test88.out
8080

8181
# Known problems:
8282
# Test 30: a problem around mac format - unknown reason

src/testdir/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ VIMPROG = ../vim
1313

1414
SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
1515
test7.out test8.out test9.out test10.out test11.out \
16-
test12.out test13.out test14.out test15.out test17.out \
16+
test12.out test13.out test14.out test15.out test17.out \
1717
test18.out test19.out test20.out test21.out test22.out \
1818
test23.out test24.out test25.out test26.out test27.out \
1919
test28.out test29.out test30.out test31.out test32.out \
@@ -27,7 +27,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
2727
test69.out test70.out test71.out test72.out test73.out \
2828
test74.out test75.out test76.out test77.out test78.out \
2929
test79.out test80.out test81.out test82.out test83.out \
30-
test84.out test85.out test86.out test87.out
30+
test84.out test85.out test86.out test87.out test88.out
3131

3232
SCRIPTS_GUI = test16.out
3333

0 commit comments

Comments
 (0)