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 = ...@@ -38,7 +38,8 @@ applyAction selectionRemoved action =
THEN THEN
( positionAfterMove move selection.start >>>= \newPos -> ( positionAfterMove move selection.start >>>= \newPos ->
vChangeSelectionTo {start=newPos,end=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) IF (move == PageUp || move == PageDown)
THEN THEN
(vMoveCursor move) (vMoveCursor move)
...@@ -56,7 +57,9 @@ applyAction selectionRemoved action = ...@@ -56,7 +57,9 @@ applyAction selectionRemoved action =
) )
) >>>= \newPos -> ) >>>= \newPos ->
vChangeSelectionTo {start=newPos,end=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 vScrollToCursor
) )
......
...@@ -94,7 +94,7 @@ where ...@@ -94,7 +94,7 @@ where
| isNothing maybeOldViewDomain | isNothing maybeOldViewDomain
= abort "vResetViewDomain (EdVisualText.icl): unknown window id" = abort "vResetViewDomain (EdVisualText.icl): unknown window id"
#! oldViewDomain = fromJust maybeOldViewDomain #! oldViewDomain = fromJust maybeOldViewDomain
#! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState // #! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
#! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState) #! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState)
| viewDomain == oldViewDomain | viewDomain == oldViewDomain
#! pState = appPIO (updateWindow windowId Nothing) pState #! pState = appPIO (updateWindow windowId Nothing) pState
...@@ -117,7 +117,7 @@ where ...@@ -117,7 +117,7 @@ where
| isNothing maybeOldViewDomain | isNothing maybeOldViewDomain
= abort "vResetViewDomain (EdVisualText.icl): unknown window id" = abort "vResetViewDomain (EdVisualText.icl): unknown window id"
#! oldViewDomain = fromJust maybeOldViewDomain #! oldViewDomain = fromJust maybeOldViewDomain
#! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState // #! (oldViewFrame,pState) = accPIO (getWindowViewFrame windowId) pState
#! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState) #! (viewDomain,(editState,pState)) = computeViewDomain (editState,pState)
| viewDomain == oldViewDomain | viewDomain == oldViewDomain
#! pState = appPIO (updateWindow windowId Nothing) pState #! pState = appPIO (updateWindow windowId Nothing) pState
......
...@@ -45,30 +45,12 @@ where ...@@ -45,30 +45,12 @@ where
mRemoveSelection :: EditMonad (PSt General) nothing mRemoveSelection :: EditMonad (PSt General) nothing
mRemoveSelection = mRemoveSelection =
getMenuSelection >>>= \mselold ->
accEnv (getMenuIds) >>>= \mIds -> accEnv (getMenuIds) >>>= \mIds ->
let appEnv (appPIO (setMenuElementTitles
mselnew = Nothing [(mIds.mn_odm,"Open Definition...")
fragaction ,(mIds.mn_oim,"Open Implementation...")
| changed mselold mselnew = (handlefrag mselnew mIds >>> setMenuSelection mselnew) ])) >>>
= skip setMenuSelection Nothing
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...")
]))
// control click // 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