It is currently Mon Nov 23, 2020 10:33 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Can I have 2 times opened the same source?
PostPosted: Mon Jul 27, 2020 10:16 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jun 05, 2020 12:47 am
Posts: 128
I have a proyect, and I would like to have the same source file opened 2 times in the editor, as I have to check two parts of the source, and it is a pain to be jumping with markers.

Is it posible?


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 6:46 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 720
Location: BE
Open a new tab in the editor and ...

_________________
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 8:34 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1081
Joris wrote:
Open a new tab in the editor and ...

...nothing. That doesn't open a second copy for me. It just switches back to the old tab with the source. Tested with a default PureBasic install and with my existing Prefs file. I need to run PureBasic twice to have the same source open twice.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 8:58 am 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 954
Yes, you can't open the same file twice in the PB IDE.

In the Feature Request, it was asked if it was possible to add a horizontal splitter. This should not be possible easily because most Scintilla-based editors don't have this feature either.

In the meantime, personally, I open a read-only copy in Notepad++ with automatic synchronization of changes.

PS. In PB IDE, in addition to the markers you already use (F2) I also often use the return to the last position (CTRL+L) as well as the tool panel "Issue Browser" . Very useful.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 9:12 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3756
Location: Utah, USA
Marc56us wrote:
In the Feature Request, it was asked if it was possible to add a horizontal splitter. This should not be possible easily because most Scintilla-based editors don't have this feature either.

jaPBe has this feature and had a Scintilla-based editor, though the source is a bit out dated. I think it would be possible to implement it in the the editor if jaPBe was used as an example (it was also open-source).

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 9:18 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Mar 11, 2009 4:06 pm
Posts: 326
Location: NL
Scintella supports it by connecting two Scintella gadgets.

Very raw example:
Code:


Procedure Callback_Scintilla_0()
 
EndProcedure

Procedure Callback_Scintilla_1()
 
EndProcedure

;;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;

InitScintilla()

Enumeration FormWindow
  #Window_0
EndEnumeration

Enumeration FormGadget
  #Scintilla_0
  #Scintilla_1
EndEnumeration


Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
  OpenWindow(#Window_0, x, y, width, height, "", #PB_Window_SystemMenu)
  ScintillaGadget(#Scintilla_0, 10, 10, 578, 174, @Callback_Scintilla_0())
  ScintillaGadget(#Scintilla_1, 14, 190, 574, 194, @Callback_Scintilla_1())
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure

;;

OpenWindow_0()

Define pdoc
pdoc = SendMessage_(GadgetID(#Scintilla_0), #SCI_GETDOCPOINTER, 0, 0)
Debug pdoc
SendMessage_(GadgetID(#Scintilla_1), #SCI_SETDOCPOINTER, 0, pdoc)

Repeat
  e = WaitWindowEvent()
  Window_0_Events(e)
Until e = #PB_Event_CloseWindow


PowerBasic example:
https://www.garybeene.com/code/gbsnippets_gbs_00644.htm

Can't even split tabs into multiple simultaneous views (left/right would be a start).

Kind of part workaround: disable "Run only one Instance" in Preferences/General

offtopic About the IDE github project: would be wise for PB to spend some time to get it to compile easy. Check out is one, getting it to run is quite hard from what I have read. Missing EnableExplicit in almost all sources is a shock for me personally. A source of bugs. Aah found an github issue about it: https://github.com/fantaisie-software/p ... /issues/26 . Seems they open sourced it without proper source cleanup/preparation and instructions which hinders community efforts.


Last edited by Rinzwind on Tue Jul 28, 2020 9:35 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 9:32 am 
Offline
Addict
Addict

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 954
Yes, it seems that Scintilla can open several views of the same file and synchronize them.

https://www.scintilla.org/ScintillaDoc.html#MultipleViews


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 10:17 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 5:10 pm
Posts: 554
Location: Doubs - France
Sometime i opened the same project into 32 and 64 PB ide (i always work in 64 bit mode).
If I modify the code in one editor and switch to the other, the modified file will be displayed on the same line because of the PB ide synchronization, so i still have to jump to the part i want to see ...
If you want to see another part of the file in the second editor, that's not the right way to do it.
That's why I do like Marc56us, I use NotePad++ to do the job (sometimes i modify the code in notepad ++ and it works fine when i'm back to PB ide.)

_________________
A+
Denis


Last edited by Denis on Tue Jul 28, 2020 11:59 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 10:30 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1081
RSBasic created a tool to do split-view -> viewtopic.php?f=27&t=73110

But it had a data-losing bug and was discontinued. A shame.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 11:31 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Oct 16, 2009 10:12 am
Posts: 720
Location: BE
BarryG wrote:
Joris wrote:
Open a new tab in the editor and ...

...nothing. That doesn't open a second copy for me. It just switches back to the old tab with the source. Tested with a default PureBasic install and with my existing Prefs file. I need to run PureBasic twice to have the same source open twice.
I haven't try that yet, but can't you do a copy past then ?
It works with different sources, so...

_________________
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 12:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Sep 22, 2010 1:17 pm
Posts: 354
Location: United Kingdom
Give NotePad++ a try https://notepad-plus-plus.org/. It supports dual views - select "Clone to other view" from the document's tab context menu. It automatically synchronises edits across both so it doesn't matter if you edit in the wrong view by mistake.

If you supply "%FILE" (include the quotes) as the arguments you can set it up as a custom tool in the PB IDE and have the current file opened directly in NPP from within the IDE.


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 1:39 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1781
Location: Germany
Rinzwind wrote:
offtopic About the IDE github project: would be wise for PB to spend some time to get it to compile easy. Check out is one, getting it to run is quite hard from what I have read.

For MacOS it can't be much easier: copy my bash script from GitHub directly into TextEdit, save it and start it from your Terminal. It downloads the purebasic-master from GitHub automagically, compiles it and directly launches the newly compiled IDE...:wink:


Top
 Profile  
Reply with quote  
 Post subject: Re: Can I have 2 times opened the same source?
PostPosted: Tue Jul 28, 2020 10:05 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jun 05, 2020 12:47 am
Posts: 128
In the end I cut/copy one procedure to another source, so I have only to switch between source tabs.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye