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
This change introduces a persistent counter value, so that it persists
between NeoVim invocations and even between multiple NeoVim instances
open at the same time. This is done by storing a small state file in
NeoVim's data directory.
If you don't like this behaviour, you can revert back to the old
behaviour by using a custom `display_counter` option, as shown in the
showcase: https://github.com/andrewferrier/debugprint.nvim/blob/main/SHOWCASE.md#restoring-non-persistent-display_counter-counter
|`move_to_debugline`|`false`| When adding a debug line, moves the cursor to that line |
185
188
|`display_location`|`true`| Include the filename and linenumber of the line being debugged in the debug message |
186
-
|`display_counter`|`true`| Include the increasing integer counter in the debug message. (Can also be set to a function to customize, see the [showcase](SHOWCASE.md#use-a-custom-display_counter-counter)) for an example |
189
+
|`display_counter`|`true`| Include the increasing integer counter in the debug message. (Can also be set to a function to customize, see the [showcase](SHOWCASE.md#restoring-non-persistent-display_counter-counter)) for an example |
187
190
|`display_snippet`|`true`| Include a snippet of the line above/below in the debug message (plain debug lines only) for context |
188
191
|`filetypes`| See ([the code](lua/debugprint/filetypes.lua)) | Custom filetypes - see [showcase](SHOWCASE.md)|
189
192
|`print_tag`|`DEBUGPRINT`| The string inserted into each print statement, which can be used to uniquely identify statements inserted by `debugprint`. If you set this to `''` (the empty string), no print tag will be included, but this will disable the ability to delete or comment print statements via `debugprint`|
@@ -205,6 +208,7 @@ they are used to convert sections to ROT-13, which most folks don't use.
The `display_counter`option can be set to a custom callback function to implement custom counter logic. In this case you are responsible for implementing your own counter. For example, this logic will implement essentially the same as the default counter:
131
+
In older versions, `debugprint` used a `display_counter`which was only local to a particular NeoVim session; it was reset when exiting NeoVim and wasn't common between NeoVim sessions in different terminals. If you don't like the new 'persistent' counter, you can restore this old behaviour by setting a custom `display_counter`. This will recreate the old logic:
132
132
133
133
```lua
134
134
localcounter=0
@@ -141,6 +141,8 @@ end
141
141
debugprint.setup({display_counter=counter_func})
142
142
```
143
143
144
+
You can also set `display_counter` to any other function you wish.
145
+
144
146
## Using package managers other than lazy.nvim
145
147
146
148
Example for [`packer.nvim`](https://github.com/wbthomason/packer.nvim):
0 commit comments