Index: trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.Designer.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.Designer.cs	(revision 11657)
@@ -46,11 +46,12 @@
       // textEditor
       // 
-      this.textEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-                  | System.Windows.Forms.AnchorStyles.Left)
-                  | System.Windows.Forms.AnchorStyles.Right)));
+      this.textEditor.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
       this.textEditor.ConvertTabsToSpaces = true;
       this.textEditor.IndentStyle = ICSharpCode.TextEditor.Document.IndentStyle.Auto;
       this.textEditor.IsIconBarVisible = true;
       this.textEditor.IsReadOnly = false;
+      this.textEditor.LineViewerStyle = ICSharpCode.TextEditor.Document.LineViewerStyle.FullRow;
       this.textEditor.Location = new System.Drawing.Point(0, 0);
       this.textEditor.Name = "textEditor";
@@ -97,5 +98,5 @@
       this.sharpDevelopLabel.Text = "powered by #develop";
       this.sharpDevelopLabel.ToolTipText = "Syntax highlighting and code completion facilities provided through #develop libr" +
-          "aries";
+    "aries";
       this.sharpDevelopLabel.Click += new System.EventHandler(this.toolStripStatusLabel1_Click);
       // 
@@ -108,5 +109,4 @@
       // CodeEditor
       // 
-      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
       this.Controls.Add(this.textEditor);
Index: trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.cs	(revision 11657)
@@ -46,4 +46,6 @@
 
     #region Fields & Properties
+    private static Color WarningColor = Color.Blue;
+    private static Color ErrorColor = Color.Red;
 
     internal Dom.ProjectContentRegistry projectContentRegistry;
@@ -127,4 +129,5 @@
       }
       set {
+        if (Doc.TextContent == value) return;
         Doc.Replace(prefix.Length, Doc.TextLength - suffix.Length - prefix.Length, value);
         Doc.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea));
@@ -141,5 +144,4 @@
 
     public event EventHandler TextEditorValidated;
-
     protected void OnTextEditorValidated() {
       if (TextEditorValidated != null)
@@ -148,5 +150,4 @@
 
     public event EventHandler TextEditorTextChanged;
-
     protected void OnTextEditorTextChanged() {
       if (TextEditorTextChanged != null)
@@ -159,7 +160,5 @@
       textEditor.ActiveTextAreaControl.TextEditorProperties.SupportReadOnlySegments = true;
 
-      textEditor.SetHighlighting("C#");
-      textEditor.ShowEOLMarkers = false;
-      textEditor.ShowInvalidLines = false;
+      LoadHighlightingStrategy();
       HostCallbackImplementation.Register(this);
       CodeCompletionKeyHandler.Attach(this, textEditor);
@@ -192,14 +191,25 @@
         return;
 
-      textEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += new ICSharpCode.TextEditor.KeyEventHandler(TextArea_KeyEventHandler);
-      textEditor.ActiveTextAreaControl.TextArea.DoProcessDialogKey += new DialogKeyProcessor(TextArea_DoProcessDialogKey);
-
-      parserThread = new Thread(ParserThread);
-      parserThread.IsBackground = true;
+      textEditor.ActiveTextAreaControl.TextArea.KeyEventHandler += TextArea_KeyEventHandler;
+      textEditor.ActiveTextAreaControl.TextArea.DoProcessDialogKey += TextArea_DoProcessDialogKey;
+
+      parserThread = new Thread(ParserThread) { IsBackground = true };
       parserThread.Start();
 
-      textEditor.Validated += (s, a) => { OnTextEditorValidated(); };
-      textEditor.TextChanged += (s, a) => { OnTextEditorTextChanged(); };
+      textEditor.Validated += (s, a) => OnTextEditorValidated();
+      textEditor.TextChanged += (s, a) => {
+        Doc.MarkerStrategy.RemoveAll(m => errorMarkers.Contains(m)); errorMarkers.Clear();
+        Doc.BookmarkManager.RemoveMarks(m => errorBookmarks.Contains(m)); errorBookmarks.Clear();
+        Doc.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.WholeTextArea));
+        Doc.CommitUpdate();
+        OnTextEditorTextChanged();
+      };
       InitializeImageList();
+    }
+
+    private void LoadHighlightingStrategy() {
+      var strategy = (DefaultHighlightingStrategy)HighlightingManager.Manager.FindHighlighter("C#");
+      strategy.SetColorFor("CaretMarker", new HighlightColor(Color.Beige, false, false));
+      Doc.HighlightingStrategy = strategy;
     }
 
@@ -216,5 +226,4 @@
 
     #region keyboard handlers: filter input in read-only areas
