The variables added to the variable model have empty strings as values. Reproducible: Always Steps to Reproduce: 1. create a row vector a=[1 2 3] or a column vector b=[1;2;3] and observe the changes on the variable model. Looks like the line breaks at the beginning and at the end of octave's output string are not handled correctly in Cantor. 2. this problem also exists for large vectors where pagination is used to display the elements. To see this, create a vector for example with big_vector=1:100 2. 3.
This behaviour is caused by changes in Octave output. Cantor fills the variable management widget using the Octave outputs in OctaveExpression::finalize function. When you type for instance 'x = 2', the output is 'x = 2\n' so the current logic in that Cantor function can get the variable and the value. But the command for creation of a vector, like 'x = [1 2 3]' the output is 'x=\n\n1 2 3\n\n', it is different from the previous pattern of Octave outputs. This bug is related with #363445. I am thinking in a new way to get the variables correctly.
would a simple replacing of all occurrences of '\n' with '' and doing the extraction of the variable value after that help here?
(In reply to Alexander Semke from comment #2) > would a simple replacing of all occurrences of '\n' with '' and doing the > extraction of the variable value after that help here? Yes, it fix this bug but not the #363445 bug. I am thinking in a way to solve both, if it not possible for the moment maybe I can to use the replacement of '\n'.
Git commit 1a0043d3ddf905f54f8e706d2f793d55f034e3d5 by Filipe Saraiva. Committed on 28/01/2017 at 14:05. Pushed by filipesaraiva into branch 'master'. Parse correctly the vector/list output of Octave backend to variable management widget M +1 -1 src/backends/octave/octaveexpression.cpp https://commits.kde.org/cantor/1a0043d3ddf905f54f8e706d2f793d55f034e3d5
Hi asemke, I am using the workaround to fix it. Unfortunately it will be very hard to fix this bug together with bug #363445. Please, if you find some errors with this approach reopen this bug report.