Author Topic: Lost whitespace between folded functions  (Read 2387 times)

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
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
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10803
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Lost whitespace between folded functions
« Reply #1 on: 2010-May-04 »
Yes, please. I just tested and it worked fine. See if you can reproduce it.

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
Re: Lost whitespace between folded functions
« Reply #2 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
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
Re: Lost whitespace between folded functions
« Reply #3 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
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1545
    • View Profile
Re: Lost whitespace between folded functions
« Reply #4 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

Offline aonyn

  • Mr. Polyvector
  • ***
  • Posts: 136
    • View Profile
Re: Lost whitespace between folded functions
« Reply #5 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
For by grace are ye saved through faith, and that not of yourselves: it is the gift of God: Not of works, lest any man should boast. -Ephesians 2:8-9