|
84 | 84 | (defun ocaml-eglot-type-enclosing-decrease-verbosity () |
85 | 85 | "Decrease the verbosity of the current request." |
86 | 86 | (interactive) |
87 | | - (if ocaml-eglot-type-enclosing-verbosity |
88 | | - (progn |
89 | | - (setq ocaml-eglot-type-enclosing-verbosity |
90 | | - (1- ocaml-eglot-type-enclosing-verbosity)) |
91 | | - (when (< ocaml-eglot-type-enclosing-verbosity 1) |
92 | | - (setq ocaml-eglot-type-enclosing-verbosity nil))) |
93 | | - (setq ocaml-eglot-type-enclosing-verbosity nil)) |
| 87 | + (when (and ocaml-eglot-type-enclosing-verbosity |
| 88 | + (> ocaml-eglot-type-enclosing-verbosity 0)) |
| 89 | + (setq ocaml-eglot-type-enclosing-verbosity |
| 90 | + (1- ocaml-eglot-type-enclosing-verbosity))) |
94 | 91 | (ocaml-eglot-type-enclosing--with-fixed-offset)) |
95 | 92 |
|
96 | | - |
97 | 93 | (defun ocaml-eglot-type-enclosing-grow () |
98 | 94 | "Growing of the type enclosing." |
99 | 95 | (interactive) |
|
127 | 123 | (read-only-mode 1) |
128 | 124 | (setq default-directory curr-dir)))) |
129 | 125 |
|
130 | | -(defun ocaml-eglot-type-enclosing--display (type-expr &optional current-enclosing) |
| 126 | +(defun ocaml-eglot-type-enclosing--display (type-expr &optional current) |
131 | 127 | "Display the type-enclosing for TYPE-EXPR in a dedicated buffer. |
132 | | -If CURRENT-ENCLOSING is set, the range of the enclosing will be highlighted." |
| 128 | +If CURRENT is set, the range of the enclosing will be highlighted." |
133 | 129 | (ocaml-eglot-type-enclosing--type-buffer type-expr) |
134 | 130 | (if (ocaml-eglot-util--text-less-than type-expr 8) |
135 | 131 | (message "%s" (with-current-buffer ocaml-eglot-type-buffer-name |
136 | 132 | (font-lock-fontify-region (point-min) (point-max)) |
137 | 133 | (buffer-string))) |
138 | 134 | (display-buffer ocaml-eglot-type-buffer-name)) |
139 | | - (when (and current-enclosing (> (length ocaml-eglot-type-enclosing-types) 0)) |
140 | | - (let ((current-enclosing (aref ocaml-eglot-type-enclosing-types |
| 135 | + (when (and current (> (length ocaml-eglot-type-enclosing-types) 0)) |
| 136 | + (let ((current (aref ocaml-eglot-type-enclosing-types |
141 | 137 | ocaml-eglot-type-enclosing-offset))) |
142 | | - (ocaml-eglot-util--highlight-range current-enclosing |
| 138 | + (ocaml-eglot-util--highlight-range current |
143 | 139 | 'ocaml-eglot-highlight-region-face)))) |
144 | 140 |
|
145 | 141 | (defun ocaml-eglot-type-enclosing--reset () |
|
0 commit comments