GLBasic forum

Main forum => Bug Reports => Topic started by: aonyn on 2010-May-04

Title: Lost whitespace between folded functions
Post by: aonyn on 2010-May-04
Hi Gernot,

This is not a major bug, but perhaps a bug nonetheless.
In the IDE, I just noticed, if you save a file with folded functions, close the project, and reopen it later, then unfold the folded functions, white space (blank line) separating the functions is lost.

Of course this is not a showstopper, just a nuisance bug, I just like to separate my functions with a blank line.

I have not noticed this before, so I will test it more, and see if I can reproduce it reliably, or if it is sporatic.

regards,
Dave
Title: Re: Lost whitespace between folded functions
Post by: Kitty Hello on 2010-May-04
Yes, please. I just tested and it worked fine. See if you can reproduce it.
Title: Re: Lost whitespace between folded functions
Post by: aonyn on 2010-May-05
Hi Gernot,

I have been playing with this today a bit, and in several times of folding, opening, saving, closing the IDE, opening the IDE, etc...
I have only seen this happen again once, but yes it did happen again.

Unfortunately, I have not been able to figure out the condition which causes this to occur, so I can't give you anything precise yet, but I will try to be observant about it, so I can give you useful feedback on the problem.

The good news is, in the two times I have seen this happen, it has not damaged the source, only removed the extra space I leave between functions, so it is not a critical bug.

When I notice a pattern with possible clues to why or when this happens, I will post back in this thread to you.

regards,
Dave
Title: Re: Lost whitespace between folded functions
Post by: aonyn on 2010-May-05
Hi Gernot,

I just reproduced it easily.

Here is how I typed my functions.
Code (glbasic) Select

FUNCTION drawWorld: x%, y% // draws world nodes
DRAWSPRITE sprEmpty, grid[x][y].x, grid[x][y].y
ENDFUNCTION

FUNCTION drawEntity: id%, xNode%, yNode% // draws entities
IF imgSeg[id].isEmpty = FALSE
DRAWSPRITE imgSeg[id].spr, grid[xNode][yNode].x, grid[xNode][yNode].y
ENDIF
ENDFUNCTION


I had them folded, pressed 'save all opened files', and closed the IDE.
Then when I reopened, the folded functions had no space between.
Unfold them, and they look like this.

Code (glbasic) Select

FUNCTION drawWorld: x%, y% // draws world nodes
DRAWSPRITE sprEmpty, grid[x][y].x, grid[x][y].y
ENDFUNCTION
FUNCTION drawEntity: id%, xNode%, yNode% // draws entities
IF imgSeg[id].isEmpty = FALSE
DRAWSPRITE imgSeg[id].spr, grid[xNode][yNode].x, grid[xNode][yNode].y
ENDIF
ENDFUNCTION


As you see, there is no real damage, just lost whitespace.

regards,
Dave
Title: Re: Lost whitespace between folded functions
Post by: matchy on 2010-May-05

Even when commenting blank lines outside functions with just "//" that it gets concatenated with the ENDFUNCTION line. So that can't be used and it does simply seem that the line return is missing.  :P

The editor function folder is very handy I should use it more on the next update.  ;/

Code (glbasic) Select

FUNCTION Example1:
RETURN 0
FUNCTION
//
FUNCTION Example2:
RETURN 1
ENDFUNCTION


after fold and open

Code (glbasic) Select

FUNCTION Example1:
RETURN 0
ENDFUNCTION//
FUNCTION Example2:
RETURN 1
ENDFUNCTION
Title: Re: Lost whitespace between folded functions
Post by: aonyn on 2010-May-05
Thanks for the feedback matchy.
I am glad that it is not just something dumb I was doing (always considered a possibility  :P).

regards,
Dave