Optimized code runner and implemented basic IDE feature in app.ed

This commit is contained in:
Luxferre
2025-12-26 16:12:08 +02:00
parent e66ebd50a9
commit c6f567b0ba
4 changed files with 53 additions and 7 deletions
+6
View File
@@ -5,6 +5,7 @@
from deck.input import input
from deck.pager import print_paged
from deck.runtime import runcode
class Ed:
def __init__(self, filename=None):
@@ -191,6 +192,11 @@ class Ed:
self.filename = params
print(self.filename if self.filename else "No current filename")
elif cmd_char == 'x': # execute current buffer range as Python code
code = '\n'.join(self.buffer[start-1:end])
print(f'Running lines {start} to {end} as Python code...')
runcode(code)
else:
print("Unknown command")