diff src/evalvars.c @ 25232:346002a63bc6 v8.2.3152

patch 8.2.3152: Vim9: accessing "s:" results in an error Commit: https://github.com/vim/vim/commit/11005b078d2485a306c74f77c9dd158fdd7f3cbe Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 11 20:59:00 2021 +0200 patch 8.2.3152: Vim9: accessing "s:" results in an error Problem: Vim9: accessing "s:" results in an error. Solution: Do not try to lookup a script variable for "s:". (closes https://github.com/vim/vim/issues/8549)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jul 2021 21:00:04 +0200
parents 0a3b1c66d3f2
children 29191571eceb
line wrap: on
line diff
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -2660,7 +2660,8 @@ eval_variable(
 	}
 	else if (rettv != NULL)
 	{
-	    if (ht != NULL && ht == get_script_local_ht())
+	    if (ht != NULL && ht == get_script_local_ht()
+		    && tv != &SCRIPT_SV(current_sctx.sc_sid)->sv_var.di_tv)
 	    {
 		svar_T *sv = find_typval_in_script(tv);