-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MarkdownCodeExporter #9005
Add MarkdownCodeExporter #9005
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated testing result: SUCCESS
Repo link: MarkdownCodeExporter
Packages added:
- MarkdownCodeExporter
Processing package "MarkdownCodeExporter"
- All checks passed
Thanks for your submission. Some remarks, thoughts:
|
Thanks for the valuable review!
I gave it a try and used async version. But this time long texts caused a lag. I'm not an expert on async stuff. Would you like to test it on your side, such that replace "on_modified" with "on_modified_async" and create a md document which have 20 times of this code block:
Then try to insert any char to anywhere in the document. On my ST version (3125) unacceptable lags occur with the async version. Non-async function works with almost zero lag. I can only notice a small lag when the document has more than 500 code blocks. |
Good idea but there is a limitation with the ST API. In the Instead I can move that check to --- main.py
+++ main.py
@@ -5,16 +5,16 @@
from html import escape
class MarkdownCodeExporter(sublime_plugin.ViewEventListener):
- @classmethod
- def is_applicable(cls, settings):
- return settings.get('syntax', '').lower().find('markdown') != -1
-
def __init__(self, view):
super().__init__(view)
self.phantom_set = sublime.PhantomSet(view)
self.update_phantoms()
def on_modified(self):
+ # Limit the event listener to Markdown.
+ if sublime.score_selector(self.view.scope_name(0), "text.html.markdown") == 0:
+ return
+
self.update_phantoms()
def on_load(self): But this time I loose the performance benefit of I think we can safely assume that almost any Markdown syntax file has a "markdown" phrase in its file name. Thus keep the existing approach. What is your opinion? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automated testing result: SUCCESS
Repo link: MarkdownCodeExporter
Packages added:
- MarkdownCodeExporter
Processing package "MarkdownCodeExporter"
- All checks passed
Created an issue: SublimeText-Markdown/MarkdownCodeExporter#1
Created an issue: SublimeText-Markdown/MarkdownCodeExporter#2
Created an issue: SublimeText-Markdown/MarkdownCodeExporter#3
Created an issue: SublimeText-Markdown/MarkdownCodeExporter#4 Once I have time, I'll look into these feedbacks. Thanks for them. In its current state, I believe the plugin is ready to be published. P.S. Please be aware that today I transferred my repo to another organizaton and pushed a commit to this PR to reflect that. |
Excellent, have fun developing your package! |
My package is MarkdownCodeExporter
There are no packages like it in Package Control.