CoMPi74 3 Posted July 23, 2022 Hi there, I am looking for the IDE's (or a third party add-on's) option which auto sets the editor in a readonly mode when opening a file from search path. I remember that years ago I was using such an option but now I can not find it again. Any ideas? Piotr Share this post Link to post
Guest Posted July 24, 2022 A long time ago I wrote one for files in the $(DELPHI)\Source directory: https://cc.embarcadero.com/Item/18989 It could be adjusted to work for any files on the library search path. Share this post Link to post
PeterBelow 238 Posted July 24, 2022 18 hours ago, CoMPi74 said: Hi there, I am looking for the IDE's (or a third party add-on's) option which auto sets the editor in a readonly mode when opening a file from search path. I remember that years ago I was using such an option but now I can not find it again. Any ideas? Piotr In my opinion source files you want to protect from modification should be located in a folder tree the user you are working with does not have write access to. Don't use an admin account to work in the IDE! Share this post Link to post
dummzeuch 1505 Posted July 24, 2022 (edited) 39 minutes ago, PeterBelow said: In my opinion source files you want to protect from modification should be located in a folder tree the user you are working with does not have write access to. Don't use an admin account to work in the IDE! He is not just talking about RTL or VCL files but about files in the search path, which as I read it includes the project search path e.g. possibly ..\libs\some\library\source Putting these into read-only folders is not feasible. Edited July 24, 2022 by dummzeuch Share this post Link to post
SwiftExpat 65 Posted July 24, 2022 8 hours ago, Ondrej Kelle said: A long time ago I wrote one for files in the $(DELPHI)\Source directory: Thank you for the example, I think this will keep me busy on my next plane ride. Almost everything on the browse, library and search path could be read only for me. Share this post Link to post
CoMPi74 3 Posted July 24, 2022 Actually, I was talking about all files on path defined in Options (Delphi Options -> Library -> Directories -> Library / Browsing path). My fault, I should explain it better. Sorry. My problem is that using Ctrl+LMB I often get to a source code I don't want to modify (like VirtualTrees.pas) what, unfortunatelly, happens to me very often. So is there a way to have those files 'protected' against accidental, unintentional modifications? Share this post Link to post
dummzeuch 1505 Posted July 25, 2022 The plug-in, that @Ondrej Kelle mentioned looks promising. You'd need to adjust the path which it checks for, but it shouldn't be too difficult. Share this post Link to post
CoMPi74 3 Posted July 25, 2022 On 7/24/2022 at 10:38 AM, Ondrej Kelle said: A long time ago I wrote one for files in the $(DELPHI)\Source directory: https://cc.embarcadero.com/Item/18989 It could be adjusted to work for any files on the library search path. Thank you @Ondrej Kelle. I will check it soon :) Share this post Link to post