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

Enable syntax highlighting in the listener as well #910

Merged
merged 1 commit into from
Aug 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/lisp-mode/repl.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:mode-hook *lisp-repl-mode-hook*)
(cond
((eq (repl-buffer) (current-buffer))
(setf (variable-value 'enable-syntax-highlight) t)
(repl-reset-input)
(lem/listener-mode:start-listener-mode (merge-pathnames "history/lisp-repl" (lem-home)))
(setf (variable-value 'completion-spec) 'repl-completion)
Expand Down
3 changes: 2 additions & 1 deletion src/base/line.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@

(defun line-string/attributes (line)
(cons (line-str line)
(getf (line-plist line) :attribute)))
(append (getf (line-plist line) :sticky-attribute)
(getf (line-plist line) :attribute))))

(defun line-free (line)
(when (line-prev line)
Expand Down
5 changes: 2 additions & 3 deletions src/ext/listener-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

(defun start-listener-mode (&optional history-pathname)
(listener-mode t)
(setf (variable-value 'enable-syntax-highlight) nil)
(unless (listener-history (current-buffer))
(setf (listener-history (current-buffer))
(lem/common/history:make-history :pathname history-pathname))
Expand Down Expand Up @@ -113,7 +112,7 @@
(line-start s)
(let ((attribute (variable-value 'listener-prompt-attribute :default buffer)))
(when attribute
(put-text-property s point :attribute attribute)))
(put-text-property s point :sticky-attribute attribute)))
(put-text-property s point :read-only t)
(put-text-property s point :field t))))

Expand Down Expand Up @@ -231,7 +230,7 @@
(with-point ((start point)
(end point))
(character-offset end 1)
(put-text-property start end :attribute attribute)))
(put-text-property start end :sticky-attribute attribute)))
(buffer-start point)
buffer))

Expand Down