-
Notifications
You must be signed in to change notification settings - Fork 51
Add tool-bar icons #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add tool-bar icons #237
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -825,6 +825,20 @@ Debug logging has an noticeable effect on performance." | |
| If valid connection, this connection will be of highest priority when | ||
| querying for connections with `dape--live-connection'.") | ||
|
|
||
| (defvar dape-tool-bar-map | ||
| (let ((map (make-sparse-keymap))) | ||
| (dolist (x '((dape-continue "gud/go" "Continue") | ||
| (dape-next "gud/next" "Next") | ||
| (dape-step-in "gud/step" "Step in") | ||
| (dape-step-out "gud/finish" "Step out") | ||
| (dape-pause "mpc/pause" "Pause") | ||
| (dape-restart "refresh" "Restart") | ||
| (dape-quit "gud/stop" "Quit")) | ||
| map) | ||
| (tool-bar-local-item | ||
| (nth 1 x) (car x) (car x) map | ||
| :help (nth 2 x))))) | ||
|
|
||
| (define-minor-mode dape-active-mode | ||
| "On when dape debugging session is active. | ||
| Non interactive global minor mode." | ||
|
|
@@ -4758,7 +4772,8 @@ If EXPRESSIONS is non blank add or remove expression to watch list." | |
| scroll-conservatively 101 | ||
| comint-input-sender 'dape--repl-input-sender | ||
| comint-prompt-regexp (concat "^" (regexp-quote dape--repl-prompt)) | ||
| comint-process-echoes nil) | ||
| comint-process-echoes nil | ||
| tool-bar-map dape-tool-bar-map) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should to the same in |
||
| (add-to-list 'overlay-arrow-variable-list 'dape--repl-marker) | ||
| (add-hook 'completion-at-point-functions | ||
| #'dape--repl-completion-at-point nil t) | ||
|
|
@@ -4803,6 +4818,20 @@ Empty input will rerun last command.\n\n" | |
| (when (called-interactively-p 'interactive) | ||
| (select-window window))))) | ||
|
|
||
|
|
||
| ;;; Tool bar config | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we just call this sections Tool bar? |
||
|
|
||
| (defun dape-update-tool-bar () | ||
| (if (not dape-active-mode) | ||
| (dolist (buffer (buffer-list)) | ||
| (with-current-buffer buffer | ||
| (when (eq tool-bar-map dape-tool-bar-map) | ||
| (kill-local-variable 'tool-bar-map)))) | ||
| (unless (eq tool-bar-map dape-tool-bar-map) | ||
| (setq-local tool-bar-map dape-tool-bar-map)))) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be fine to have only dape-*-mode buffers having a tool bar but as dape does not select repl it is quite awkward to first select repl then use the buttons. The reason I am bringing this up is that this will only prime the buffers opened when dape starts with the tool bar but not new buffers created by dape (Also we should restore local value of tool-bar-map if we overwrite it). I see two options:
If we go with option (2.) we should probobly use WDYT? If we feel fine with using repl as the initial selection I think it's preferable to skip the bookkeeping needed for (2.). If you have any other alternative ideas please share
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find using find-file-hook (2.) somewhat complex, since it will add the tool-bar icons to any unrelated file, for example an elisp file from another project. I think that adding the icons to only the repl buffer would be the best choice, but the problem is that cursor have to be in the repl buffer (since tool-bar icons are buffer-local) Another idea would be to use the header-line, since it is rarely used, and unlike the tool-bar, the icons are kept even if you're not in the repl buffer |
||
|
|
||
| (add-hook 'dape-active-mode-hook #'dape-update-tool-bar) | ||
|
|
||
|
|
||
| ;;; Inlay hints | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All
defvarshould contain docs