-
     bool TextArea_KeyEventHandler(char ch) {
       int caret = textEditor.ActiveTextAreaControl.Caret.Offset;
@@ -232,5 +241,4 @@
       return false;
     }
-
     #endregion
 
@@ -240,11 +248,15 @@
     }
 
+    public void ScrollToPosition(int line, int column) {
+      var segment = GetSegmentAtOffset(line, column);
+      var position = Doc.OffsetToPosition(segment.Offset + segment.Length);
+      var caret = textEditor.ActiveTextAreaControl.Caret;
+      caret.Position = position;
+      textEditor.ActiveTextAreaControl.CenterViewOn(line, 0);
+    }
+
     private List<TextMarker> errorMarkers = new List<TextMarker>();
     private List<Bookmark> errorBookmarks = new List<Bookmark>();
     public void ShowCompileErrors(CompilerErrorCollection compilerErrors, string filename) {
-      Doc.MarkerStrategy.RemoveAll(m => errorMarkers.Contains(m));
-      Doc.BookmarkManager.RemoveMarks(m => errorBookmarks.Contains(m));
-      errorMarkers.Clear();
-      errorBookmarks.Clear();
       errorLabel.Text = "";
       errorLabel.ToolTipText = null;
@@ -273,5 +285,5 @@
     private void AddErrorMarker(CompilerError error) {
       var segment = GetSegmentAtOffset(error.Line, error.Column);
-      Color color = error.IsWarning ? Color.Blue : Color.Red;
+      Color color = error.IsWarning ? WarningColor : ErrorColor;
       var marker = new TextMarker(segment.Offset, segment.Length, TextMarkerType.WaveLine, color) {
         ToolTip = error.ErrorText,
@@ -282,5 +294,6 @@
 
     private void AddErrorBookmark(CompilerError error) {
-      var bookmark = new ErrorBookmark(Doc, new TextLocation(error.Column, error.Line - 1));
+      Color color = error.IsWarning ? WarningColor : ErrorColor;
+      var bookmark = new ErrorBookmark(Doc, new TextLocation(error.Column, error.Line - 1), color);
       errorBookmarks.Add(bookmark);
       Doc.BookmarkManager.AddMark(bookmark);
@@ -288,8 +301,8 @@
 
     private AbstractSegment GetSegmentAtOffset(int lineNr, int columnNr) {
-      lineNr = Math.Max(Doc.OffsetToPosition(prefix.Length).Line, lineNr);
+      lineNr = Math.Max(Doc.OffsetToPosition(prefix.Length).Line, lineNr - 1);
       lineNr = Math.Min(Doc.OffsetToPosition(Doc.TextLength - suffix.Length).Line, lineNr);
-      var line = Doc.GetLineSegment(lineNr - 1);
-      columnNr = Math.Max(0, columnNr);
+      var line = Doc.GetLineSegment(lineNr);
+      columnNr = Math.Max(0, columnNr - 1);
       columnNr = Math.Min(line.Length, columnNr);
       var word = line.GetWord(columnNr);
@@ -299,5 +312,5 @@
         segment.Length = word.Length;
       } else {
-        segment.Offset = line.Offset + columnNr - 1;
+        segment.Offset = line.Offset + columnNr;
         segment.Length = 1;
       }
Index: trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.resx
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/CodeEditor.resx	(revision 11652)
+++ 	(revision )
@@ -1,129 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="toolStripFiller.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
-  <metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>127, 17</value>
-  </metadata>
-  <metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>
Index: trunk/sources/HeuristicLab.CodeEditor/3.3/ErrorBookmark.cs
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/ErrorBookmark.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.CodeEditor/3.3/ErrorBookmark.cs	(revision 11657)
@@ -25,12 +25,17 @@
 namespace HeuristicLab.CodeEditor {
   public class ErrorBookmark : Bookmark {
+    private readonly Brush brush;
 
     public override bool CanToggle { get { return false; } }
 
     public ErrorBookmark(IDocument document, TextLocation location)
+      : this(document, location, Color.Red) { }
+
+    public ErrorBookmark(IDocument document, TextLocation location, Color color)
       : base(document, location) {
+      brush = new SolidBrush(color);
     }
 
-    public override void Draw(IconBarMargin margin, System.Drawing.Graphics g, System.Drawing.Point p) {
+    public override void Draw(IconBarMargin margin, Graphics g, Point p) {
       int delta = margin.TextArea.TextView.FontHeight / 4;
       Rectangle rect = new Rectangle(
@@ -39,5 +44,5 @@
         margin.DrawingPosition.Width - 6,
         margin.TextArea.TextView.FontHeight - delta * 2);
-      g.FillRectangle(Brushes.Red, rect);
+      g.FillRectangle(brush, rect);
       g.DrawRectangle(Pens.White, rect);
     }
Index: trunk/sources/HeuristicLab.CodeEditor/3.3/HeuristicLab.CodeEditor-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.CodeEditor/3.3/HeuristicLab.CodeEditor-3.3.csproj	(revision 11652)
+++ trunk/sources/HeuristicLab.CodeEditor/3.3/HeuristicLab.CodeEditor-3.3.csproj	(revision 11657)
@@ -151,7 +151,4 @@
   <ItemGroup>
     <Compile Include="CodeCompletionData.cs" />
-    <EmbeddedResource Include="CodeEditor.resx">
-      <DependentUpon>CodeEditor.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="CodeViewer.resx">
       <DependentUpon>CodeViewer.cs</DependentUpon>
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/CSharpScriptView.cs	(revision 11657)
@@ -132,8 +132,8 @@
           return true;
         case Keys.F6:
-          if (!Running) Compile();
+          if (!Running) base.ProcessCmdKey(ref msg, keyData);
           return true;
       }
-      return base.ProcessCmdKey(ref msg, keyData); ;
+      return base.ProcessCmdKey(ref msg, keyData);
     }
     #endregion
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.Designer.cs	(revision 11657)
@@ -110,5 +110,5 @@
       this.toolTip.SetToolTip(this.compileButton, "Compile (F6)");
       this.compileButton.UseVisualStyleBackColor = true;
-      this.compileButton.Click += new System.EventHandler(this.CompileButtonOnClick);
+      this.compileButton.Click += new System.EventHandler(this.compileButton_Click);
       // 
       // infoTabControl
@@ -178,4 +178,5 @@
       this.errorListView.UseCompatibleStateImageBehavior = false;
       this.errorListView.View = System.Windows.Forms.View.Details;
+      this.errorListView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.errorListView_MouseDoubleClick);
       // 
       // iconColumnHeader
@@ -213,10 +214,10 @@
       this.codeEditor.TabIndex = 0;
       this.codeEditor.UserCode = "";
-      this.codeEditor.TextEditorTextChanged += new System.EventHandler(this.CodeEditorOnTextEditorTextChanged);
+      this.codeEditor.TextEditorTextChanged += new System.EventHandler(this.codeEditor_TextEditorTextChanged);
       // 
       // splitContainer1
       // 
-      this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
-            | System.Windows.Forms.AnchorStyles.Left)
+      this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
             | System.Windows.Forms.AnchorStyles.Right)));
       this.splitContainer1.Location = new System.Drawing.Point(0, 56);
