Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aayush
purr-data
Commits
f79f7421
Commit
f79f7421
authored
Oct 25, 2016
by
Jonathan Wilkes
Browse files
stop-gap to fix the opendir logic
parent
516eb31f
Changes
2
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
f79f7421
...
...
@@ -40,7 +40,7 @@ exports.get_lib_dir = function() {
return
lib_dir
;
}
exports
.
get_pd_opendir
=
function
()
{
function
get_pd_opendir
()
{
if
(
pd_opendir
)
{
return
pd_opendir
;
}
else
{
...
...
@@ -48,6 +48,16 @@ exports.get_pd_opendir = function() {
}
}
exports
.
get_pd_opendir
=
get_pd_opendir
;
function
set_pd_opendir
(
dir
)
{
pd_opendir
=
dir
;
}
function
gui_set_current_dir
(
dummy
,
dir_and_filename
)
{
set_pd_opendir
(
path
.
dirname
(
dir_and_filename
));
}
function
gui_set_gui_preset
(
name
)
{
skin
.
set
(
name
);
}
...
...
@@ -543,7 +553,7 @@ exports.menu_saveas = menu_saveas;
function
menu_new
()
{
// try not to use a global here
untitled_directory
=
pwd
;
untitled_directory
=
get_pd_opendir
()
;
pdsend
(
"
pd filename
"
,
"
Untitled-
"
+
untitled_number
,
enquote
(
defunkify_windows_path
(
untitled_directory
)));
...
...
@@ -764,7 +774,7 @@ function open_file(file) {
if
(
basename
.
match
(
/
\.(
pd|pat|mxt
)
$/i
)
!=
null
)
{
pdsend
(
"
pd open
"
,
enquote
(
basename
),
(
enquote
(
directory
)));
pd_opendir
=
directory
;
set_
pd_opendir
(
directory
)
;
//::pd_guiprefs::update_recentfiles "$filename" 1
}
}
...
...
pd/src/s_main.c
View file @
f79f7421
...
...
@@ -171,7 +171,9 @@ static void openit(const char *dirname, const char *filename)
{
close
(
fd
);
glob_evalfile
(
0
,
gensym
(
nameptr
),
gensym
(
dirbuf
));
sys_vgui
(
"pdtk_set_current_dir {%s}
\n
"
,
filename
);
//sys_vgui("pdtk_set_current_dir {%s}\n", filename);
gui_vmess
(
"gui_set_current_dir"
,
"xs"
,
0
,
filename
);
}
else
error
(
"%s: can't open"
,
filename
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment