EdMovement.dcl 616 Bytes
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
definition module EdMovement

3
4
5
from	StdClass		import class ==, class toString, class fromString
from	EdSelection		import :: Position, :: ColumnNr, :: LineNr
import	EdMonad
Diederik van Arkel's avatar
Diederik van Arkel committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

:: Movement
	= LineUp
	| LineDown
	| CharLeft
	| CharRight
	| WordLeft
	| WordRight
	| PageUp
	| PageDown
	| StartOfLine
	| EndOfLine
	| StartOfText
	| EndOfText

instance == Movement
instance toString Movement
instance fromString Movement

Diederik van Arkel's avatar
Diederik van Arkel committed
25
positionAfterMove	:: !Movement !Position	->	EditMonad (PSt .l) Position
Diederik van Arkel's avatar
Diederik van Arkel committed
26
27
28
isVerticalMove		:: !Movement			->	Bool
selectWordAt		:: !Position			->	EditMonad .env Selection 
allMovements		::							[Movement]