Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pyc
*.sublime-workspace
4 changes: 4 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
"args": {"file": "${packages}/TerminalView/README.md"},
"caption": "Readme"
},
{
"command": "terminal_view_clear_color_scheme_cache",
"caption": "Clear Color Scheme Cache"
},
]
}
]
Expand Down
1 change: 1 addition & 0 deletions TerminalView.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def run(self,


class TerminalViewActivate(sublime_plugin.TextCommand):

def run(self, _, cmd, title, cwd, syntax, keep_open):
terminal_view = TerminalView(self.view)
try:
Expand Down
4 changes: 4 additions & 0 deletions TerminalView.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@
"command": "edit_settings",
"args": {"base_file": "${packages}/TerminalView/TerminalView.sublime-commands", "default": "[]"},
},
{
"caption": "Preferences: Terminal View: Clear Color Scheme Cache",
"command": "terminal_view_clear_color_scheme_cache"
},
]
38 changes: 38 additions & 0 deletions TerminalView.sublime-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"build_systems":
[
{
"name": "Remove Cache and User Color Schemes",
"cmd": ["rm", "-rf", "Cache", "Packages/User/TerminalView"],
"working_dir": "$project_path/../.."
}
],
"folders":
[
{
"path": ".."
}
],
"settings":
{
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"rulers": [100]
},
"SublimeLinter":
{
"linters":
{
"flake8":
{
"excludes":
[
"*/test/**"
],
"ignore": "W",
"max-line-length": 100
}
}
}
}
21 changes: 21 additions & 0 deletions clear_color_scheme_cache.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Removes all trace of generated color schemes."""
import sublime
import sublime_plugin
import shutil
import os


class TerminalViewClearColorSchemeCacheCommand(sublime_plugin.ApplicationCommand):
"""Removes the folder $cache/User/TerminalView and $packages/User/TerminalView."""

def run(self):
"""Run this command."""
self._force_remove(os.path.join(sublime.cache_path(), "User", "TerminalView"))
self._force_remove(os.path.join(sublime.packages_path(), "User", "TerminalView"))
sublime.message_dialog("Cache is cleared.")

def _force_remove(self, path):
try:
shutil.rmtree(path)
except FileNotFoundError:
pass
Loading