cider

danielneal 2025-03-05T15:36:42.882539Z

anyone know what I might have wrong / missing in my cider / clojure settings that would cause this issue when trying to autocomplete via tab. It all works in file buffers, but the repl has a weird glitch where when I press tab the cursor jumps backwards before the first paren, and there’s a message saying “Text is read-only”. Video attached

danielneal 2025-03-05T15:48:05.165339Z

Weirdly, it doesn’t even happen immediately. it seems to occur once the app has started up and it’s printed a bunch of logging lines

oyakushev 2025-03-05T15:48:17.467289Z

What functions is bound to Tab in the REPL? C-h k Tab

danielneal 2025-03-05T15:48:38.837319Z

(cider-repl-tab)

oyakushev 2025-03-05T15:49:11.642879Z

I assume you don't use company-mode for completions?

danielneal 2025-03-05T15:50:23.869369Z

I’m a bit sketchy on all the different completion options, but I think I use ivy

danielneal 2025-03-05T15:50:43.687879Z

(straight-use-package 'ivy)
(ivy-mode)

(setq tab-always-indent 'complete)

oyakushev 2025-03-05T15:53:27.049279Z

Might be related to it then, I can't really help you with your particular setup.

oyakushev 2025-03-05T15:53:35.285949Z

Maybe try disabling Ivy to see if it reproduces without it

danielneal 2025-03-05T15:55:25.710729Z

I’ll try that, thanks!

danielneal 2025-03-05T15:56:48.392709Z

yeah it reproduces without ivy

danielneal 2025-03-05T15:58:20.990699Z

it’s almost like something in the printing of logs has changed the text properties of the buffer

danielneal 2025-03-05T15:59:42.995869Z

(logs are from e.g. the jetty server starting)

danielneal 2025-03-05T16:00:01.260409Z

any ideas?

➖ 1
bozhidar 2025-03-05T16:40:37.102239Z

Can you share your CIDER configuration? Seems to me like some weird interaction with another package, but I can't be sure.

❤️ 1
danielneal 2025-03-05T16:42:49.804609Z

(use-package clojure-mode
  :config
  (progn
    (add-to-list 'auto-mode-alist '("\\.cljd\\'" . clojure-mode))))

(use-package cider)
(use-package flycheck-joker)
(use-package clj-refactor)

(add-hook 'clojure-mode-hook
          (lambda ()
            (flycheck-mode t)
            (show-paren-mode t)
	    (clj-refactor-mode t)
	    (paredit-mode)
            (setq clojure-indent-style 'always-align
		  tab-always-indent 'complete
		  cider-test-fail-fast nil
		  cider-print-fn 'puget
		  cider-print-quota (* 1024 512) ; 512kb
		  cider-pprint-options '(("width" 120)))
	    
	    (prism-mode)
            (set-face-attribute 'cider-debug-prompt-face nil
                                :foreground "#FF00FF")
            (set-face-attribute 'cider-debug-code-overlay-face nil
                                :background "#FFFF00"
                                :foreground "#000000")))

(add-hook 'cider-repl-mode-hook
          (lambda ()
	    (prism-mode)
            (paredit-mode)))

danielneal 2025-03-05T16:43:48.664039Z

I’ll try taking out prism mode and then paredit mode from cider-repl-mode hook

danielneal 2025-03-05T16:44:00.155569Z

prism is for block syntax highlighting, not super necessary at the repl. I guess potentially if there’s an issue with that it could leave the buffer in a weird state

danielneal 2025-03-05T16:45:25.344589Z

still happens with prism removed

danielneal 2025-03-05T16:48:21.961119Z

also with paredit removed

danielneal 2025-03-05T16:54:05.234379Z

the only other clue I have is that this first log line (and none of the subsequent ones) from the db pool init is clickable - what makes a clickable log line?

danielneal 2025-03-05T17:21:33.757449Z

Maybe I can use that to make a minimal repro

danielneal 2025-03-06T10:27:31.342109Z

^ I’ve been able to work around this issue by running cider-log-show and sending all the logs to the special log buffer instead of allowing them to interleave with the REPL

rolt 2025-03-06T15:25:29.041679Z

I have a similar issue when the repl buffer gets big: https://clojurians.slack.com/archives/C0617A8PQ/p1686225829376799 It's not really a problem anymore because I have way less things printed to that buffer but I never found the root of the issue

danielneal 2025-03-06T15:51:07.973999Z

ah interesting, sounds like the same kinda thing. Is it definitely when the repl buffer gets big, or do certain types of output trigger it, like in my case?