@@ -1253,6 +1253,20 @@ Set this to nil to prevent truncation."
1253
1253
" Expand the text hidden under overlay BUTTON."
1254
1254
(delete-overlay button ))
1255
1255
1256
+ (defun nrepl--expand-button-mouse (event )
1257
+ " Expand the text hidden under overlay BUTTON."
1258
+ (interactive " e" )
1259
+ (pcase (elt event 1 )
1260
+ (`(, window , _ , _ , _ , _ , point . , _ )
1261
+ (with-selected-window window
1262
+ (nrepl--expand-button (button-at point))))))
1263
+
1264
+ (define-button-type 'nrepl--collapsed-dict
1265
+ 'display " ..."
1266
+ 'action #'nrepl--expand-button
1267
+ 'face 'link
1268
+ 'help-echo " RET: Expand dict." )
1269
+
1256
1270
(defun nrepl--pp (object &optional foreground )
1257
1271
" Pretty print nREPL OBJECT, delimited using FOREGROUND."
1258
1272
(if (not (and (listp object)
@@ -1282,12 +1296,9 @@ Set this to nil to prevent truncation."
1282
1296
(> (count-screen-lines l (point ) t )
1283
1297
nrepl-dict-max-message-size))
1284
1298
(make-button (1+ l) (point )
1285
- 'display " ..."
1286
- 'action #'nrepl--expand-button
1287
- 'mouse-action #'nrepl--expand-button
1288
- 'face 'link
1289
- 'help-echo " RET: Expand dict."
1290
- 'follow-link t ))))
1299
+ :type 'nrepl--collapsed-dict
1300
+ ; ; Workaround for bug#1568.
1301
+ 'local-map '(keymap (mouse-1 . nrepl--expand-button-mouse))))))
1291
1302
(insert (color " )\n " ))))))))
1292
1303
1293
1304
(defun nrepl-messages-buffer-name (conn )
0 commit comments