mirror of https://gitlab.com/basile.b/dexed.git
terminal, prevent consecutive "cd"
This commit is contained in:
parent
41a4749b60
commit
bd792efe0d
|
@ -56,6 +56,7 @@ type
|
||||||
fTerm: TTerminal;
|
fTerm: TTerminal;
|
||||||
fOpts: TCETerminalOptions;
|
fOpts: TCETerminalOptions;
|
||||||
fFirst: boolean;
|
fFirst: boolean;
|
||||||
|
fLastCd: string;
|
||||||
|
|
||||||
procedure docNew(document: TCESynMemo);
|
procedure docNew(document: TCESynMemo);
|
||||||
procedure docFocused(document: TCESynMemo);
|
procedure docFocused(document: TCESynMemo);
|
||||||
|
@ -223,9 +224,15 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCETermWidget.docFocused(document: TCESynMemo);
|
procedure TCETermWidget.docFocused(document: TCESynMemo);
|
||||||
|
var
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
if fOpts.followEditors and document.fileName.fileExists then
|
s := document.fileName.extractFileDir;
|
||||||
fTerm.Command('cd ' + document.fileName.extractFileDir);
|
if fOpts.followEditors and s.fileExists and not SameText(s, fLastCd) then
|
||||||
|
begin
|
||||||
|
fLastCd := s;
|
||||||
|
fTerm.Command('cd ' + s);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCETermWidget.docChanged(document: TCESynMemo);
|
procedure TCETermWidget.docChanged(document: TCESynMemo);
|
||||||
|
@ -249,9 +256,15 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCETermWidget.projFocused(project: ICECommonProject);
|
procedure TCETermWidget.projFocused(project: ICECommonProject);
|
||||||
|
var
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
if fOpts.followProjects and project.fileName.fileExists then
|
s := project.fileName.extractFileDir;
|
||||||
fTerm.Command('cd ' + project.fileName.extractFileDir);
|
if fOpts.followProjects and s.dirExists and not SameText(s, fLastCd) then
|
||||||
|
begin
|
||||||
|
fLastCd := s;
|
||||||
|
fTerm.Command('cd ' + s);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCETermWidget.projCompiling(project: ICECommonProject);
|
procedure TCETermWidget.projCompiling(project: ICECommonProject);
|
||||||
|
|
Loading…
Reference in New Issue