scrooloose/nerdtree — pull request #137 by AndrewRadev (2012-02-14 10:56:43+00:00)
Title: Double edit fix

Since a recent update of the plugin, opening up a file with the standard `o` mapping seems to edit it twice. The output in the command line looks a bit like this:

/home/andrew/notes
"notes" 127L, 3266C
"notes" 127L, 3266C

This causes an annoying hit-enter prompt. The problem is probably limited to my configuration, since I have a `set shortmess=aTI` in my config. Putting an `O` in there fixes my immediate issue, but there's still a double-edit in there.

After poking around in the code, I found out that the function `Opener._gotoTargetWin()`, which is called right before `Path.edit`, calls `Opener._previousWindow()`, which also edits the file. Removing the editing in `_previousWindow()` seems safe enough to me, since I couldn't find a code path that leads to `_previousWindow()` being called without an edit later.

Another thing I removed is an `echomsg` of the file name, since it adds one more line to the output that's overridden by the standard file edit message anyway.