Skip to content
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

Customizable prompt fixes #490

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Ambrevar
Copy link
Contributor

This rebases #365 onto master.

It includes the last 2 fixes:

  • Derive the default value of next-entry-idx from the last button.
  • Fix the prompt coloring.

Indeed, in #360 (comment) I mentioned that coloring was broken. Here is the custom prompt I'm using which displays how coloring is broken on master and fixed with this patch:

(cl-defun ambrevar/sly-new-prompt (_package
                                package-nickname
                                error-level
                                entry-idx
                                _condition)
  (concat
   "("
   (propertize (abbreviate-file-name default-directory) 'font-lock-face 'diff-added)
   ")\n"
   (propertize "<" 'font-lock-face 'sly-mrepl-prompt-face)
   (propertize (number-to-string entry-idx) 'font-lock-face 'sly-mode-line)
   (propertize ":" 'font-lock-face 'sly-mrepl-prompt-face)
   (propertize package-nickname 'font-lock-face 'sly-mode-line)
   (when (cl-plusp error-level)
     (concat (sly-make-action-button
              (format "[%d]" error-level)
              #'sly-db-pop-to-debugger-maybe)
             " "))
   (propertize "> " 'font-lock-face 'sly-mrepl-prompt-face)))

* contrib/sly-mrepl.el (sly-mrepl--insert-prompt): Derive next entry index from
the last button.
* contrib/sly-mrepl.el (sly-mrepl--insert-prompt):
Remove the comint-highlight-prompt face from the prompt.
Remove the now useless call to sly-mrepl--ensure-prompt-face.

(sly-mrepl--send-input-sexp): Remove the call to sly-mrepl--ensure-prompt-face
since it would reset the face of the last prompt.

(sly-mrepl--ensure-prompt-face): Remove since it isn't used anywhere anymore.

(sly-mrepl--remove-comint-highlight): New helper to help removing the face.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant