Plan 9 from Bell Labs’s /usr/web/sources/contrib/nemo/octopus/port/live/tundo.m

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Tundo: module {
	PATH:	con "/dis/o/tundo.dis";

	Edit: adt {
		synced:	int;
		pos:		int;		# where to insert/delete
		pick {
		Ins =>
			s:	string;	# text inserted
		Del =>
			s:	string;	# text removed
		}
	};

	Edits: adt {
		e:		array of ref Edit;	# edit operations
		pos:		int;				# where to put next (ongoing) edit in e
		cpos:	int;				# postition in e for a clean edit (current on disk)
		new:		fn(): ref Edits;
		ins:		fn(edits: self ref Edits, s: string, pos: int): int;
		del:		fn(edits: self ref Edits, s: string, pos: int): int;
		sync:	fn(edits: self ref Edits): list of ref Edit;
		undo:	fn(edits: self ref Edits): ref Edit;
		redo:	fn(edits: self ref Edits): ref Edit;
		mkpos:	fn(edits: self ref Edits): int;
		dump:	fn(edits: self ref Edits);
	};

	init:			fn(sysm: Sys, e: Error, dbg: int);
	dtxt:			fn(s: string): string;
};

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].