Index: /trunk/src/lib/shell/shell_completion.cc
===================================================================
--- /trunk/src/lib/shell/shell_completion.cc	(revision 7342)
+++ /trunk/src/lib/shell/shell_completion.cc	(revision 7343)
@@ -32,26 +32,23 @@
 
 /**
- * standard constructor
- */
-ShellCompletion::ShellCompletion(ShellInput* input)
-{
-  this->input = input;
-}
-
-
-/**
- * standard deconstructor
+ * @brief standard constructor
+ */
+ShellCompletion::ShellCompletion()
+{ }
+
+
+/**
+ * @brief standard deconstructor
  */
 ShellCompletion::~ShellCompletion ()
-{
-}
-
-
-
-/**
- * autocompletes the Shell's inputLine
+{ }
+
+
+
+/**
+ * @brief autocompletes the Shell's inputLine
  * @returns true, if a result was found, false otherwise
  */
-bool ShellCompletion::autoComplete(ShellInput* input)
+bool ShellCompletion::autoComplete(std::string& input)
 {
   const char* completionLine;           //< the inputLine we complete.
@@ -67,14 +64,6 @@
   this->emptyCompletionList();
 
-  if (input != NULL)
-    this->input = input;
-  if (this->input == NULL)
-  {
-    PRINTF(2)("No ShellInput supplied\n");
-    return false;
-  }
-
   // Check if we are in a input. eg. the supplied string "class " and now we complete either function or object
-  if (this->input->getInput()[this->input->getInput().size()-1] == ' ')
+  if (input[input.size()-1] == ' ')
   {
     emptyComplete = true;
@@ -82,5 +71,5 @@
 
   // CREATE INPUTS
-  SubString inputSplits(this->input->getInput(), " \t\n,");
+  SubString inputSplits(input, " \t\n,");
 
   // What String will be completed
@@ -133,10 +122,10 @@
 
 
-  this->generalComplete(completeString);
-  return true;
-}
-
-/**
- * autocompletes a className
+  this->generalComplete(input, completeString);
+  return true;
+}
+
+/**
+ * @brief autocompletes a className
  * @param classBegin the Beginning of a String to autoComplete
  * @return true on success, false otherwise
@@ -156,5 +145,5 @@
 
 /**
- * autocompletes an ObjectName
+ * @brief autocompletes an ObjectName
  * @param objectBegin the beginning string of a Object
  * @param classID the ID of the Class to search for.
@@ -178,5 +167,5 @@
 
 /**
- * completes a Function
+ * @brief completes a Function
  * @param functionBegin the beginning of the function String
  * @param classID the class' ID to complete the function of
@@ -193,5 +182,5 @@
 
 /**
- * completes an Alias
+ * @brief completes an Alias
  * @param aliasBegin the beginning of the Alias-String to complete
  * @returns true on succes, false if something went wrong
@@ -209,5 +198,5 @@
 
 /**
- * completes the inputline on grounds of an inputList
+ * @brief completes the inputline on grounds of an inputList
  * @param begin the String to search in the inputList, and to extend with it.
  * @param displayAs how to display the found value to the user, printf-style, !!with only one %s!! ex.: "::%s::"
@@ -216,8 +205,8 @@
  * @return true if ok, false otherwise
  */
-bool ShellCompletion::generalComplete(const std::string& begin, const std::string& displayAs, const std::string& addBack, const std::string& addFront)
-{
-  if (this->input == NULL )
-    return false;
+bool ShellCompletion::generalComplete(std::string& input,
+                                      const std::string& begin, const std::string& displayAs,
+                                      const std::string& addBack, const std::string& addFront)
+{
   if (completionList.size() == 0)
     return false;
@@ -257,15 +246,12 @@
     adder.resize(addLength);
 
-    if (this->input)
+    input.resize(input.size()-inputLenght);
+    input += adder;
+
+    if (completionList.size() == 1)
     {
-     this->input->removeCharacters(inputLenght);
-     this->input->addCharacters(adder);
-
-      if (completionList.size() == 1)
-      {
-        if ( addBack != "")
-         this->input->addCharacters(addBack);
-        this->input->addCharacter(' ');
-      }
+      if ( addBack != "")
+       input += addBack;
+      input += ' ';
     }
   }
@@ -301,5 +287,5 @@
 
 /**
- * searches for classes, which beginn with completionBegin
+ * @brief searches for classes, which beginn with completionBegin
  * @param inputList the List to parse through
  * @param completionBegin the beginning string
@@ -330,5 +316,5 @@
 
 /**
- * deletes the Completion List.
+ * @brief deletes the Completion List.
  *
  * This is done at the beginning of each completion-run
Index: /trunk/src/lib/shell/shell_completion.h
===================================================================
--- /trunk/src/lib/shell/shell_completion.h	(revision 7342)
+++ /trunk/src/lib/shell/shell_completion.h	(revision 7343)
@@ -39,8 +39,8 @@
 
  public:
-  ShellCompletion(ShellInput* input = NULL);
+  ShellCompletion();
   virtual ~ShellCompletion();
 
-  bool autoComplete(ShellInput* input = NULL);
+  bool autoComplete(std::string& input);
   bool classComplete(const std::string& classBegin);
 //  long classMatch(const char* input, unsigned int* length);
@@ -51,5 +51,6 @@
   bool aliasComplete(const std::string& aliasBegin);
 
-  bool generalComplete(const std::string& begin, const std::string& displayAs = "%s",
+  bool generalComplete(std::string& input,
+                       const std::string& begin, const std::string& displayAs = "%s",
                        const std::string& addBack = "", const std::string& addFront = "");
 
@@ -62,5 +63,4 @@
  private:
    std::list<ShellC_Element>    completionList;          //!< A list of completions, that are io.
-   ShellInput*                  input;                   //!< the input this completion works on.
 };
 
Index: /trunk/src/lib/shell/shell_input.cc
===================================================================
--- /trunk/src/lib/shell/shell_input.cc	(revision 7342)
+++ /trunk/src/lib/shell/shell_input.cc	(revision 7343)
@@ -41,5 +41,6 @@
  * this also generates a ShellCompletion automatically.
 */
-ShellInput::ShellInput () : Text ("")
+ShellInput::ShellInput ()
+  : Text ("")
 {
   this->pressedKey = SDLK_FIRST;
@@ -66,23 +67,15 @@
   evh->unsubscribe(ES_SHELL, SDLK_PAGEDOWN);
 
-  this->completion = new ShellCompletion(this);
-}
-
-/**
- * standard deconstructor
-*/
+}
+
+/**
+ * @brief standard deconstructor
+ */
 ShellInput::~ShellInput ()
 {
-  // delete what has to be deleted here
-  delete this->completion;
-
-  while (!this->history.empty())
-  {
-    this->history.pop_front();
-  }
-}
-
-/**
- * sets the Repeate-delay and rate
+}
+
+/**
+ * @brief sets the Repeate-delay and rate
  * @param repeatDelay the Delay it takes, to repeate a key
  * @param repeatRate the rate to repeate a pressed key
@@ -95,5 +88,5 @@
 
 /**
- * deletes the InputLine
+ * @brief deletes the InputLine
  */
 void ShellInput::flush()
@@ -104,5 +97,5 @@
 
 /**
- * sets the entire text of the InputLine to text
+ * @brief sets the entire text of the InputLine to text
  * @param text the new Text to set as InputLine
  */
@@ -115,5 +108,5 @@
 
 /**
- * adds one character to the inputLine
+ * @brief adds one character to the inputLine
  * @param character the character to add to the inputLine
  */
@@ -131,5 +124,5 @@
 
 /**
- * adds multiple Characters to thr inputLine
+ * @brief adds multiple Characters to thr inputLine
  * @param characters a \\0 terminated char-array to add to the InputLine
  */
@@ -147,5 +140,5 @@
 
 /**
- * removes characterCount characters from the InputLine
+ * @brief removes characterCount characters from the InputLine
  * @param characterCount the count of Characters to remove from the input Line
  */
@@ -165,5 +158,5 @@
 
 /**
- * executes the command stored in the inputLine
+ * @brief executes the command stored in the inputLine
  * @return true if the command was commited successfully, false otherwise
  */
@@ -198,5 +191,5 @@
 
 /**
- * moves one entry up in the history.
+ * @brief moves one entry up in the history.
  */
 void ShellInput::historyMoveUp()
@@ -223,5 +216,5 @@
 
 /**
- * moves one entry down in the history
+ * @brief moves one entry down in the history
  */
 void ShellInput::historyMoveDown()
@@ -244,5 +237,5 @@
 
 /**
- * prints out some nice help about the Shell
+ * @brief prints out some nice help about the Shell
  */
 void ShellInput::help(const std::string& className, const std::string& functionName)
@@ -267,5 +260,5 @@
 
 /**
- * ticks the ShellInput
+ * @brief ticks the ShellInput
  * @param dt the time passed since the last update
  */
@@ -298,5 +291,5 @@
 
 /**
- * listens for some event
+ * @brief listens for some event
  * @param event the Event happened
  */
@@ -323,5 +316,8 @@
     }
     else if (event.type == SDLK_TAB)
-      this->completion->autoComplete();
+    {
+      this->completion.autoComplete(this->inputLine);
+      this->setText(this->inputLine);
+    }
     else if (event.type == SDLK_BACKSPACE)
     {
Index: /trunk/src/lib/shell/shell_input.h
===================================================================
--- /trunk/src/lib/shell/shell_input.h	(revision 7342)
+++ /trunk/src/lib/shell/shell_input.h	(revision 7343)
@@ -12,4 +12,6 @@
 #include "text.h"
 #include "event_listener.h"
+#include "shell_completion.h"
+
 #include <list>
 
@@ -54,5 +56,5 @@
  private:
     // HANDLING TEXT INPUT
-   ShellCompletion*                  completion;       //!< The Completion Interface.
+   ShellCompletion                   completion;       //!< The Completion Interface.
 
    std::string                       inputLine;        //!< the Char-Array of the Buffer
