src/file.cpp

changeset 470
e41b6e1e3299
parent 467
59549731151a
child 471
fc58b67d445c
equal deleted inserted replaced
469:f2faed654633 470:e41b6e1e3299
128 128
129 // If we just closed the current file, we need to set the current 129 // If we just closed the current file, we need to set the current
130 // file as something else. 130 // file as something else.
131 if (this == LDFile::current()) { 131 if (this == LDFile::current()) {
132 // If we closed the last file, create a blank one. 132 // If we closed the last file, create a blank one.
133 if (g_loadedFiles.size() == 0) 133 if (countExplicitFiles() == 0)
134 newFile(); 134 newFile();
135 else 135 else {
136 LDFile::setCurrent (g_loadedFiles[0]); 136 // Find the first explicit file loaded
137 int idx = 0;
138 while (g_loadedFiles[idx]->implicit())
139 idx++;
140
141 LDFile::setCurrent (g_loadedFiles[idx]);
142 }
137 } 143 }
138 144
139 g_win->updateFileList(); 145 g_win->updateFileList();
140 } 146 }
141 147

mercurial