Ide: Ide now synchronized navigator in editor mode on startup. #1806

git-svn-id: svn://ultimatepp.org/upp/trunk@11441 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2017-11-07 23:51:01 +00:00
parent 91a4237804
commit 9dc00ddbc9
3 changed files with 39 additions and 24 deletions

View file

@ -137,8 +137,12 @@ void Ide::EditorMode()
// in editor mode :(. This should be investigated with
// appropriate test case.
toolbar.Clear();
SetMenuBar();
SetToolBar();
SetBar();
// NOTE: For some reasons navigator is not synchronized while opening
// editor file. This is the chepest place to do that synchronization.
// More information in ticket #1806.
editor.SyncNavigator();
}
bool Ide::IsEditorMode() const

View file

@ -116,10 +116,10 @@ void Ide::TabsLR(int jd)
TabBar::JumpStack js;
int tc = tabs.GetCount();
int n = tabs.GetTabLR( jd );
if ( n >= 0 && n < tc ) {
int n = tabs.GetTabLR(jd);
if(n >= 0 && n < tc) {
js = tabs.jump_stack;
EditFile( tabs.GetFile( n ) );
EditFile(tabs.GetFile(n));
tabs.jump_stack = js;
}
}
@ -128,13 +128,15 @@ void Ide::TabsStackLR(int jd)
{
int tc = tabs.GetCount();
int n = tabs.GetTabStackLR( jd );
if ( n >= 0 && n < tc )
EditFile( tabs.GetFile( n ) );
int n = tabs.GetTabStackLR(jd);
if(n >= 0 && n < tc)
EditFile(tabs.GetFile(n));
}
void Ide::FileSelected()
{
if(!IsNull(editfile))
tabs.SetAddFile(editfile);
if(IsNull(editfile))
return;
tabs.SetAddFile(editfile);
}

View file

@ -727,6 +727,26 @@ bool IsAssembly(const String& s)
return false;
}
void PreperEditorMode(const Vector<String>& args, Ide& ide, bool& clset)
{
if(args.IsEmpty() || clset) {
return;
}
Vector<String> dir = Split(LoadFile(GetHomeDirFile("usc.path")), ';');
for(int i = 0; i < dir.GetCount(); i++)
ide.UscProcessDirDeep(dir[i]);
for(int i = 0; i < args.GetCount(); i++) {
if(args[i] != "-f") {
ide.EditFile(NormalizePath(args[i]));
ide.FileSelected();
}
}
clset = true;
ide.EditorMode();
}
#ifdef flagMAIN
GUI_APP_MAIN
#else
@ -1035,24 +1055,13 @@ void AppMain___()
clset=true;
}
}
ide.LoadAbbr();
ide.SyncCh();
DelTemps();
if(arg.GetCount() && !clset) {
Vector<String> dir = Split(LoadFile(GetHomeDirFile("usc.path")), ';');
for(int i = 0; i < dir.GetCount(); i++)
ide.UscProcessDirDeep(dir[i]);
for(int i = 0; i < arg.GetCount(); i++)
if(arg[i] != "-f") {
ide.EditFile(NormalizePath(arg[i]));
ide.FileSelected();
}
clset = true;
ide.EditorMode();
}
PreperEditorMode(arg, ide, clset);
if(splash_screen && !ide.IsEditorMode()) {
ShowSplash();
@ -1069,7 +1078,7 @@ void AppMain___()
ide.SetTimeCallback(max(0, next),callback1(&ide,&Ide::SetUpdateTimer,abs(p)));
}
#endif
ide.editor_bottom.Zoom(0);
ide.right_split.Zoom(0);
if(FileExists(ConfigFile("developide"))) {