EdMovement.dcl 653 Bytes
Newer Older
Diederik van Arkel's avatar
Diederik van Arkel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * EdMovement.dcl: the Movement type and operations on it
 */

definition module EdMovement

from StdClass import ==, toString, fromString
from EdSelection import Position, ColumnNr, LineNr
import EdMonad

:: 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
29
positionAfterMove	:: !Movement !Position	->	EditMonad (PSt .l) Position
Diederik van Arkel's avatar
Diederik van Arkel committed
30
31
32
isVerticalMove		:: !Movement			->	Bool
selectWordAt		:: !Position			->	EditMonad .env Selection 
allMovements		::							[Movement]