Skip to content

Full inferior mode input font locking #1428

@memeplex

Description

@memeplex

I know this is a comint issue and I've already reported at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32344 (please see details there).

But maybe you're interested in adding this workaround to elpy (perhaps optionally depending on a customization option) in order to get full input font locking, it looks really nice!

(advice-add 'comint-send-input
            :around (lambda (f &rest args)
                      (when (eq major-mode 'inferior-python-mode)
                        (cl-letf (((symbol-function 'g)
                                   (symbol-function 'add-text-properties))
                                  ((symbol-function 'add-text-properties)
                                   (lambda (start end properties &optional object)
                                     (unless (eq (nth 3 properties) 'comint-highlight-input)
                                       (g start end properties object)))))
                          (apply f args)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions