On 14.10.2015 13:22, Mattias Gaertner wrote:
On Wed, 14 Oct 2015 13:41:30 +0300
FreeMan wrote:
>[...]
>note:
>after this error, in editor toolbar I have "Open packages of current
>unit" icon, its start blink.?
I see this too under Linux/Gtk2.
Since freeman hasn't created a bug report and I am too lazy to write one
myself, I sent the patch here.
Ondrej
Index: ide/main.pp
===
--- ide/main.pp (revision 50059)
+++ ide/main.pp (working copy)
@@ -3729,16 +3729,19 @@
CanOpenPkgOfFile, CanAddCurFile: Boolean;
begin
GetCurrentUnit(ASrcEdit,AUnitInfo);
- if Assigned(AUnitInfo) and (AUnitInfo.Filename <> FLastUnitInfoFileName) then
+ if Assigned(AUnitInfo) then
begin
-PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
- not AUnitInfo.IsPartOfProject);
-CanOpenPkgOfFile:=Assigned(PkgFile);
-CanAddCurFile:=(not AUnitInfo.IsVirtual) and
FileExistsUTF8(AUnitInfo.Filename)
- and not AUnitInfo.IsPartOfProject;
-MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
-MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
-FLastUnitInfoFileName := AUnitInfo.Filename;
+if (AUnitInfo.Filename <> FLastUnitInfoFileName) then
+begin
+ PkgFile:=PackageGraph.FindFileInAllPackages(AUnitInfo.Filename,true,
+not AUnitInfo.IsPartOfProject);
+ CanOpenPkgOfFile:=Assigned(PkgFile);
+ CanAddCurFile:=(not AUnitInfo.IsVirtual) and
FileExistsUTF8(AUnitInfo.Filename)
+and not AUnitInfo.IsPartOfProject;
+ MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=CanOpenPkgOfFile;
+ MainIDEBar.itmPkgAddCurFileToPkg.Enabled:=CanAddCurFile;
+ FLastUnitInfoFileName := AUnitInfo.Filename;
+end;
end else
begin
MainIDEBar.itmPkgOpenPackageOfCurUnit.Enabled:=False;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus