Fix when adding a new file after selecting a file from tree.