File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4841,19 +4841,23 @@ var2fpos(
48414841 pos .lnum = list_find_nr (l , 0L , & error );
48424842 if (error || pos .lnum <= 0 || pos .lnum > curbuf -> b_ml .ml_line_count )
48434843 return NULL ; // invalid line number
4844-
4845- // Get the column number
4846- pos .col = list_find_nr (l , 1L , & error );
4847- if (error )
4848- return NULL ;
48494844 len = (long )STRLEN (ml_get (pos .lnum ));
48504845
4846+ // Get the column number
48514847 // We accept "$" for the column number: last column.
48524848 li = list_find (l , 1L );
48534849 if (li != NULL && li -> li_tv .v_type == VAR_STRING
48544850 && li -> li_tv .vval .v_string != NULL
48554851 && STRCMP (li -> li_tv .vval .v_string , "$" ) == 0 )
4852+ {
48564853 pos .col = len + 1 ;
4854+ }
4855+ else
4856+ {
4857+ pos .col = list_find_nr (l , 1L , & error );
4858+ if (error )
4859+ return NULL ;
4860+ }
48574861
48584862 // Accept a position up to the NUL after the line.
48594863 if (pos .col == 0 || (int )pos .col > len + 1 )
Original file line number Diff line number Diff line change @@ -1320,6 +1320,12 @@ def Test_bufnr()
13201320 assert_equal (buf , bufnr (' %' ))
13211321enddef
13221322
1323+ def Test_col ()
1324+ new
1325+ setline (1 , ' asdf' )
1326+ assert_equal (5 , col ([1 , ' $' ]))
1327+ enddef
1328+
13231329def Test_getreg_return_type ()
13241330 let s1: string = getreg (' "' )
13251331 let s2: string = getreg (' "' , 1 )
Original file line number Diff line number Diff line change @@ -754,6 +754,8 @@ static char *(features[]) =
754754
755755static int included_patches [] =
756756{ /* Add new patch number below this line */
757+ /**/
758+ 1499 ,
757759/**/
758760 1498 ,
759761/**/
You can’t perform that action at this time.
0 commit comments