Sublime Forum

How to clean switch repo menu (shift + command + o)? (SOLVED)

#1

The switch repo menu I’m talking about is:

Many of the repos in the switch repo menu can’t be opened because they are moved to different locations by me.

0 Likes

#2

There is no direct method to do this from within Merge itself, as far as I know. However, there are a couple of alternatives.

If you have Python 3 installed on your system, you can use this script to clean the recent list up a bit. The link includes documentation on usage, but in short it removes from the recent list all of the items that reference folders that no longer exist. I would recommend using the --dry-run argument first off to see what it’s going to try to clean up so you can verify what it’s going to do, though it does create backups just in case.

You can also clean the session file up manually. To do that, select Preferences > Browse Packages, then go up a folder and into the Local folder. Inside there is a file named Session.sublime_session. This is a JSON file, and the key "recent" contains a list of the recent repositories. For example:

	"recent":
	[
		{
			"ignore_diff_whitespace": false,
			"location_bar_visible": true,
			"path": "/home/tmartin/local/src/SublimeScraps",
			"table_of_contents_selected": false,
			"window_height": 0.0,
			"window_width": 0.0
		},
		{
			"ignore_diff_whitespace": false,
			"location_bar_visible": false,
			"path": "/home/tmartin/local/src/OverrideAudit",
			"table_of_contents_selected": false,
			"window_height": 1018.0,
			"window_width": 1920.0
		}
    ]

Removing an entry from the list (everything between pairs of { and }, of which there are two in this example) will remove it from the list of recently selected repositories.

If you edit the file manually, save a backup copy somewhere safe until you’re sure that everything works.

Note also that whichever method you use, Merge reads the session at startup and writes the session when it terminates, so you should quit Merge prior to making the change to the file, or it will seem to have no immediate effect and undo your changes when you quit,

4 Likes

#3

@OdatNurd

Very helpful info, thank you so much!

I knew those must be stored somewhere and we can modify it manually.

Hope someday we get a menu item to do this.

2 Likes