Index: stable/HeuristicLab.Scripting.Views/3.3/ScriptView.cs
===================================================================
--- stable/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11170)
+++ stable/HeuristicLab.Scripting.Views/3.3/ScriptView.cs	(revision 11907)
@@ -35,8 +35,20 @@
   [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 override bool ReadOnly {
+      get { return codeEditor.ReadOnly || base.ReadOnly; }
+      set { base.ReadOnly = codeEditor.ReadOnly = value; }
+    }
+
+    public override bool Locked {
+      get { return codeEditor.ReadOnly || base.Locked; }
+      set { base.Locked = codeEditor.ReadOnly = value; }
+    }
+    #endregion
 
     public ScriptView() {
@@ -47,16 +59,13 @@
     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();
@@ -64,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);
@@ -83,15 +93,7 @@
       base.SetEnabledStateOfControls();
       compileButton.Enabled = Content != null && !Locked && !ReadOnly;
-      codeEditor.Enabled = Content != null && !Locked && !ReadOnly;
+      codeEditor.Enabled = Content != null;
     }
 
-    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) {
@@ -103,4 +105,5 @@
       return base.ProcessCmdKey(ref msg, keyData);
     }
+    #endregion
 
     public virtual bool Compile() {
@@ -113,5 +116,5 @@
         outputTextBox.AppendText("Compilation succeeded.");
         return true;
-      } catch {
+      } catch (InvalidOperationException) {
         if (Content.CompileErrors.HasErrors) {
           outputTextBox.AppendText("Compilation failed.");
@@ -127,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",
@@ -149,4 +156,7 @@
         errorListView.Items.Add(item);
       }
+
+      codeEditor.ShowCompileErrors(Content.CompileErrors, ".cs");
+
       AdjustErrorListViewColumnSizes();
     }
@@ -157,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
   }
 }
