Mercurial > repos > public > matlab_path_manager
comparison +mpm/MatlabPathManager.m @ 32:cbeef8175d59
Make .loadedSubpath return paths in the order they appear on the matlab path
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 18 Sep 2018 14:27:54 +0200 |
parents | d9f899b1dfd0 |
children | 3a28f6de13c2 |
comparison
equal
deleted
inserted
replaced
31:769d1d252a3c | 32:cbeef8175d59 |
---|---|
51 sp = splitlines(strtrim(fstr)); | 51 sp = splitlines(strtrim(fstr)); |
52 end | 52 end |
53 | 53 |
54 function s = loadedSubpaths(obj) | 54 function s = loadedSubpaths(obj) |
55 state = mpm.PersistentState(obj.stateFilePath); | 55 state = mpm.PersistentState(obj.stateFilePath); |
56 s = state.subpaths.keys(); | 56 s_unordered = state.subpaths.keys(); |
57 % TODO: Make it respect order from the matlab path | 57 |
58 mpath = obj.matlabPath(); | |
59 [ok, I] = ismember(s_unordered, mpath); | |
60 s = mpath(sort(I)); | |
58 end | 61 end |
59 | 62 |
60 function ps = matlabPath(obj) | 63 function ps = matlabPath(obj) |
61 ps = split(path(), pathsep); | 64 ps = split(path(), pathsep); |
62 end | 65 end |