From 8afeb501cbdfa722da01390b7301e5038e3c6740 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Dec 2015 11:47:14 +0100 Subject: [PATCH] In SketchController.nameCode, only switch tabs when adding file When renaming a file, the current tab is already the correct one, so no need to switch. This allows looking up the tab index based on the SketchCode object, instead of doing a filename lookup. --- app/src/processing/app/SketchController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/processing/app/SketchController.java b/app/src/processing/app/SketchController.java index 738bd36f6..97df7b8d1 100644 --- a/app/src/processing/app/SketchController.java +++ b/app/src/processing/app/SketchController.java @@ -368,11 +368,9 @@ public class SketchController { return; } sketch.addCode(code); + editor.selectTab(editor.findTabIndex(code)); } - // set the new guy as current - editor.selectTab(editor.findTabIndex(newName)); - // update the tabs editor.header.rebuild(); }