Skip to content

Commit

Permalink
Update the key bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
GordonZhang2024 committed May 26, 2024
1 parent c89aee1 commit fe210e7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ def new_file():

# Add keyboard shortcuts
editor.bind('<Button-3>', show_popup_menu)
editor.bind('Control-C', copy)
editor.bind('Control-V', paste)
editor.bind('Control-S', save)
editor.bind('Control-P', load_preview)
editor.bind('<Control-C>', copy)
editor.bind('<Control-V>', paste)
editor.bind('<Control-S>', save)
editor.bind('<Control-P>', load_preview)
editor.bind('<F1>', show_project_info)
editor.bind('<F5>', load_preview)

Expand Down
32 changes: 32 additions & 0 deletions src/error_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3

"""
Module error_generator
======================
Generate a Markdown syntax error or warning.
"""

class ErrorGenerator:
"""
Class ErrorGenerator
====================
The error generator for tkMarker.
"""
def generate(self, level: int, text: str):
"""
Function generate()
===================
Generate an error.
"""
match level:
case 0:
self.print('WARNING ')
case 1:
self.print('ERROR')
self.print(text, '\n')
def print(self, *values):
print(values, flush=True, end='')

0 comments on commit fe210e7

Please sign in to comment.