Commit 5dcc1dc6 authored by Diederik van Arkel's avatar Diederik van Arkel
Browse files

Fix 'Find' and 'Search' menu functions for compatibility with OS X;

parent 0ac9bb67
...@@ -358,9 +358,9 @@ instance MenuElements (PlatformItem m) | MenuElements m where ...@@ -358,9 +358,9 @@ instance MenuElements (PlatformItem m) | MenuElements m where
searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds} searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds}
= Menu "&Search" = Menu "&Search"
( MenuItem "&Find..." [ MenuId (findIds!!0), MenuShortKey 'F', MenuModsFunction (shiftfun sr_find) ] ( MenuItem "&Find..." [ MenuId (findIds!!0), MenuShortKey 'F', MenuModsFunction findfun ]
:+: MenuItem "Find &Next" [ MenuId (findIds!!1), MenuShortKey 'G', MenuModsFunction (shiftfun sr_find_next) ] :+: MenuItem "Find &Next" [ MenuId (findIds!!1), MenuShortKey 'G', MenuModsFunction (shiftfun sr_find_next) ]
:+: MenuItem "Find Selection" [ MenuId (findIds!!2), MenuShortKey 'H', MenuModsFunction (shiftfun sr_find_sel) ] :+: MenuItem "Find Selection" [ MenuId (findIds!!2), /*MenuShortKey 'H',*/ MenuModsFunction (shiftfun sr_find_sel) ]
:+: MenuItem "Replace && Find Again" [ MenuId (findIds!!3), MenuShortKey 'T', MenuModsFunction (shiftfun sr_rep_find) ] :+: MenuItem "Replace && Find Again" [ MenuId (findIds!!3), MenuShortKey 'T', MenuModsFunction (shiftfun sr_rep_find) ]
:+: MenuSeparator [] :+: MenuSeparator []
:+: MenuItem "&Search Identifier" :+: MenuItem "&Search Identifier"
...@@ -368,8 +368,8 @@ searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds} ...@@ -368,8 +368,8 @@ searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds}
, MenuModsFunction (shiftfun` sr_find_idi) , MenuModsFunction (shiftfun` sr_find_idi)
: if altgr_workaround [] [MenuShortKey '='] : if altgr_workaround [] [MenuShortKey '=']
] ]
:+: MenuItem "Search Definition" [ MenuId (srchIds!!1), MenuShortKey 'L', MenuModsFunction (shiftfun` sr_find_def) ] :+: MenuItem "Search Definition" [ MenuId (srchIds!!1), MenuShortKey 'L', MenuModsFunction defimpfun ]
:+: MenuItem "Search Implementation" [ MenuId (srchIds!!2), MenuShortKey 'M', MenuModsFunction (shiftfun` sr_find_imp) ] :+: MenuItem "Search Implementation" [ MenuId (srchIds!!2), /*MenuShortKey 'M',*/ MenuModsFunction (shiftfun` sr_find_imp) ]
:+: MenuSeparator [] :+: MenuSeparator []
:+: MenuItem "Goto Next Search &Result" :+: MenuItem "Goto Next Search &Result"
[ MenuId (nextIds!!0) [ MenuId (nextIds!!0)
...@@ -385,6 +385,29 @@ searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds} ...@@ -385,6 +385,29 @@ searchMenu altgr_workaround mSearchId {srchIds,findIds,gotoIds,nextIds}
[ MenuId (mSearchId) [ MenuId (mSearchId)
] ]
where where
findfun mods (ls,ps)
# ps = flip_dir mods.shiftDown ps
| mods.altDown || mods.optionDown
# ps = sr_find ps
# ps = flip_dir mods.shiftDown ps
= (ls,ps)
# ps = sr_find_sel ps
# ps = flip_dir mods.shiftDown ps
= (ls,ps)
where
flip_dir flip ps
| not flip
= ps
# (fi,ps) = getFI ps
# fi = {fi & fi_bw = not fi.fi_bw}
# ps = setFI fi ps
= ps
defimpfun mods (ls,ps)
| mods.altDown || mods.optionDown
# ps = sr_find_imp mods.shiftDown ps
= (ls,ps)
# ps = sr_find_def mods.shiftDown ps
= (ls,ps)
shiftfun fun mods (ls,ps) shiftfun fun mods (ls,ps)
| not mods.shiftDown | not mods.shiftDown
# ps = fun ps # ps = fun ps
......
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