Moved plugins and refactor command system
- Moved plugins to apropriate sub folders - Refactor command system with new add_command method and rename GetCommandSystemEvent to GetNewCommandSystemEvent - Add RegisterCommandEvent for dynamic command registration - Change footer container orientation to VERTICAL - Add search-highlight tag to source buffer - Add file change detection (deleted, externally modified) in source_file - Add JSON prettify option to source view popup menu - Enable hexpand on VTE widget - Update plugins_controller_mixin to use widget_registry
This commit is contained in:
3
plugins/code/commentzar/mixins/__init__.py
Normal file
3
plugins/code/commentzar/mixins/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
"""
|
||||
Pligin Module Mixin
|
||||
"""
|
||||
30
plugins/code/commentzar/mixins/code_comment_tags_mixin.py
Executable file
30
plugins/code/commentzar/mixins/code_comment_tags_mixin.py
Executable file
@@ -0,0 +1,30 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
class CodeCommentTagsMixin:
|
||||
def get_comment_tags(self, language):
|
||||
start_tag, end_tag = self.get_line_comment_tags(language)
|
||||
if (start_tag, end_tag) == (None, None):
|
||||
start_tag, end_tag = self.get_block_comment_tags(language)
|
||||
|
||||
return start_tag, end_tag
|
||||
|
||||
def get_block_comment_tags(self, language):
|
||||
start_tag = language.get_metadata('block-comment-start')
|
||||
end_tag = language.get_metadata('block-comment-end')
|
||||
|
||||
if start_tag and end_tag: return (start_tag, end_tag)
|
||||
|
||||
return (None, None)
|
||||
|
||||
def get_line_comment_tags(self, language):
|
||||
start_tag = language.get_metadata('line-comment-start')
|
||||
|
||||
if start_tag: return (start_tag, None)
|
||||
|
||||
return (None, None)
|
||||
Reference in New Issue
Block a user