How should I go about replacing the default paste_from_history.py
plugin?
I’ve written my own version of paste from history called PasteFromHistoryEnhanced
, its changes are listed at the bottom of the post for interest’s sake only (no relevance to my question).
After making my alterations I realized that both the TextCommands, PasteFromHistoryCommand
and my PasteFromHistoryEnhancedCommand
, have an EventListener
derived ClipboardHistoryUpdater
class monitoring the clipboard, processing the display name, and storing the last 15 clipboard’s contents in memory.
So I renamed my plugin file as paste_from_history.py
(same name as in the default package), placed it in my ST config User
directory, and renamed my PasteFromHistoryEnhancedCommand
class as PasteFromHistoryCommand
(again the same as the default).
BUT… looking in the console I find this among the rest:
reloading plugin Default.paste_from_history
reloading plugin User.paste_from_history
There is NO unloading plugin Default.paste_from_history
line.
I’m pretty sure this means that both the default and my paste from history plugins are running, wasting time and memory.
What setup do I need to ensure only my plugin is running?
I don’t want to ‘physically’ replace the paste_from_history.py
in the install directory’s Packages/Default.sublime-package
archive.
Thanks.
FOR INTEREST’S SAKE ONLY…
The changes made so far by PasteFromHistoryEnhanced
are:
- User chooses the paste to text from an overlay,
show_quick_panel()
, instead of a pop-up menu. - Ensures that text copied or cut with my own copy and cut plugins gets added to the clipboard history list.
-
is_enabled()
replaced by a ‘clipboard history empty’ status message. - Allows operation from widgets, i.e. the console and input panels.
- Various changes made to the display text; e.g. the addition of a line count (if >1) and a longer display length.