Index: trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11657)
@@ -35,12 +35,8 @@
   [Content(typeof(Script), true)]
   public partial class ScriptView : NamedItemView {
+    #region Properties
     public new Script Content {
       get { return (Script)base.Content; }
       set { base.Content = value; }
-    }
-
-    public ScriptView() {
-      InitializeComponent();
-      errorListView.SmallImageList.Images.AddRange(new Image[] { VSImageLibrary.Warning, VSImageLibrary.Error });
     }
 
@@ -54,19 +50,22 @@
       set { base.Locked = codeEditor.ReadOnly = value; }
     }
+    #endregion
+
+    public ScriptView() {
+      InitializeComponent();
+      errorListView.SmallImageList.Images.AddRange(new Image[] { VSImageLibrary.Warning, VSImageLibrary.Error });
+    }
 
     protected override void RegisterContentEvents() {
       base.RegisterContentEvents();
-      Content.CodeChanged += ContentOnCodeChanged;
+      Content.CodeChanged += Content_CodeChanged;
     }
 
     protected override void DeregisterContentEvents() {
-      Content.CodeChanged -= ContentOnCodeChanged;
+      Content.CodeChanged -= Content_CodeChanged;
       base.DeregisterContentEvents();
     }
 
-    protected virtual void ContentOnCodeChanged(object sender, EventArgs e) {
-      codeEditor.UserCode = Content.Code;
-    }
-
+    #region Overrides
     protected override void OnContentChanged() {
       base.OnContentChanged();
@@ -74,5 +73,6 @@
         codeEditor.UserCode = string.Empty;
       } else {
-        codeEditor.UserCode = Content.Code;
+        if (codeEditor.UserCode != Content.Code)
+          codeEditor.UserCode = Content.Code;
         foreach (var asm in Content.GetAssemblies())
           codeEditor.AddAssembly(asm);
@@ -96,12 +96,4 @@
     }
 
