Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Haskell-mouse/haskeline
  • supersven/haskeline
2 results
Show changes
Commits on Source (4)
......@@ -46,6 +46,8 @@ simpleActions = choiceCmd
, completionCmd (simpleChar '\t')
, simpleKey UpKey +> historyBack
, simpleKey DownKey +> historyForward
, simpleKey SearchReverse +> searchForPrefix Reverse
, simpleKey SearchForward +> searchForPrefix Forward
, searchHistory
]
......
......@@ -33,12 +33,14 @@ instance Show Modifier where
noModifier :: Modifier
noModifier = Modifier False False False
-- Note: a few of these aren't really keys (e.g., KillLine),
-- but they provide useful enough binding points to include.
data BaseKey = KeyChar Char
| FunKey Int
| LeftKey | RightKey | DownKey | UpKey
-- TODO: is KillLine really a key?
| KillLine | Home | End | PageDown | PageUp
| Backspace | Delete
| SearchReverse | SearchForward
deriving (Show,Eq,Ord)
simpleKey :: BaseKey -> Key
......@@ -77,6 +79,8 @@ specialKeys = [("left",LeftKey)
,("tab",KeyChar '\t')
,("esc",KeyChar '\ESC')
,("escape",KeyChar '\ESC')
,("reversesearchhistory",SearchReverse)
,("forwardsearchhistory",SearchForward)
]
parseModifiers :: [String] -> BaseKey -> Key
......
......@@ -61,6 +61,8 @@ simpleInsertions = choiceCmd
, ctrlChar 'l' +> clearScreenCmd
, simpleKey UpKey +> historyBack
, simpleKey DownKey +> historyForward
, simpleKey SearchReverse +> searchForPrefix Reverse
, simpleKey SearchForward +> searchForPrefix Forward
, searchHistory
, simpleKey KillLine +> killFromHelper (SimpleMove moveToStart)
, ctrlChar 'w' +> killFromHelper wordErase
......