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 ...@@ -46,6 +46,8 @@ simpleActions = choiceCmd
, completionCmd (simpleChar '\t') , completionCmd (simpleChar '\t')
, simpleKey UpKey +> historyBack , simpleKey UpKey +> historyBack
, simpleKey DownKey +> historyForward , simpleKey DownKey +> historyForward
, simpleKey SearchReverse +> searchForPrefix Reverse
, simpleKey SearchForward +> searchForPrefix Forward
, searchHistory , searchHistory
] ]
......
...@@ -33,12 +33,14 @@ instance Show Modifier where ...@@ -33,12 +33,14 @@ instance Show Modifier where
noModifier :: Modifier noModifier :: Modifier
noModifier = Modifier False False False 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 data BaseKey = KeyChar Char
| FunKey Int | FunKey Int
| LeftKey | RightKey | DownKey | UpKey | LeftKey | RightKey | DownKey | UpKey
-- TODO: is KillLine really a key?
| KillLine | Home | End | PageDown | PageUp | KillLine | Home | End | PageDown | PageUp
| Backspace | Delete | Backspace | Delete
| SearchReverse | SearchForward
deriving (Show,Eq,Ord) deriving (Show,Eq,Ord)
simpleKey :: BaseKey -> Key simpleKey :: BaseKey -> Key
...@@ -77,6 +79,8 @@ specialKeys = [("left",LeftKey) ...@@ -77,6 +79,8 @@ specialKeys = [("left",LeftKey)
,("tab",KeyChar '\t') ,("tab",KeyChar '\t')
,("esc",KeyChar '\ESC') ,("esc",KeyChar '\ESC')
,("escape",KeyChar '\ESC') ,("escape",KeyChar '\ESC')
,("reversesearchhistory",SearchReverse)
,("forwardsearchhistory",SearchForward)
] ]
parseModifiers :: [String] -> BaseKey -> Key parseModifiers :: [String] -> BaseKey -> Key
......
...@@ -61,6 +61,8 @@ simpleInsertions = choiceCmd ...@@ -61,6 +61,8 @@ simpleInsertions = choiceCmd
, ctrlChar 'l' +> clearScreenCmd , ctrlChar 'l' +> clearScreenCmd
, simpleKey UpKey +> historyBack , simpleKey UpKey +> historyBack
, simpleKey DownKey +> historyForward , simpleKey DownKey +> historyForward
, simpleKey SearchReverse +> searchForPrefix Reverse
, simpleKey SearchForward +> searchForPrefix Forward
, searchHistory , searchHistory
, simpleKey KillLine +> killFromHelper (SimpleMove moveToStart) , simpleKey KillLine +> killFromHelper (SimpleMove moveToStart)
, ctrlChar 'w' +> killFromHelper wordErase , ctrlChar 'w' +> killFromHelper wordErase
......