Commit fe4d6777 authored by Diederik van Arkel's avatar Diederik van Arkel

Small editor efficiency improvements

parent 787ea9c9
......@@ -38,7 +38,8 @@ applyAction selectionRemoved action =
THEN
( positionAfterMove move selection.start >>>= \newPos ->
vChangeSelectionTo {start=newPos,end=newPos} >>>
mChangeSelectionTo {start=newPos,end=newPos} >>>
// DvA: can skip this as we know we are going from no selection to no selection...
// mChangeSelectionTo {start=newPos,end=newPos} >>>
IF (move == PageUp || move == PageDown)
THEN
(vMoveCursor move)
......@@ -56,7 +57,9 @@ applyAction selectionRemoved action =
)
) >>>= \newPos ->
vChangeSelectionTo {start=newPos,end=newPos} >>>
mChangeSelectionTo {start=newPos,end=newPos} >>>
// DvA: we know we are going from selection to no selection so...
// mChangeSelectionTo {start=newPos,end=newPos} >>>
mRemoveSelection >>>
vScrollToCursor
)
......
......@@ -94,7 +94,7 @@ where
| isNothing maybeOldViewDomain
= abort "vResetViewDomain (EdVisualText.icl): unknown window id"
#! oldViewDomain = fromJust maybeOldViewDomain
#! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
// #! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
#! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState)
| viewDomain == oldViewDomain
#! pState = appPIO (updateWindow windowId Nothing) pState
......@@ -117,7 +117,7 @@ where
| isNothing maybeOldViewDomain
= abort "vResetViewDomain (EdVisualText.icl): unknown window id"
#! oldViewDomain = fromJust maybeOldViewDomain
#! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
// #! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
#! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState)
| viewDomain == oldViewDomain
#! pState = appPIO (updateWindow windowId Nothing) pState
......
......@@ -45,30 +45,12 @@ where
mRemoveSelection :: EditMonad (PSt General) nothing
mRemoveSelection =
getMenuSelection >>>= \mselold ->
accEnv (getMenuIds) >>>= \mIds ->
let
mselnew = Nothing
fragaction
| changed mselold mselnew = (handlefrag mselnew mIds >>> setMenuSelection mselnew)
= skip
in
fragaction
where
changed Nothing Nothing = False
changed (Just strl) (Just strr) = strl <> strr
changed _ _ = True
handlefrag (Just str) mIds
= appEnv (appPIO (setMenuElementTitles
[(mIds.mn_odm,"Open "+++(MakeDefPathname str))
,(mIds.mn_oim,"Open "+++(MakeImpPathname str))
]))
handlefrag _ mIds =
appEnv (appPIO (setMenuElementTitles
[(mIds.mn_odm,"Open Definition...")
,(mIds.mn_oim,"Open Implementation...")
]))
appEnv (appPIO (setMenuElementTitles
[(mIds.mn_odm,"Open Definition...")
,(mIds.mn_oim,"Open Implementation...")
])) >>>
setMenuSelection Nothing
// control click
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment