Skip to content

Commit 7035fd9

Browse files
committed
patch 8.2.0532: cannot use simplify() as a method
Problem: Cannot use simplify() as a method. Solution: Add FEARG_1. (closes #5996)
1 parent 476a613 commit 7035fd9

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

runtime/doc/eval.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9024,6 +9024,8 @@ simplify({filename}) *simplify()*
90249024
directory. In order to resolve all the involved symbolic
90259025
links before simplifying the path name, use |resolve()|.
90269026

9027+
Can also be used as a |method|: >
9028+
GetName()->simplify()
90279029
90289030
sin({expr}) *sin()*
90299031
Return the sine of {expr}, measured in radians, as a |Float|.

src/evalfunc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ static funcentry_T global_functions[] =
837837
{"sign_undefine", 0, 1, FEARG_1, ret_number, SIGN_FUNC(f_sign_undefine)},
838838
{"sign_unplace", 1, 2, FEARG_1, ret_number, SIGN_FUNC(f_sign_unplace)},
839839
{"sign_unplacelist", 1, 2, FEARG_1, ret_list_number, SIGN_FUNC(f_sign_unplacelist)},
840-
{"simplify", 1, 1, 0, ret_string, f_simplify},
840+
{"simplify", 1, 1, FEARG_1, ret_string, f_simplify},
841841
{"sin", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sin)},
842842
{"sinh", 1, 1, FEARG_1, ret_float, FLOAT_FUNC(f_sinh)},
843843
{"sort", 1, 3, FEARG_1, ret_list_any, f_sort},

src/testdir/test_functions.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func Test_simplify()
450450
call assert_equal('/', simplify('/.'))
451451
call assert_equal('/', simplify('/..'))
452452
call assert_equal('/...', simplify('/...'))
453-
call assert_equal('./dir/file', simplify('./dir/file'))
453+
call assert_equal('./dir/file', './dir/file'->simplify())
454454
call assert_equal('./dir/file', simplify('.///dir//file'))
455455
call assert_equal('./dir/file', simplify('./dir/./file'))
456456
call assert_equal('./file', simplify('./dir/../file'))

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
532,
741743
/**/
742744
531,
743745
/**/

0 commit comments

Comments
 (0)