fix #5 - terminal, the current directory is not constrained on startup

This commit is contained in:
Basile Burg 2020-05-16 04:38:32 +02:00
parent a142f2f881
commit 293e89f4e5
2 changed files with 13 additions and 0 deletions

View File

@ -3,6 +3,7 @@
## Bugs fixed
- Messages: force auto scrolling to bottom once and if the messages context is modified.
- Terminal: after launcging dexed, the current directory was not constrained even when the settings to follow the current project or document path were activated. (#5)
# v3.9.3

View File

@ -83,6 +83,7 @@ type
fLastCheckedDirectory: string;
fDisableScrollBarSync: boolean;
fNeedApplyChanges: boolean;
fPaintOnce: boolean;
procedure checkDirectory(const dir: string);
procedure updateScrollBar();
procedure terminalTextScrolled(sender: TObject; delta: integer);
@ -311,11 +312,22 @@ begin
end;
procedure TTermWidget.ContentPaint(Sender: TObject);
var
s: string;
begin
if not fNeedApplyChanges then
exit;
fNeedApplyChanges:=false;
fOpts.applyChanges;
// ugly fix for https://gitlab.com/basile.b/dexed/-/issues/5
if not fPaintOnce then
begin
s := fLastCheckedDirectory;
fLastCheckedDirectory := '';
if s.isNotEmpty then
checkDirectory(s);
end;
fPaintOnce := true;
end;
procedure TTermWidget.terminalTextScrolled(sender: TObject; delta: integer);