-    protected virtual void CompileButtonOnClick(object sender, EventArgs e) {
-      Compile();
-    }
-
-    protected virtual void CodeEditorOnTextEditorTextChanged(object sender, EventArgs e) {
-      if (Content == null) return;
-      Content.Code = codeEditor.UserCode;
-    }
     protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
       switch (keyData) {
@@ -113,4 +105,5 @@
       return base.ProcessCmdKey(ref msg, keyData);
     }
+    #endregion
 
     public virtual bool Compile() {
@@ -123,5 +116,5 @@
         outputTextBox.AppendText("Compilation succeeded.");
         return true;
-      } catch {
+      } catch (InvalidOperationException) {
         if (Content.CompileErrors.HasErrors) {
           outputTextBox.AppendText("Compilation failed.");
@@ -137,16 +130,20 @@
         ReadOnly = false;
         Locked = false;
+        codeEditor.Focus();
         OnContentChanged();
       }
     }
 
+    #region Helpers
     protected virtual void ShowCompilationResults() {
       if (Content.CompileErrors.Count == 0) return;
-      var msgs = Content.CompileErrors.OfType<CompilerError>()
+
+      var messages = Content.CompileErrors.OfType<CompilerError>()
                                       .OrderBy(x => x.IsWarning)
                                       .ThenBy(x => x.Line)
                                       .ThenBy(x => x.Column);
-      foreach (var m in msgs) {
-        var item = new ListViewItem();
+
+      foreach (var m in messages) {
+        var item = new ListViewItem { Tag = m };
         item.SubItems.AddRange(new[] {
           m.IsWarning ? "Warning" : "Error",
@@ -159,4 +156,7 @@
         errorListView.Items.Add(item);
       }
+
+      codeEditor.ShowCompileErrors(Content.CompileErrors, ".cs");
+
       AdjustErrorListViewColumnSizes();
     }
@@ -167,4 +167,33 @@
         ch.Width = -2;
     }
+    #endregion
+
+    #region Event Handlers
+    private void Content_CodeChanged(object sender, EventArgs e) {
+      if (InvokeRequired)
+        Invoke(new EventHandler(Content_CodeChanged), sender, e);
+      else {
+        codeEditor.UserCode = Content.Code;
+      }
+    }
+
+    private void compileButton_Click(object sender, EventArgs e) {
+      Compile();
+    }
+
+    private void codeEditor_TextEditorTextChanged(object sender, EventArgs e) {
+      if (Content == null) return;
+      Content.Code = codeEditor.UserCode;
+    }
+
+    private void errorListView_MouseDoubleClick(object sender, MouseEventArgs e) {
+      if (e.Button == MouseButtons.Left) {
+        var item = errorListView.SelectedItems[0];
+        var message = (CompilerError)item.Tag;
+        codeEditor.ScrollToPosition(message.Line, message.Column);
+        codeEditor.Focus();
+      }
+    }
+    #endregion
   }
 }
Index: trunk/sources/HeuristicLab.Scripting/3.3/Script.cs
===================================================================
--- trunk/sources/HeuristicLab.Scripting/3.3/Script.cs	(revision 11652)
+++ trunk/sources/HeuristicLab.Scripting/3.3/Script.cs	(revision 11657)
@@ -24,5 +24,4 @@
 using System.CodeDom.Compiler;
 using System.Collections.Generic;
-using System.Diagnostics;
 using System.Drawing;
 using System.IO;
@@ -80,5 +79,5 @@
     public Script()
       : base("Script", "An empty script.") {
-      code = string.Empty;
+      code = CodeTemplate;
     }
     public Script(string code)
@@ -109,18 +108,11 @@
         WarningLevel = 4
       };
+
       parameters.ReferencedAssemblies.AddRange(
         GetAssemblies()
         .Select(a => a.Location)
         .ToArray());
-      var unit = CreateCompilationUnit();
-      var writer = new StringWriter();
-      CodeProvider.GenerateCodeFromCompileUnit(
-        unit,
-        writer,
-        new CodeGeneratorOptions {
-          ElseOnClosing = true,
-          IndentString = "  ",
-        });
-      return CodeProvider.CompileAssemblyFromDom(parameters, unit);
+
+      return CodeProvider.CompileAssemblyFromSource(parameters, code);
     }
 
@@ -135,5 +127,5 @@
             .AppendLine(error.ErrorText);
         }
-        throw new Exception(string.Format("Compilation of \"{0}\" failed:{1}{2}",
+        throw new InvalidOperationException(string.Format("Compilation of \"{0}\" failed:{1}{2}",
           Name, Environment.NewLine, sb.ToString()));
       } else {
@@ -143,5 +135,5 @@
 
     public virtual IEnumerable<Assembly> GetAssemblies() {
-      var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();    
+      var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();
       assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality
       return assemblies;
