summaryrefslogtreecommitdiff
path: root/src/GF/Shell/CommandL.hs
diff options
context:
space:
mode:
authoraarne <unknown>2003-09-25 11:42:20 +0000
committeraarne <unknown>2003-09-25 11:42:20 +0000
commit49f6288350a722837a316f86d1442c59d7ea8fc8 (patch)
treebeac6e76ad7f1934ca81409a0fd4927c9ee74913 /src/GF/Shell/CommandL.hs
parent6e9258558a9bcb8c9df4bee0382b5136c95f516a (diff)
The new tree position annotation, and the corresponding command.
Diffstat (limited to 'src/GF/Shell/CommandL.hs')
-rw-r--r--src/GF/Shell/CommandL.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/GF/Shell/CommandL.hs b/src/GF/Shell/CommandL.hs
index 463b3d4e4..d1ba0f7ba 100644
--- a/src/GF/Shell/CommandL.hs
+++ b/src/GF/Shell/CommandL.hs
@@ -63,6 +63,7 @@ pCommand = pCommandWords . words where
"<<" : _ -> CPrevMeta
"'" : _ -> CTop
"+" : _ -> CLast
+ "mp" : p -> CMovePosition (readIntList (unwords p))
"r" : f : _ -> CRefineWithAtom f
"w" : f:i : _ -> CWrapWithFun (strings2Fun f, readIntArg i)
"ch": f : _ -> CChangeHead (strings2Fun f)
@@ -133,3 +134,9 @@ initEditMsgEmpty env = initEditMsg env +++++ unlines (
showCurrentState env' state' =
unlines (tr ++ ["",""] ++ msg ++ ["",""] ++ map fst menu)
where (tr,msg,menu) = displaySStateIn env' state'
+
+-- to read position; borrowed from Prelude; should be elsewhere
+readIntList :: String -> [Int]
+readIntList s = case [x | (x,t) <- reads s, ("","") <- lex t] of
+ [x] -> x
+ _ -> []