Skip to content

Commit

Permalink
Merge pull request #6 from yuhldr/main
Browse files Browse the repository at this point in the history
feat: decode URI and path replace name
  • Loading branch information
ZanzyTHEbar authored Feb 12, 2025
2 parents 8733752 + 6f51baf commit 8dc472b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ export default class VSCodeWorkspacesExtension extends Extension {
(this._indicator.menu as PopupMenu.PopupMenu).addMenuItem(itemQuit);
}

_get_name(workspace: RecentWorkspace) {
let path = decodeURIComponent(workspace.path);
path = path.replace(`file://`, '').replace(GLib.get_home_dir(), '~');
return path;
}

_loadRecentWorkspaces() {
this._getRecentWorkspaces();

Expand Down Expand Up @@ -192,7 +198,7 @@ export default class VSCodeWorkspacesExtension extends Extension {
// Create the PopupMenu for the ComboBox items

this._recentWorkspaces?.forEach(workspace => {
const item = new PopupMenu.PopupMenuItem(workspace.name);
const item = new PopupMenu.PopupMenuItem(this._get_name(workspace));

const trashIcon = new St.Icon({
icon_name: 'user-trash-symbolic',
Expand Down

0 comments on commit 8dc472b

Please sign in to comment.