Go Down

Topic: Folded code gets unfolded if I switch tabs (Read 2688 times) previous topic - next topic

liuzengqiang

Again, I want to run this by everyone else before reporting on github.

Symptom: If I fold a few things in one tab, go to another tab and come back to the first tab, all the folded code are unfolded. It kind of beats the purpose of folding code (making your code look less complicated and lengthy, or fold away the sure things and only focus on not-so-sure things).

OS: win 10 32bit, win 8.1 64bit, win 10 64bit
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

robtillaart

#1
Sep 03, 2015, 09:00 pm Last Edit: Sep 03, 2015, 09:00 pm by robtillaart
which IDE version?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

PaulS

The IDE seems to have borrowed the code from Visual Studio 2012, rather than 2010 or earlier, for code folding. The 2010 and earlier versions remember what was folded. The 2012 version has developed Alzheimer's..

liuzengqiang

Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

pYro_65

This is because each tab shares the same editor window (contents replaced on tab switch).

https://github.com/arduino/Arduino/issues/3441

liuzengqiang

Thanks pYro_65. Subscribed to the issue. It seems like they are looking for a solution. Meanwhile I'll either use NPP for editing or just keep expanding to more tabs for short code within each tab. Most of my projects are long, needing some folding and tabbing.
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

pYro_65

Thanks pYro_65. Subscribed to the issue. It seems like they are looking for a solution. Meanwhile I'll either use NPP for editing or just keep expanding to more tabs for short code within each tab. Most of my projects are long, needing some folding and tabbing.
This could be an indication that your preferred code formatting style may not be the most useful.

I had to change my style years ago, large files become a mess with code formatting like the IDE auto-format provides. And those that put '{' & '}' on their own line... no thanks. Now my style creates discernible blocks of code. I can notice the pattern a particular function has and move straight to it with a single scroll.

Of course the best format relies heavily on how your own memory works, but I've been able to go back to projects a year later and still find things easily.

liuzengqiang

... but I've been able to go back to projects a year later and still find things easily.
And how old are you, if I may ask? ;)

The screen is small, and state machines are long. If I could write short functions spanning only one or two screens each, I'd be ok without folding. Sometimes I copy tested working code into another tab so I don't have to look at it or modify it by mistake. Still, a long project that span over a few thousand lines of code has no easy way to look at. I've found myself doing these long projects lately, many with aggressive deadlines. Is there any IDE that can "iconize" functions so I can show them in a window with these cute little clickable icons to show functions? Think windows 3.1 style (if you've seen it before).
Serial LCD keypad panel,phi_prompt user interface library,SDI-12 USB Adapter

pYro_65

#8
Sep 19, 2015, 07:00 am Last Edit: Sep 19, 2015, 07:02 am by pYro_65
And how old are you, if I may ask? ;)

The screen is small, and state machines are long. If I could write short functions spanning only one or two screens each, I'd be ok without folding. Sometimes I copy tested working code into another tab so I don't have to look at it or modify it by mistake. Still, a long project that span over a few thousand lines of code has no easy way to look at. I've found myself doing these long projects lately, many with aggressive deadlines. Is there any IDE that can "iconize" functions so I can show them in a window with these cute little clickable icons to show functions? Think windows 3.1 style (if you've seen it before).
My age is irrelevant, I have been programming for 15 years, 10 of which in C++ development, most of this in paid employment. One of my first computers was 3.1.

I was involved heavily with direct x 9 programming...  think tens of thousands of lines. Then direct x 10 introduced HLSL, which then meant writing code for individual chipsets. I know from experience that useful code layout matters more than pretty code.

lmkovi

#9
Dec 16, 2015, 01:57 pm Last Edit: Dec 16, 2015, 02:03 pm by lmkovi
@pYro_65   i find unfortunate that blaming other's work always sounds so convincing. In this instance it has nothing to do with the problem. This one is just a minor case of lack of imagination. I pasted an implementation to prove how increadibly trivial the solution is.

The same holds true for many of the issues i am tracking here, which I have been fixing over the last month1/2 with small amounts of code.
Imagination is more important than knowledge
Einstein

Go Up