mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-04 07:31:16 +00:00 
			
		
		
		
	Fix clone down newline bug
Previously cloning down at the end of a script was broken if there was not an additional empty line. This fix ensures there is an empty line before attempting to clone downwards. Fixes #18206, cheers!
This commit is contained in:
		
							parent
							
								
									df79cc86a5
								
							
						
					
					
						commit
						02b7b916b7
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1007,6 +1007,10 @@ void ScriptTextEditor::_edit_option(int p_op) {
 | 
			
		|||
			}
 | 
			
		||||
			int next_line = to_line + 1;
 | 
			
		||||
 | 
			
		||||
			if (to_line >= tx->get_line_count() - 1) {
 | 
			
		||||
				tx->set_line(to_line, tx->get_line(to_line) + "\n");
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			tx->begin_complex_operation();
 | 
			
		||||
			for (int i = from_line; i <= to_line; i++) {
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue