src/file.cpp

changeset 416
be1824f53c48
parent 410
a5aebcf4a1c8
child 417
14bfeed046f3
--- a/src/file.cpp	Thu Aug 01 15:35:11 2013 +0300
+++ b/src/file.cpp	Thu Aug 01 16:05:31 2013 +0300
@@ -940,6 +940,13 @@
 	return !implicit() && history().pos() != savePos();
 }
 
+str LDFile::getShortName() {
+	if( name().length() > 0 )
+		return basename( name() );
+	
+	return tr( "<anonymous>" );
+}
+
 // =============================================================================
 LDFile* LDFile::current() {
 	return m_curfile;
@@ -948,8 +955,15 @@
 void LDFile::setCurrent (LDFile* f) {
 	m_curfile = f;
 	
-	if (g_win && f)
-		g_win->updateFileListItem (f);
+	if( g_win && f ) {
+		g_win->clearSelection();
+		g_win->updateFileListItem( f );
+		g_win->buildObjList();
+		g_win->R()->setFile( f );
+		g_win->R()->update();
+		
+		log( "Changed file to %1", f->getShortName());
+	}
 }
 
 // =============================================================================

mercurial