MCPcopy Create free account
hub / github.com/RetiredWizard/PyDOS / edit_loop

Method edit_loop

pye.py:962–992  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

960 self.redraw(True)
961 return key
962 def edit_loop(self):
963 if not self.content:
964 self.content = [""]
965 self.total_lines = len(self.content)
966 os.chdir(self.work_dir)
967 self.redraw(self.message == "")
968 while True:
969 self.display_window()
970 key, char = self.get_input()
971 self.message = ''
972 key = self.handle_edit_keys(key, char)
973 if key == KEY_QUIT:
974 if self.hash != self.hash_buffer():
975 res = self.line_edit("File changed! Quit (y/N/f)? ", "N")
976 if not res or res[0].upper() == 'N':
977 continue
978 if res[0].upper() == 'F':
979 key = KEY_FORCE_QUIT
980 self.scroll_region(0)
981 self.mouse_reporting(False)
982 self.goto(Editor.height, 0)
983 self.clear_to_eol()
984 self.undo = []
985 return key
986 elif key == KEY_NEXT:
987 return key
988 elif key == KEY_GET:
989 if self.mark is not None:
990 self.clear_mark()
991 self.display_window()
992 return key
993 def packtabs(self, s):
994 sb = StringIO()
995 for i in range(0, len(s), 8):

Callers 1

pye_editFunction · 0.80

Calls 11

redrawMethod · 0.95
display_windowMethod · 0.95
get_inputMethod · 0.95
handle_edit_keysMethod · 0.95
hash_bufferMethod · 0.95
line_editMethod · 0.95
scroll_regionMethod · 0.95
mouse_reportingMethod · 0.95
gotoMethod · 0.95
clear_to_eolMethod · 0.95
clear_markMethod · 0.95

Tested by

no test coverage detected