Skip to content

Commit 424260b

Browse files
committed
feat: added topic prompt
1 parent 4b5d8d3 commit 424260b

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mmdv.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def run(self, edit):
1212
class MmdvCommand(sublime_plugin.TextCommand):
1313
def __init__(self, view):
1414
super().__init__(view)
15-
self.BASE_URL = 'mem.dev'
16-
self.connection = 'https'
15+
self.BASE_URL = 'localhost:3000'
16+
self.connection = 'http'
1717
self.__title = ''
1818
self.__content = ''
1919

@@ -56,14 +56,21 @@ def send_snippet(self):
5656
'content': self.__content,
5757
'title': self.__title,
5858
'syntax': syntax,
59-
'topic': syntax
59+
'topic': self.__topic
6060
}
6161

6262
response_json = self.__api('/api/v2/snippets', params)
6363

6464
window = self.view
6565
window.show_popup('Your snippet has been saved!')
6666

67+
def on_topic_input_done(self, val):
68+
window = self.view.window()
69+
self.__topic = val
70+
if val:
71+
window.show_input_panel("I just learned how to...", "", self.on_title_input_done, None, None)
72+
73+
6774
def on_title_input_done(self, input_string):
6875
self.__title = input_string
6976
window = self.view.window()
@@ -80,4 +87,4 @@ def run(self, edit):
8087
region1 = sel[0]
8188
self.__content = view.substr(region1)
8289

83-
window.show_input_panel("I just learned how to...", "", self.on_title_input_done, None, None)
90+
window.show_input_panel("This snippet is about...", "", self.on_topic_input_done, None, None)

0 commit comments

Comments
 (0)