[Done] IDE misplacing indentations

Post bugs related to the IDE here
es_91
Enthusiast
Enthusiast
Posts: 298
Joined: Thu Jan 27, 2011 12:00 pm
Location: DE

[Done] IDE misplacing indentations

Post by es_91 »

PureBasic supposed the ;{ ;} block comments as important for meta information. I tried to use them as C-like block operators. Example:

Code: Select all


enableExplicit

define  gadget
define  window


procedure  drawToCanvas  (  )
;{
	
	shared  gadget
	
	
	if  (  startDrawing  (  canvasOutput  (   gadget  )  )  )
	;{
		
		box  (  0,  0,  gadgetWidth  (  gadget  ), 
 gadgetHeight  (  gadget  ),  #black  )
		
		stopDrawing  (  )
		
	;}
	endIf
	
	
;}
endProcedure


procedure  sizing  (  )
;{
	
	shared  gadget
	shared  window
	
	resizeGadget  (  gadget,  0,  0,  windowWidth  (  window  ),  windowHeight  (  window  )  )
	
	drawToCanvas  (  )
	
;}
endProcedure


;{
	
	window  =  openWindow  (  #pb_any,  0,  0,  240,  125,  #empty$,  #pb_window_screenCentered  | 
 #pb_window_sizeGadget  |  #pb_window_systemMenu  |  #pb_window_tool  )

  gadget  =  canvasGadget  (  #pb_any,  0,  0,  0,  0  )
	
	bindEvent  (  #pb_event_sizeWindow,  @  sizing  (   )  )
	
	sizing  (  )
	
	
	repeat
	;{
		
		
		if  (  waitWindowEvent  (  )  =  #pb_event_closeWindow  )
			;{
				
				
				break
				
				
			;}
		endIf
		
		
	;}
	forEver
	
;}

disableExplicit


This works by setting the IDE indentation rules to following:

Code: Select all

Code Indentation

{Keyword sensitive}

Keyword			Before		After

;{				0			1
;}				-1			0


When pressing Ctrl+i or using the "Format indentation" edit menu, everything is fine. While typing the code, however, the indentation becomes misplaced and needs to be corrected manually...


Image
(screenshot from SpiderBasic 3.00b2 IDE)

Image
(screenshot from PureBasic IDE 6.11 LTS)
:mrgreen:
Fred
Administrator
Administrator
Posts: 18220
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [Done] IDE misplacing indentations

Post by Fred »

Post Reply