You are here: PSPad forum > English discussion forum > OpenFile in newEditor which is already open
Posted by: G00fY | Date: 2016-12-22 15:09 | IP: IP Logged
Hi,
I have a quick question. I wrote a PSPad plugin in Javascript which opens linked textfiles from a custom script language. Everthing is working fine.
The question I came up with: How does PSPad handle a openFile(file) in a new editor, when the file is already opened? I thought about checking which files are opened at the start and instead of using openFile(file) on a new editor, call assignEditorByName() or assignEditorByIndex() instead. But is there even a difference in PSPads internal handling?
Thanks in advance
Posted by: pspad | Date: 2016-12-22 18:21 | IP: IP Logged
Hello
When you try open file what is already exists, PSPad checks first if file is already open, in this case file is selected and if file isn't found, PSPad opens it in new window
Posted by: G00fY | Date: 2016-12-27 10:05 | IP: IP Logged
Thanks for the answer! So there is no need to prevent opening an already opend file in an newEditor(), right? Checking all opend tabs/editors and assign the right one (if the file is already opend at all) is already internally handled. Just wanned to make sure that I do not need this overhead in my script.
Edited 3 time(s). Last edit at 2016-12-27 10:09 by G00fY.
Posted by: pspad | Date: 2016-12-27 11:02 | IP: IP Logged
Right. You don't need to check if file is already open.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR