apommel / vscode-matlab-interactive-terminal

VS Code extension allowing for an interactive Matlab terminal and launching of scripts through Matlab Engine for Python
MIT License
46 stars 9 forks source link

runMatlabSelection doesn't work with arrays defined in multiple lines (Windows) #3

Closed agutieda closed 4 years ago

agutieda commented 4 years ago

Highlighting an array defined in several lines and using runMatlabSelection throws an error. As an example, running the following lines works in the Matlab editor but not with the interactive terminal in vscode:

A = [
    1, 2
    3, 4
    ];

I suspect this may have something to due with the lack of bracketed paste mode for the Windows terminal.

apommel commented 4 years ago

Hello, indeed this is due to the fact that when a selection is run, every line is processed independently. The easy solution would be to save the selection in a temporary file (it is already done this way when no terminal are opened). I will try to think about what would be best.

apommel commented 4 years ago

This is fixed in the latest release by using temporary files. It is not a 100% satisfactory solution so I may think about a redesign of the extension to solve this issue, along with a few others, more efficiently.

agutieda commented 4 years ago

Thank you!