patchGNU Octave - Patches: patch #8656, Variable Editor (expanded from...


patch #8656: Variable Editor (expanded from Patch #8316)

Submitter:  None
Submitted:  Tue 14 Apr 2015 10:10:44 AM UTC
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment (Rich Markup)

Comment Type & Canned Response:


( Jump to the original submission )

Wed 23 Aug 2017 07:35:43 AM UTC, comment #58: 

(As to the initial pane position, I didn't note it was deviant, probably because my already existing qt-settings file takes care of another more useful initial position.)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 22 Aug 2017 06:35:04 PM UTC, comment #57: 

Thanks for pushing this, John.

I think the things you mention already work, so no worries there:

  • Right-clicking a variable in the workspace pane and selecting "open in variable Editor" will show the Variable Editor pane and open a tab inside it with the matrix or variable.
  • Alternatively, the command "openvar <variable name>" will do the same.

The things that need fixing have been mentioned in comment #45 - comment #47.
In addition the "Autofit column width" setting is slow (see comment #39).
Copy/paste from external programs also has deficiencies (only works in Linux, and AFAICS pasting works transposed).

OK, nice, I'm very glad this has been included in core :-)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 22 Aug 2017 03:09:45 PM UTC, comment #56: 

I made a few more changes, added a commit message, and pushed the patch here:

I did this rather than waiting until the patch is "perfect" because in my experience, waiting for that will mean that the patch will never be pushed.

For me, the most obvious thing that needs to be fixed is to bring up the widget as a tab along with the command, editor, and doc browser windows, but I don't know how to do that.

I'm going to close this patch as done.  Additional work can be tracked on the bug tracker or maintainers mailing list.

Thanks to everyone who contributed to this new feature!

John W. Eaton <jwe>
Project Administrator
Fri 14 Jul 2017 06:19:58 PM UTC, comment #55: 

John, just to verify, your new patch (file #41199) builds & cross-builds and works fine in Linux and Windows.

I checked the pointer styles and AFAICS they're already compliant.

There's just one mention if "if error_state" in the hunk. I'll leave it to someone else to change that, it's beyond me :-(  hopefully the fix will enlighten me.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 13 Jul 2017 03:25:33 PM UTC, comment #54: 

The patch I attached yesterday was missing the four new files in libgui/src.  This version includes them.

(file #41199)

John W. Eaton <jwe>
Project Administrator
Wed 12 Jul 2017 08:00:24 PM UTC, comment #53: 

Yes, I'd like to get this feature included in the development version soon.

John W. Eaton <jwe>
Project Administrator
Wed 12 Jul 2017 07:24:23 PM UTC, comment #52: 

Hey John that is very kind of you.... Thank you very much.

Does your attention for this patch mean that you may want to include it in the development version at some time in the near future? That would be great.

I did already update the patch locally to the 4.3.0+ state of last weekend but on Tuesday I hit new liboctave/util/action-container.h changes that needed a bit more attention than the 30 minutes or so I usually have available on weekday evenings. So you have fixed those, great.

As to comment #50 (that's where I mentioned the pointer style / error catching style changes, not comment #49), I wrote they are still lacking.
Yet I did change just a few pointer style occurrences (a la the changes that Rik made). I think a clever search/replace would fix the rest -  AFAIU Rik did the same thing.

As to error catching (the code/style changes you made 1 - 1.5 years ago): I'm too unsure about my C++ skills to pursue that. But I think there aren't that many occurrences of that in the patch.

The patch by Michael Barnes (I just kept it compatible with dev Octave) still needs attention.
Copy/paste from external programs (e.g., LibreOffice) only works on Linux and is transposed; and maybe even limited to a 2xN or Nx2 size array, I'm unsure.
The option to automatically adapt column width to variable size should be removed - Octave will take ages to calculate the optimum column width for each change in the variable.
Character strings are shown as char arrays.
And I've been searching for a place to assess the class of the variables-to-be-shown to be able to avoid structs, Java and classdef objects for the time being (as they won't work or even hang or crash Octave when opened in the variable editor).

Philip Nienhuis <philipnienhuis>
Project Member
Wed 12 Jul 2017 06:51:47 PM UTC, comment #51: 

Patch updated to Octave HG ID 293dec495256.

Philip, where are the changes for error catching and pointer style that you mention in comment #49?

(file #41193)

John W. Eaton <jwe>
Project Administrator
Mon 22 May 2017 12:41:51 PM UTC, comment #50: 

Again updated patch that applies to & works with dev as of May 19, 2017.

This patch lacks various updates from the last year:
- error catching
- pointer style

(file #40754)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 13 Jul 2016 09:23:30 PM UTC, comment #49: 

Updated patch that applies with a few fuzz lines to dev Octave hg id 4e770056f74a "don't attempt to access intepreter before it is ready (bug #48494)"

(file #37863)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 22 Mar 2016 06:04:13 PM UTC, comment #48: 

Attached is a cset from January, based on Michael Barnes' patches, that still applies to dev Octave.

It has all the shortcomings mentioned in the comments below, BUT OTOH I find it a very useful add-on for Octave and I use it quite often.

(file #36726)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 14 Oct 2015 12:56:44 PM UTC, comment #47: 

As I said in the maintainers ML I've experimented with classdef and Java objects in Matlab's variable editor. The attached pics give some examples.

Java objects are just shown as such, Java arrays cannot be explored deeper (like double-clicking on individual cells like with cell arrays etc.).

Classdef stuff in the variable editor is treated similarly to structs (as expected; at low level they are -special- structs AFAICS).
For this example I used the first "mydate" example code from

Philip Nienhuis <philipnienhuis>
Project Member
Thu 08 Oct 2015 06:28:28 PM UTC, comment #46: 

Yep works fine.
I also see that clicking on a struct (or struct array) shows a (series of) cell(s) with "1x1 struct". I don't remember if this already worked that way but it looks good.

Some other things (on top of the already long laundry list):

1. Every time I change some variable value of some variable that is NOT in the variable editor, the variable editor pane flashes. So there's apparently some unnecessary overhead behind the scenes.  This has been so for a long time.

2. I tried it on a Java object and that worked out adversely:

f = javaObject ("java.lang.Double", 6.5)
    <open in Variable Editor>
     ==> an infinite list of repeating errors:
error: [java] java.lang.IllegalArgumentException: not a Java array
error: [java] java.lang.IllegalArgumentException: not a Java array
error: [java] java.lang.IllegalArgumentException: not a Java array
error: [java] java.lang.IllegalArgumentException: not a Java array

This also happens when I do something with the Java object and the variable editor is shown with other variables - it looks related to 1. above.  The variable editor apparently queries the workspace and hits the Java object somehow.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 08 Oct 2015 04:55:26 PM UTC, comment #45: 

You're quick :-)
I'll try right away

BTW in the last weeks it occurred to me that it's not only structs that don't work (yet) - also Java objects and any Octave objects (incl. classdef) fail. Same for stuff like graphics handles.
Maybe all of those need to be catched (in openvar?) as long as they don't work before the VarEd attempts to display them.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 08 Oct 2015 03:20:43 PM UTC, comment #44: 

Yeah, I don't like the 2d char array interface even in Matlab.

Still, here you go. They now work similarly to Matlab. Getting the hang of this a bit.


(file #35103)

Wed 07 Oct 2015 05:57:46 PM UTC, comment #43: 

char strings go fine; char arrays less so:

> b = {"thisisatext"; "anothertext"}
b =
  [1,1] = thisisatext
  [2,1] = anothertext
>> cell2mat (b)
ans =


>> class (ans)
ans = char

gives the attached pic.
Char arrays aren't used that much AFAIK so maybe no big deal.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 07 Oct 2015 02:57:38 PM UTC, comment #42: 

I may actually have strings working in one cell now.

I hate the hackery of this update but if it works and all...


(file #35094)

Wed 26 Aug 2015 05:35:14 PM UTC, comment #41: 

My pleasure. Actually I was a bit afraid you'd be put off by all my comments :-)

I'm very happy to have a variable editor available => makes debugging my scripts and functions a LOT easier. So I'm happy to test (& comment) further as well.

As to the MXE build instructions, that has changed a little nowadays (the "octave" target should rather be "default-octave" and I've hit a few other glitches). I usually build mxe-octave once and then use it for a month or so building just new Octave versions with the prebuilt dependencies. Each new mxe-octave "cycle" seems to bring its own issues (now ~familiar to me but maybe harder to overcome for newbies).
Copying to the wiki could be easy but I have other priorities :-)

Would you agree to bring up the variable editor development in the maintainers ML? Other devs could "interfere" then (it wouldn't be your baby anymore) but development could be more rapid.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 26 Aug 2015 07:00:39 AM UTC, comment #40: 

Once I have this latest work panic under control I'll investigate other ways to autofit. Certainly I can probably optimise in the case of fixed-width fonts.

Thanks very much for the windows build, and for your comments here which helped even more. Maybe something like that should be in the wiki?


Tue 25 Aug 2015 08:29:50 PM UTC, comment #39: 

(Obviously in hindsight) it turns out that the "Autofit" setting causes the long delay when updating the VarEd pane. So that setting may not be a good idea after all.
Just a user-specified but otherwise fixed column width + row height setting would do. The row height setting works perfectly

Philip Nienhuis <philipnienhuis>
Project Member
Mon 24 Aug 2015 05:55:03 PM UTC, comment #38: 

Turns out the variable editor can be awfully slow. Displaying a 120x400 matrix ("a = rand (120, 400)") takes ~3 minutes (on Linux) or 10 minutes (Windows) before the command line pane prompt responds again.

"tic ; openvar ('a') ; toc" is deceptive as it returns immediately but the variable editor keeps the prompt until it is completely finished.

Could it be that it renders the entire matrix beyond the window limits?

Philip Nienhuis <philipnienhuis>
Project Member
Sun 23 Aug 2015 01:00:11 PM UTC, comment #37: 

I had time to compare a few things with Matlab (r2015b prerelease).

Clearing a cell in a cell array sets the cell to empty
Sets cell contents to numeric zero

shows a text string as a string in one cell
shows it as a an array of chars


a = {1 {'TL', 'TR'; 'BL', 'BR'}; 'text', [10, 20 25 35 45; 30 40 45 55 65]}

shows the nested cell array as "2x2 cell" (w/o double quotes);
shows numeric array as far as it fits (truncates contents)
shows cell contents
shows numeric array as far as it fits (truncates contents) - Good!

a = struct ('b', 'field1')
a.c = [1 2; 3 4]
a.d = {1, 'text'; [10 20], {'TL', 'TR'; 'BL', 'BR'}}

gives the output of struct1.png (attached)

a(2).b = 'field2'

gives struct2.png
Double-clicking field a(1).d (~cell 1, 3) gives struct3.png

So maybe maybe (but obviously you know it better) displaying structs doesn't have to be that difficult and could be fairly straightforward.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 21 Aug 2015 04:08:01 PM UTC, comment #36: 

(line wrap!)
there's an Octave binary for Win64 with unstripped exe's & octave libs + an msys shell + your latest patch of comment #33. I think you can run Octave from that shell using something along the lines of 'gdb octave-gui' (at least, that's how it works here).
Note that only the Octave exe's + libs are unstripped - took me a bit of hacking to make an nsis-installer for that, normally either everything or nothing (incl. dependencies) is stripped.

AFAICS this Octave runs fine on my Windoze 7 64b Prof box.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 21 Aug 2015 12:09:53 PM UTC, comment #35: 

First of all: thanks for your prolonged efforts.
I think it might be about time to bring it up on the maintainers ML for polling interest on inclusion in the next dev version. Would you agree?

As to the long variable name, I think I saw that on Windows.

As regards my remark in comment #31:
For uniform character arrays and cellstr arrays, I think quotes do not need to be shown around char variables in cells. That would only be required for mixed numeric/char cell arrays (e.g.,  {uint32(1), "1"}).
I. m aware that editing individual cells (individual characters) would require some attention then as quotes wouldn't be required in char/cellstr arrays but are needed in mixed-type arrays.
(My main motive here is that I'd like to limit use of screen space for redundant info, e.g., lots of double quotes in char strings.)

Below are some findings with the new patch on Linux (64b Mageia-4) where I could quickly build & test (Windows will take longer). I think most of it is small things:

For variables already shown in Variable Editor, "apply"-ing the default row height setting doesn't work, nor does "Plus font height" setting, Closing the tab + renewed "open in variable editor" works fine though.

The "By Column | Uniform" Autofit preference neither works on row height (or I overlooked/missed the effect), nor is this setting persistent - the Variable Editor prefs pane always comes up with "By Column".

"Use terminal font" could be grayed out if it is unchecked (?)

The Toolbar size setting works perfectly.
(On Linux) 8 pt is really too small; 12 pt is like "Small" icon size in General tab, 24  matches "Normal", 32 matches "Large" icon size. Can this simply be linked to the General tab Icon size settings (also in the Preferences pane), please? If so this setting could be removed from the VarEd prefs pane.
I'll report later this weekend on how it looks on Windows.

Am I right to conclude that the row height setting applies to the space under the text? it looks like cell contents are consistently "top-adjusted" in cells.

Maybe nested cell contents had better be shown as "cell <dimensions>" within a Variable Editor cell, rather than attempting to display their contents. I suppose this will tackle the following issue (and perhaps could aid in making structs display in the V.E. easier as well):

Double clicking a nested cell array comprising just one cell doesn't work, steps to reproduce:

>> c = {1, 2; 3, {"text"}}

c =
  [1,1] =  1
  [2,1] =  3
  [1,2] =  2
  [2,2] =
    [1,1] = text

Now open c in variable editor and double-click cell (2, 2) =>

>> parse error:

  invalid constant left hand side of assignment

>>> {

  [1,1] = text

Compare with:

>> d = {1, 2; 3, {"text11", "text12"}}

d =
  [1,1] =  1
  [2,1] =  3
  [1,2] =  2
  [2,2] =
    [1,1] = text11
    [1,2] = text12

where double-clicking cell (2,2) just works fine.

Another issue:

a = {1 2; "text", [10, 20; 30 40]}

as first stmt after starting Octave with "Autofit" set to "Uniform", and then displaying variable a in the variable editor, Octave crashed consistently when double-clicking cell (2,2). However, later on I couldn't reproduce this anymore.

"Clear" in the context menu for cells in fact means "set to zero". I saw that when editing char strings: clearing one char sets it to 0. Same for numerical input and nested cell array contents.
This could be deceiving, at least merits some discussion IMO. Perhaps chars had better be reset to space rather than 0? or individual chars in a 1x<length> string, and individual cells in a cell array, should be cleared to "empty" (effectively be deleted). I'll check what Matlab does.

After entering 'a = {1 2; "text", [10, 20; 30 40]}' and opening a in the variable editor, then double-clicking cell a(2,2), a new tab opens with the 2x2 double array in a(2,2). Now, clearing a{2,2} in tab "a" doesn't update the other tab contents for a{2,2} - that only happens when displaying it in the command line terminal (by e.g., typing "a").

OK, 'nuff comments for now :-)

Later today I'll start an mxe Windows (cross)build + put it on Dropbox, when finished I'll post the link here.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 21 Aug 2015 07:34:08 AM UTC, comment #34: 

Thanks, I'll try the patch this weekend & answer your Q then too.

Did you use the binary I uploaded to my Dropbox? If so, did it meet your expectations?

My responses sometimes came a little late :-)  so I've added myself to the CC list (bottom page) as I never got update notifications on this patch report,

Philip Nienhuis <philipnienhuis>
Project Member
Wed 19 Aug 2015 12:05:30 PM UTC, comment #33: 

Thanks for that.

I have made some changes just for you. You can change default row height and also set it to change relative to font size. It defaults to 2 pixels taller than QFont::height() for the text  settings. You can also shrink the toolbar. I had no idea how big it defaulted to so the largest selectable size is massive at present, although the default is set to the current size.

When you say:

- sometimes has trouble showing and size on the pane.

Would this be long variable names, or something else?

(file #34679)

Sat 15 Aug 2015 03:27:49 PM UTC, comment #32: 

Hmm, I overlooked that your second incremental patch didn't apply due to a missing "_" between "table" and "color" in (copied it from Kompare so chances are it screwed up on my side).
So now alternating colors do work fine; sorry for the noise.

I'll send a link to an undated binary installer later tonight.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 14 Aug 2015 08:51:09 PM UTC, comment #31: 

(Hi Michael, nice to hear back from you)

Tried your latest patch:

- Applies cleanly to very recent development tip
- Alternating row colors item in prefs cannot be selected (grayed out)
- Row height is large IMO, could take less real estate. Autosize as well?
- Same for icons. I have been searching around where icon size is set in the other panes but haven't pinpointed it down (there's an icon size pref in the first General prefs tab).

The previous patch:
- shows character strings as char arrays (one char per cell)
- sometimes has trouble showing and size on the pane.

Anyway nice!

I have a Windows (cross-)build for 64bit Octave (not: 64-bit indexing) in my dropbox. I'm building a new one now, once its finished and uploaded I'll send you the link (hopefully Sat. morning).

Philip Nienhuis <philipnienhuis>
Project Member
Wed 12 Aug 2015 01:25:09 PM UTC, comment #30: 

Ever have one of those days where no sooner do you say something doesn't work than you figure out why?

Incremental patch added for alternating row colours.

(file #34630)

Wed 12 Aug 2015 09:56:44 AM UTC, comment #29: 

I've implemented some options. Not got alternate row colours to actually show at this time but everything else seems to work. Default width is only set when the variable is first opened while autofit should update with every change.

Also replaced the multiply symbol with x since that's what disp() uses. I hadn't realised there was no standard ascii code for that.


(Would be good if I could get a windows executable with this in it since I'd like to have it with me at BMVC in september.

(file #34628)

Sun 09 Aug 2015 09:37:39 PM UTC, comment #28: 

Again an updated patch (works for default branch as of late July 2015)

(file #34616)

Philip Nienhuis <philipnienhuis>
Project Member
Sun 28 Jun 2015 02:20:28 PM UTC, comment #27: 

Updated patch to build with Octave 4.1.0+ as of June 28

(file #34334)

Philip Nienhuis <philipnienhuis>
Project Member
Thu 04 Jun 2015 05:52:34 PM UTC, comment #26: 

Apart from structs (difficult, maybe something for later) I'd only have suggestions of the nitty-gritty type:

- icon size matching that of the other panes

- hiding the command line "openvar ()" message when double clicking in a variable editor cell

- col width / row height adapting to contents (currently much real estate is used for white background)

- a tab in the Edit | Preferences menu with specific Variable Editor settings (suggestions: default column width/ row height; font / font size; nr. of decimal places for numeric content; column contents alignment (left/enter/right); etc; etc).

BTW on Windows the contents of a cell array are shown as

b{2, 2}: cell 2Ã2

...should probably be "cell 2x2" ?
see attached pic

(I know I'm repeating myself, but I'm very happy with the variable editor)

Philip Nienhuis <philipnienhuis>
Project Member
Thu 04 Jun 2015 01:57:55 PM UTC, comment #25: 

I think I've fixed the editor position being saved between sessions. I do not understand why it opens in a column on its own, but once it's dragged somewhere else it stays there.

Not sure what to do next.


(file #34159)

Fri 29 May 2015 10:01:19 AM UTC, comment #24: 

Thanks. Yeah, the variable editor staying open with unknown variables is Matlab-like behaviour.

I'm back from floods and internet failures and will poke around to see if there's more I think I can gainfully do on this feature.


Sun 24 May 2015 10:48:06 AM UTC, comment #23: 

The bug I reported in comments #21 & #22 appears to have been fixed in your latest cs, nice! (That bug was a little showstopper.)

I've made a small patch to clarify the "not Found" message when variables are cleared or get out of scope (e.g., when doing "dbup" or "dbdown" while debugging). I found that once scope returns to the function containing the variables, the Var.Editor pane again shows the variable, which is also very nice.

(file #34086)

Philip Nienhuis <philipnienhuis>
Project Member
Tue 19 May 2015 05:30:35 PM UTC, comment #22: 

The example should read:

>> a = rand (3); b = num2cell (a); b{2, 2} = {1, "a"; "b", true};

## Now opening b in variable editor (RMB | Open in Variable Editor)

>> clear b
>> Variable b not foundVariable b not found

Philip Nienhuis <philipnienhuis>
Project Member
Mon 18 May 2015 09:46:53 AM UTC, comment #21: 

(Sorry I was away for over a week, have to catch up but my daily job has priority (of course).)

A bug I just hit (a serious one I suppose) is that the variable editor doesn't cope with cleared variables opened in the variable editor.

>> a = rand (3); b = num2cell (a); b{2, 2} = {1, "a"; "b", true};
>> clear b
>> Variable b not foundVariable b not found

(ignoring the duplicate popups).

Same for variables opened in the variable editor in functions openened in debug mode. Once the function gets to the end and returns, the variable editor tab keeps hanging, and has to be closed manually as well.

Apparently the variable editor doesn't get notified that b is gone, or went out of scope.

The relevant variable editor tab has to be closed manually before other work can continue in the terminal.

As to structs, well, too bad :-) 
I find it already immensely useful to browse arrays and to see what happens inside while debugging, even if only numeric and cell arrays. Thanks again for your work on this!


Philip Nienhuis <philipnienhuis>
Project Member
Sun 17 May 2015 09:35:31 PM UTC, comment #20: 

Not getting structs to work any time soon, I'm afraid. I need to figure out how a lot of things work differently and I don't know how much time I'll have for a couple of weeks at least.

This patch is mostly cleanup. I'd left a debug message in there, icons weren't all working, that kind of thing. May be the last for a while but if you find any significant bugs I'll try to jump on them.

I agree about the usefulness of the variable editor, I used it extensively when producing my thesis. Copy and paste to LibreOffice, format nicely, export as LaTeX.


(file #34037)

Sun 10 May 2015 07:32:12 PM UTC, comment #19: 

Thanks for the advice.

I'll have a go with structs this week. No promises because they're quite a departure from other variables but I'll see how it works out. There will need to be conditions added to things like menus to prevent the user adding or removing columns, validation when changing variable names so they don't get duplicated and are required to be valid strings...

I'll aim to get a new patch up next weekend that is either just cleaned up or adding struct support.

Fri 08 May 2015 10:40:39 PM UTC, comment #18: 

OK got an opportunity to test on Windows as well. On Linux it all works fine.
On Windows & Linux the copy/paste crashes are gone, and double-clicking a nested cell-"cell" opens it in a new variable-editor tab. How to get text in a numeric cell-array cell is somewhat convoluted but in the end it works.
Nice! very very useful (for me at least).

Q1: will you also do structs some time?

Q2: If I were you I'd put some copyright strings in with your name, after all these aren't tiny mods.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 07 May 2015 08:56:42 PM UTC, comment #17: 

You're right, I still see the ctrl-v related crash when no variables are open bug with a gcc-5.1.0 cross-build.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 07 May 2015 08:51:16 PM UTC, comment #16: 

With a gcc-5.1.0 build (latest mxe-octave) rather than 4.9.2 the Ctrl-v crash didn't occur with the patches in comments #10 and #7, but I didn't test it thoroughly.

Maybe I have time for a new test build before I'll be away for a week so possibly I can try & report only after May 17th.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 07 May 2015 12:55:43 PM UTC, comment #15: 

I didn't get it compiling under Windows, but I found a ctrl-c / ctrl-v related crash when no variables are open. Hopefully this might fix the crashes you were experiencing.

I've also got editing on double-click working again for cells containing matrices and strings.

With a little luck this should be all of the serious stuff.

(file #33954)

Thu 30 Apr 2015 07:26:29 PM UTC, comment #14: 

Ouch! You may have a hard time getting Octave to build with Visual Studio.
If you want to compile & debug natively, use mxe-octave on Windows (see the wiki).
It'll take a long time (much much longer than cross-building on Linux) but it should work.

Philip Nienhuis <philipnienhuis>
Project Member
Thu 30 Apr 2015 01:46:11 PM UTC, comment #13: 

Okay, I'm going to try to get Octave compiling under Visual Studio to track this paste bug down.


Wed 29 Apr 2015 09:58:44 PM UTC, comment #12: 

On Windows, pasting into the terminal pane with Ctrl-V crashes Octave.
Pasting with right-click, selecting "paste" works fine.

Philip Nienhuis <philipnienhuis>
Project Member
Wed 29 Apr 2015 06:48:09 PM UTC, comment #11: 

Deleting rows works now.

sq-strings are accepted now.

Typing text w/o quotes in a numeric cell still popups a graphics window. The same in a cell containing text doesn't.

Thanks for these fixes!

On Windows I had some crashes when pasting text into the terminal. But when I did it slowly and carefully I experienced no crash. I'm still at loss what I did wrong - maybe a focus issue (I have a delayed "focus follows mouse" setting on Windows; but the RMB click should have set focus I suppose).

Would it be possible to add "openvar" in the right-click menu when clicking on a cell? (of course only really useful if that cell is a nested cell array but it gives a way to show nested arrays)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 29 Apr 2015 12:22:16 PM UTC, comment #10: 

Tiny little patch but this seems to have fixed the invalid input problem detailed below. The fix was simply to let it pass and trust Octave itself to handle everything.

Apply after the previous patch.


(file #33836)

Tue 28 Apr 2015 09:29:21 PM UTC, comment #9: 

("our new patch" -> "your new patch" - my wireless keyboard needs new batteries :-( )

A quick check shows that the Copy / Ctrl-C crash issue has disappeared. Nice!

openvar("varname{2,2}") works fine AFAICS.

When entering text strings in a cell array, ' (single quotes, sq-strings) aren't accepted, only double quotes (dq-strings) work.

Inf and NaN are shown correctly now. I do not know that much about Octave internals nor C++ so I can't give any advice.

There's "variable editor" title on the docked pane -> fixed.

Typing "text" (w/o quotes) in a cell from e.g. tmp = ones(3) gives a graphics window pop-up and in the cell I get a number like -6.00174.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 28 Apr 2015 08:02:52 PM UTC, comment #8: 

Thanks very much for continued development, I find a variable editor (even if still experimental) very useful.
I'll try our new patch.

Philip Nienhuis <philipnienhuis>
Project Member
Tue 28 Apr 2015 12:09:49 PM UTC, comment #7: 

Sorry for my conspicuous absence, I think this is an advance.

I found a possibly related pasting error on Linux which I fixed by rejecting copy and paste requests if the variable editor does not have focus.

I have currently disabled opening subeditors on a double click. Commands such as openvar("varname{2,2}") still work but I haven't tested them.

My fix for lower case inf and nan is hacky but I've traced the issue back to octave_value::print returning the values in lowercase. Should I use something else?

GUI issues are still outstanding.

My biggest concern now is how to handle invalid entries. For example:

temp = ones(10);

select a cell and type in some text.

The editor will then recover perfectly when any variable, including ans, is changed. I haven't managed to automatically do this.

Suggestions welcomed.


(file #33823)

Fri 24 Apr 2015 10:35:14 AM UTC, comment #6: 

Further observations:

  • the Ctrl-C crash only happens on Windows. On Linux it all works fine.
  • There's no pane title when docked.
Philip Nienhuis <philipnienhuis>
Project Member
Sun 19 Apr 2015 03:53:20 PM UTC, comment #5: 

Right-clicking a row head and selecting "Delete" does not delete the row. For columns it works well.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 18 Apr 2015 09:49:01 PM UTC, comment #4: 

After some more playing I found a nasty bug:

You mention Copy/Paste to/from LO is working, but copying text from the terminal pane makes Octave crash with signal 11 as soon as Ctlr-C is entered (it also crashes on Windows).

So I think the copy paste code had better be left out until it works reliably

Philip Nienhuis <philipnienhuis>
Project Member
Wed 15 Apr 2015 07:56:59 PM UTC, comment #3: 

Thanks, I've just built a tip with it and it works. I like it!

Some of the glitches I found:

Clicking on a cell containing another cell array in a nested cell array will crash octave (signal 6).

Double-clicking in an element of a struct array gives some incomprehensible error (("error: 'scalar' undefined near line 1 column 1") plus a popup that does show the proper values.
=> Looks like a simple fix.

NaN / Inf values are shown in small caps, not 'NaN' or 'Inf'

Clear <variable> when <variable> is shown in the variable editor is catched with <variable>: not found. Nice; maybe the subpane can be closed instead?

Empty strings are shown as empty cells instead of consecutive double quotes (which I would think to be more consistent).

The variable editor pane position and dock state isn't remembered across a restart of Octave.

All in all I find it very usable.

I'll change status to "in progress"

Philip Nienhuis <philipnienhuis>
Project Member
Wed 15 Apr 2015 08:38:00 AM UTC, comment #2: 

My bad, I have added a second patch to add the missing source files.

(file #33679)

Tue 14 Apr 2015 07:36:10 PM UTC, comment #1: 

AFAICS your patch is on top of the one in patch #8316, which unfortunately doesn't apply anymore against current dev version (or 4.0.0-rc3).

Your patch itself applies cleanly but lacks e.g., variable-editor.h

Could you supply one changeset that includes the one from patch #8316 and yours that applies to the current dev sources?

Philip Nienhuis <philipnienhuis>
Project Member
Tue 14 Apr 2015 10:10:44 AM UTC, original submission:  

Based on patch #8316, this patch is from revision 20075 and now supports copying and pasting numeric matrices in and out, tested between Octave and Libre Office.

Cell arrays have partial support, as in the previous patch. Some bugs relating to, for example, changing where the window is docked and unticking the window menu entry on closing.



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #40754:  patch_8656_variable-editor_20170519.cset added by philipnienhuis (100KiB - application/octet-stream)
file #35103:  Variable_editor_20151008.patch added by None (103KiB - text/x-diff - Patch vs main repository update 20570 - 2d char arrays as a column of strings)
file #35094:  Variable_editor_20151007.patch added by None (102KiB - text/x-diff - Patch vs main repository update 20567 - strings now in one cell.)
file #34700:  struct1.png added by philipnienhuis (40KiB - image/png)
file #34701:  struct2.png added by philipnienhuis (43KiB - image/png)
file #34702:  struct3.png added by philipnienhuis (41KiB - image/png)
file #34679:  Variable-editor-2015-08-19.patch added by None (102KiB - text/x-diff - Patch vs main repository update 20450)
file #34630:  Variable_editor_row_colours.patch added by None (2KiB - text/x-diff - Apply after previous patch (file #34628) to fix alternate row colours.)
file #34628:  Variable_editor_20150812.patch added by None (96KiB - text/x-diff - Patch vs main repository update 20448)
file #34159:  Variable_Editor_20150604.patch added by None (78KiB - text/x-diff - Patch vs main repository update 20248)
file #34086:  out_of_scope.cs added by philipnienhuis (877B - text/x-csharp)
file #34037:  Variable_Editor_20150517.patch added by None (77KiB - text/x-diff - Patch vs main repository update 20200)
file #33954:  Variable_Editor_20150507.patch added by None (78KiB - text/x-diff - Patch vs main repository update 20170)
file #33836:  Variable_editor_Invalid_input_fix.patch added by None (1020B - text/x-diff - Tiny bugfix, apply previous patch first.)
file #33823:  Variable_editor_20150428.patch added by None (76KiB - text/x-diff - Updated patch against the main repository update 20138)
file #33679:  variable_editor_missing_files.patch added by None (55KiB - text/x-diff - Adding four source files that were missing from the initial patch file.)
file #33671:  variable_editor_20150414.patch added by None (20KiB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by philipnienhuis
  • -email is unavailable- added by None (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    Follow 25 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-22 jwe StatusIn Progress Done
        Open/ClosedOpen Closed
    2017-07-13 jwe Attached File- Added variable-editor-diffs-2017-07-13.txt, #41199
    2017-07-12 jwe Attached File- Added variable-editor-diffs-2017-07-12.txt, #41193
    2017-05-22 philipnienhuis Attached File- Added patch_8656_variable-editor_20170519.cset, #40754
    2016-07-13 philipnienhuis Attached File- Added Variable-editor_13july2016.cs, #37863
    2016-03-22 philipnienhuis Attached File- Added Variable-editor_9jan2016.cs, #36726
    2015-10-14 philipnienhuis Attached File- Added VarEd_JavaArray.png, #35194
        Attached File- Added VarEd_ML_classdef.png, #35195
    2015-10-08 None Attached File- Added Variable_editor_20151008.patch, #35103
    2015-10-07 philipnienhuis Attached File- Added VarEd_char-array.png, #35095
    2015-10-07 None Attached File- Added Variable_editor_20151007.patch, #35094
    2015-08-23 philipnienhuis Attached File- Added struct1.png, #34700
        Attached File- Added struct2.png, #34701
        Attached File- Added struct3.png, #34702
    2015-08-21 philipnienhuis Carbon-Copy- Added philipnienhuis
    2015-08-19 None Attached File- Added Variable-editor-2015-08-19.patch, #34679
    2015-08-12 None Attached File- Added Variable_editor_row_colours.patch, #34630
    2015-08-12 None Attached File- Added Variable_editor_20150812.patch, #34628
    2015-08-09 philipnienhuis Attached File- Added Variable_Editor_20150809_update.cs, #34616
    2015-06-28 philipnienhuis Attached File- Added Variable_Editor_20150628_update.cs, #34334
    2015-06-04 philipnienhuis Attached File- Added vared_nested_cellarr.png, #34160
    2015-06-04 None Attached File- Added Variable_Editor_20150604.patch, #34159
    2015-05-24 philipnienhuis Attached File- Added out_of_scope.cs, #34086
    2015-05-17 None Attached File- Added Variable_Editor_20150517.patch, #34037

    Back to the top

    Powered by Savane 3.9