Merge remote-tracking branch 'origin/main'
This commit is contained in:
		
						commit
						2bb76acb46
					
				| 
						 | 
				
			
			@ -27,7 +27,15 @@ public class TextLogik {
 | 
			
		|||
 | 
			
		||||
                    break;
 | 
			
		||||
                case "DEL":
 | 
			
		||||
                    // TODO Hier Delete Funktion hinzufügen.
 | 
			
		||||
                    if (command.length == 1){
 | 
			
		||||
                        text.del(TextInput.checkForInput().length);
 | 
			
		||||
                    }else if (isNumeric(command[1])){
 | 
			
		||||
                        int line = Integer.parseInt(command[1]);
 | 
			
		||||
 | 
			
		||||
                        text.del(line, text.size () - 1);
 | 
			
		||||
                    }else {
 | 
			
		||||
                        textOutput.errorInvalidCommand();
 | 
			
		||||
                    }
 | 
			
		||||
                    break;
 | 
			
		||||
                case "Dummy":
 | 
			
		||||
                    text.dummy();
 | 
			
		||||
| 
						 | 
				
			
			@ -53,6 +61,16 @@ public class TextLogik {
 | 
			
		|||
 | 
			
		||||
                    break;
 | 
			
		||||
                case "REPLACE":
 | 
			
		||||
                    if (command.length == 1){
 | 
			
		||||
                        text.replace(TextInput.getTextInput());
 | 
			
		||||
                    }else if(isNumeric(command[1])) {
 | 
			
		||||
                        int line = Integer.parseInt(command[1]);
 | 
			
		||||
 | 
			
		||||
                        text.replace(line, text.size() - 1);
 | 
			
		||||
                    }else {
 | 
			
		||||
                        textOutput.errorInvalidCommand();
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                    break;
 | 
			
		||||
                default:
 | 
			
		||||
                    System.out.println("Command not found. Try again");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue