Skip to content

Commit 6d5f5c3

Browse files
authored
Update tkintermd_frame.py
Got preview updating.
1 parent 2e2cce3 commit 6d5f5c3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tkintermd/tkintermd_frame.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def __init__(self, master, **kwargs):
117117

118118
# Bind mouse/key events to functions.
119119
self.text_area.bind("<<Modified>>", self.on_input_change)
120+
self.text_area.edit_modified(0)#resets the text widget to generate another event when another change occours
121+
120122
self.text_area.bind_all("<Control-f>", self.find)
121123
self.text_area.bind_all("<Control-a>", self.select_all)
122124
self.text_area.bind("<Button-3>", self.popup)
@@ -208,7 +210,7 @@ def on_input_change(self, event):
208210
self.preview_area.load_html(html)
209211
# self.preview_area.add_css("body {background-color: #272822; color: white;}")
210212
self.check_markdown(start="1.0", end=END)
211-
self.text_area.edit_modified(0)
213+
self.text_area.edit_modified(0)#resets the text widget to generate another event when another change occours
212214

213215
def load_style(self, stylename):
214216
"""Load Pygments style for syntax highlighting within the editor."""
@@ -271,4 +273,4 @@ class Lexer(MarkdownLexer):
271273
bygroups(Generic.StrongEmph)))
272274
# # bold-italic fenced by '___'
273275
tokens['inline'].insert(2, (r'(\_\_\_[^_ \n][^_\n]*\_\_\_)',
274-
bygroups(Generic.StrongEmph)))
276+
bygroups(Generic.StrongEmph)))

0 commit comments

Comments
 (0)