You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mini.nvim/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,8 @@ There are following change types:
171
171
172
172
- Update `zoom()` to return whether current buffer is zoomed in. By @loichyan, PR #1954.
173
173
174
+
- Add `log_add()` and related functions (`log_get()`, `log_show()`, `log_clear()`) to work with a special in-memory log array. Useful when debugging Lua code (instead of `print()`).
Copy file name to clipboardExpand all lines: mini.nvim/doc/mini-misc.qmd
+108Lines changed: 108 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ Features the following functions:
18
18
Useful in combination with `stat_summary()`.
19
19
20
20
21
+
-[MiniMisc.log\_add()](https://neovim.io/doc/user/helptag.html?tag=MiniMisc.log_add\(\)), [MiniMisc.log\_show()](https://neovim.io/doc/user/helptag.html?tag=MiniMisc.log_show\(\)) and other helper functions to work
22
+
with a special in-memory log array. Useful when debugging Lua code.
23
+
24
+
21
25
-[MiniMisc.put()](mini-misc.qmd#minimisc.put) and [MiniMisc.put\_text()](mini-misc.qmd#minimisc.put_text) to pretty print its arguments
22
26
into command line and current buffer respectively.
23
27
@@ -141,6 +145,110 @@ Compute width of gutter (info column on the left of the window)
<spanclass="help-syntax-special">{state}</span> `(any)` Data about current state.
174
+
175
+
<spanclass="help-syntax-special">{opts}</span> `(table|nil)` Options. Possible fields:
176
+
177
+
- <spanclass="help-syntax-keys">\<deepcopy\></span> - (boolean) Whether to apply [vim.deepcopy](https://neovim.io/doc/user/helptag.html?tag=vim.deepcopy) to the <spanclass="help-syntax-special">{state}</span>.
178
+
Usually helpful to record the exact state during code execution and avoid
179
+
side effects of tables being changed in-place. Default `true`.
180
+
181
+
#### Usage {#minimisc.log_add-usage}
182
+
183
+
184
+
185
+
```lua
186
+
localt= { a=1 }
187
+
MiniMisc.log_add('before', { t=t }) -- Will show `t = { a = 1 }` state
188
+
t.a=t.a+1
189
+
MiniMisc.log_add('after', { t=t }) -- Will show `t = { a = 2 }` state
190
+
191
+
-- Use `:lua MiniMisc.log_show()` or `:=MiniMisc.log_get()` to see the log
192
+
```
193
+
194
+
#### See also {#minimisc.log_add-seealso}
195
+
196
+
197
+
198
+
-[MiniMisc.log\_get()](https://neovim.io/doc/user/helptag.html?tag=MiniMisc.log_get\(\)) to get log array
199
+
200
+
-[MiniMisc.log\_show()](https://neovim.io/doc/user/helptag.html?tag=MiniMisc.log_show\(\)) to show log array in the dedicated buffer
201
+
202
+
-[MiniMisc.log\_clear()](https://neovim.io/doc/user/helptag.html?tag=MiniMisc.log_clear\(\)) to clear the log array
Copy file name to clipboardExpand all lines: mini.nvim/readmes/mini-misc.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ If you want to help this project grow but don't know where to start, check out [
35
35
## Features
36
36
37
37
-`bench_time()` executes function several times and timing how long it took.
38
+
-`log_add()` / `log_show()` and other helper functions to work with a special in-memory log array. Useful when debugging Lua code (instead of `print()`).
38
39
-`put()` and `put_text()` print Lua objects in command line and current buffer respectively.
39
40
-`resize_window()` resizes current window to its editable width.
40
41
-`setup_auto_root()` sets up automated change of current directory.
0 commit comments