Sublime Forum

Change core command, is possible?

#1

Hi,
This command prompt_open_project_or_workspace open last path on system, but i change for open custom path (set via sublime settings).

Is possible?
I saved all projects on same folder, I try on_window_command but this command not return args.

Sublime Text Build 3085

0 Likes

#2

Any Idea?

0 Likes

#3

If the core command exists in the Default package, then it is possible. However, I have not found a way to change a core command that was not available in the Default package.

I have extended GotoDefinitionCommand to add some custom logic for a plugin I created as an in-house utility. Simply import the class:

from Default.symbol import GotoDefinition

Class CustomGotoDef(GotoDefinition):
   ...

**** PLEASE USE THIS WITH CAUTION!!! ****

If you need to override the called commands from the menu, make sure your command name Matches the default command name exactly, otherwise sublime will continue to call the original command.

0 Likes