Mercurial > vim
comparison src/vim9execute.c @ 25541:2ae1d5a4ae5c v8.2.3307
patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Commit: https://github.com/vim/vim/commit/7de62623735d228c8f81f6ac8309fe4922822cb2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 7 15:05:47 2021 +0200
patch 8.2.3307: Vim9: :echoconsole cannot access local variables
Problem: Vim9: :echoconsole cannot access local variables.
Solution: Handle like other :echo commands. (closes https://github.com/vim/vim/issues/8708)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 07 Aug 2021 15:15:02 +0200 |
parents | df39041f13ed |
children | a84e75d73fde |
comparison
equal
deleted
inserted
replaced
25540:94ba2bb5b357 | 25541:2ae1d5a4ae5c |
---|---|
1867 } | 1867 } |
1868 break; | 1868 break; |
1869 | 1869 |
1870 // :execute {string} ... | 1870 // :execute {string} ... |
1871 // :echomsg {string} ... | 1871 // :echomsg {string} ... |
1872 // :echoconsole {string} ... | |
1872 // :echoerr {string} ... | 1873 // :echoerr {string} ... |
1873 case ISN_EXECUTE: | 1874 case ISN_EXECUTE: |
1874 case ISN_ECHOMSG: | 1875 case ISN_ECHOMSG: |
1876 case ISN_ECHOCONSOLE: | |
1875 case ISN_ECHOERR: | 1877 case ISN_ECHOERR: |
1876 { | 1878 { |
1877 int count = iptr->isn_arg.number; | 1879 int count = iptr->isn_arg.number; |
1878 garray_T ga; | 1880 garray_T ga; |
1879 char_u buf[NUMBUFLEN]; | 1881 char_u buf[NUMBUFLEN]; |
1938 msg_sb_eol(); | 1940 msg_sb_eol(); |
1939 if (iptr->isn_type == ISN_ECHOMSG) | 1941 if (iptr->isn_type == ISN_ECHOMSG) |
1940 { | 1942 { |
1941 msg_attr(ga.ga_data, echo_attr); | 1943 msg_attr(ga.ga_data, echo_attr); |
1942 out_flush(); | 1944 out_flush(); |
1945 } | |
1946 else if (iptr->isn_type == ISN_ECHOCONSOLE) | |
1947 { | |
1948 ui_write(ga.ga_data, (int)STRLEN(ga.ga_data), | |
1949 TRUE); | |
1950 ui_write((char_u *)"\r\n", 2, TRUE); | |
1943 } | 1951 } |
1944 else | 1952 else |
1945 { | 1953 { |
1946 SOURCING_LNUM = iptr->isn_lnum; | 1954 SOURCING_LNUM = iptr->isn_lnum; |
1947 emsg(ga.ga_data); | 1955 emsg(ga.ga_data); |
4898 echo->echo_count); | 4906 echo->echo_count); |
4899 } | 4907 } |
4900 break; | 4908 break; |
4901 case ISN_EXECUTE: | 4909 case ISN_EXECUTE: |
4902 smsg("%s%4d EXECUTE %lld", pfx, current, | 4910 smsg("%s%4d EXECUTE %lld", pfx, current, |
4903 (varnumber_T)(iptr->isn_arg.number)); | 4911 (varnumber_T)(iptr->isn_arg.number)); |
4904 break; | 4912 break; |
4905 case ISN_ECHOMSG: | 4913 case ISN_ECHOMSG: |
4906 smsg("%s%4d ECHOMSG %lld", pfx, current, | 4914 smsg("%s%4d ECHOMSG %lld", pfx, current, |
4907 (varnumber_T)(iptr->isn_arg.number)); | 4915 (varnumber_T)(iptr->isn_arg.number)); |
4916 break; | |
4917 case ISN_ECHOCONSOLE: | |
4918 smsg("%s%4d ECHOCONSOLE %lld", pfx, current, | |
4919 (varnumber_T)(iptr->isn_arg.number)); | |
4908 break; | 4920 break; |
4909 case ISN_ECHOERR: | 4921 case ISN_ECHOERR: |
4910 smsg("%s%4d ECHOERR %lld", pfx, current, | 4922 smsg("%s%4d ECHOERR %lld", pfx, current, |
4911 (varnumber_T)(iptr->isn_arg.number)); | 4923 (varnumber_T)(iptr->isn_arg.number)); |
4912 break; | 4924 break; |
4913 case ISN_LOAD: | 4925 case ISN_LOAD: |
4914 { | 4926 { |
4915 if (iptr->isn_arg.number < 0) | 4927 if (iptr->isn_arg.number < 0) |
4916 smsg("%s%4d LOAD arg[%lld]", pfx, current, | 4928 smsg("%s%4d LOAD arg[%lld]", pfx, current, |