File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ interference with prompts that look like haskell expressions."
76
76
(define-key map (kbd " C-c C-z" ) 'haskell-interactive-switch-back )
77
77
(define-key map (kbd " M-p" ) 'haskell-interactive-mode-history-previous )
78
78
(define-key map (kbd " M-n" ) 'haskell-interactive-mode-history-next )
79
+ (define-key map (kbd " C-c C-p" ) 'haskell-interactive-mode-prompt-previous )
80
+ (define-key map (kbd " C-c C-n" ) 'haskell-interactive-mode-prompt-next )
79
81
(define-key map (kbd " C-<up>" ) 'haskell-interactive-mode-history-previous )
80
82
(define-key map (kbd " C-<down>" ) 'haskell-interactive-mode-history-next )
81
83
(define-key map (kbd " TAB" ) 'haskell-interactive-mode-tab )
@@ -960,6 +962,21 @@ don't care when the thing completes as long as it's soonish."
960
962
(setq haskell-interactive-mode-history-index 0 )
961
963
(haskell-interactive-mode-history-toggle -1 ))))
962
964
965
+ (defun haskell-interactive-mode-prompt-previous ()
966
+ " Jump to the previous prompt."
967
+ (interactive )
968
+ (let ((prev-prompt-pos
969
+ (save-excursion
970
+ (beginning-of-line ) ; ; otherwise prompt at current line matches
971
+ (and (search-backward-regexp (haskell-interactive-prompt-regex) nil t )
972
+ (match-end 0 )))))
973
+ (when prev-prompt-pos (goto-char prev-prompt-pos))))
974
+
975
+ (defun haskell-interactive-mode-prompt-next ()
976
+ " Jump to the next prompt."
977
+ (interactive )
978
+ (search-forward-regexp (haskell-interactive-prompt-regex) nil t ))
979
+
963
980
(defun haskell-interactive-mode-clear ()
964
981
" Clear the screen and put any current input into the history."
965
982
(interactive )
You can’t perform that action at this time.
0 commit comments