forked from qt-creator/qt-creator
		
	qmljs: indent expression in if condition and indent lambda expressions
* indent expressions (like function defs) in if condition fixes QTCREATORBUG-7243 Change-Id: I61197317a8dcba72a45b660600711748e2e2b962 Reviewed-by: Christian Kamm <kamm@incasoftware.de> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
		
				
					committed by
					
						
						Fawzi Mohamed
					
				
			
			
				
	
			
			
			
						parent
						
							9bf654743e
						
					
				
				
					commit
					66eb27e687
				
			@@ -407,16 +407,10 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
 | 
			
		||||
            break;
 | 
			
		||||
 | 
			
		||||
        case condition_open:
 | 
			
		||||
            if (tryInsideExpression())
 | 
			
		||||
                break;
 | 
			
		||||
            switch (kind) {
 | 
			
		||||
            case RightParenthesis:  turnInto(substatement); break;
 | 
			
		||||
            case LeftParenthesis:   enter(condition_paren_open); break;
 | 
			
		||||
            } break;
 | 
			
		||||
 | 
			
		||||
        // paren nesting
 | 
			
		||||
        case condition_paren_open:
 | 
			
		||||
            switch (kind) {
 | 
			
		||||
            case RightParenthesis:  leave(); break;
 | 
			
		||||
            case LeftParenthesis:   enter(condition_paren_open); break;
 | 
			
		||||
            } break;
 | 
			
		||||
 | 
			
		||||
        case switch_statement:
 | 
			
		||||
@@ -1131,7 +1125,6 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd
 | 
			
		||||
    case signal_arglist_open:
 | 
			
		||||
    case function_arglist_open:
 | 
			
		||||
    case paren_open:
 | 
			
		||||
    case condition_paren_open:
 | 
			
		||||
        if (!lastToken)
 | 
			
		||||
            *indentDepth = tokenPosition + 1;
 | 
			
		||||
        else
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user