yab | yet another Basic for HAIKU

Full Version: yabIDE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In my version of yab (bbjimmy) is an bug selecting the "open project folder", it always opens the last loaded project in the project list and not the selected.
Hmmm. It has always done that to me, but I never looked into it.
It seems globalProjectDir$ is only set when a project is opened. I will need to add an array with a globalProjectDir$ for each file in the file listing and set globalProjectDir$ when the file is selected. I haven't found the right place in the code to do that yet.
(01-09-2017, 12:49 PM)bbjimmy Wrote: [ -> ]It seems globalProjectDir$ is only set when a project is opened. I will need to add an array with a globalProjectDir$ for each file in the file listing and set globalProjectDir$ when the file is selected. I haven't found the right place in the code to do that yet.

Why so complicated. Add a array for the CurrentOpenProject$ and then the user select one item in the listbox switch deh array path
The Spagheti code complicates this simple fix.
OK, I got it... I added at 475
OpenProjectDir$ = getprojectdir$()
snd changed
system("open " + globalProjectDir$)
to
system("open " + OpenProjectDir$)

and added this subroutine:

sub getprojectdir$()
local CurrentSelection, CurrentSelection$, i,OpenProjectDir$
CurrentSelection = columnbox get "FileBox"
CurrentSelection$ = columnbox get$ "FileBox", 2, CurrentSelection
for i=1 to COLUMNBOX COUNT "FileBox"
if (GetFileName$(globalAllNames$(i)) = CurrentSelection$) OpenProjectDir$ = GetDirectory$(globalAllNames$(i)):break
next
return OpenProjectDir$
end sub

It seems to work ok.
Commited the change, it will be in the next release!

https://github.com/bbjimmy/YAB/commit/cf...d3b72797ed
(01-13-2017, 11:40 AM)bbjimmy Wrote: [ -> ]Commited the change, it will be in the next release!

https://github.com/bbjimmy/YAB/commit/cf...d3b72797ed

Good job, thanks
Free Web Hosting