Merge branch 'main' of https://github.com/OusmBlueNinja/TermPY
This commit is contained in:
commit
aa5486cf2b
@ -42,4 +42,4 @@ def install(name:str, Packages:list):
|
|||||||
print(f"\n{color.green}Success:{color.white} Successfully installed {name}.")
|
print(f"\n{color.green}Success:{color.white} Successfully installed {name}.")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise Exception(f"{color.red}{e}")
|
raise Exception(f"{color.red}{e}")
|
||||||
|
2
main.py
2
main.py
@ -356,4 +356,4 @@ def start():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
start()
|
start()
|
||||||
|
@ -63,6 +63,8 @@ class TextEditor:
|
|||||||
|
|
||||||
def display(self):
|
def display(self):
|
||||||
print("Editing: " + self.file)
|
print("Editing: " + self.file)
|
||||||
|
termSize = os.get_terminal_size()
|
||||||
|
colms = termSize[0]
|
||||||
for i, line in enumerate(self.lines):
|
for i, line in enumerate(self.lines):
|
||||||
highlighted_line = highlight(line, PythonLexer(), TerminalFormatter())
|
highlighted_line = highlight(line, PythonLexer(), TerminalFormatter())
|
||||||
print(f"{i + 1}: {highlighted_line}", end="")
|
print(f"{i + 1}: {highlighted_line}", end="")
|
||||||
@ -138,4 +140,4 @@ def nano(args):
|
|||||||
editor = TextEditor()
|
editor = TextEditor()
|
||||||
editor.file = filename
|
editor.file = filename
|
||||||
editor.load_file(filename)
|
editor.load_file(filename)
|
||||||
editor.edit()
|
editor.edit()
|
||||||
|
Loading…
Reference in New Issue
Block a user