Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking changes #25

Open
andrewferrier opened this issue Aug 13, 2022 · 6 comments
Open

Breaking changes #25

andrewferrier opened this issue Aug 13, 2022 · 6 comments

Comments

@andrewferrier
Copy link
Owner

Please subscribe to this issue to be informed of any breaking changes to debugprint.nvim.

@andrewferrier andrewferrier pinned this issue Aug 13, 2022
@andrewferrier
Copy link
Owner Author

andrewferrier commented Aug 13, 2022

As of commit a8900d7fc, all default keymappings have been changed to start with g?. The 4 defaults are now:

  • g?p - debug line below
  • g?P - debug line above
  • g?v - variable line below
  • g?V - variable above

Apologies for making this change so early in the lifetime of debugprint, but I realized that dqp was too limiting for supporting other NeoVim modes (e.g. forthcoming visual mode), and I decided to make the change now to prioritize consistency whilst folks are still picking up the plugin. I do not plan to change these defaults regularly!

The old keybindings will continue to work for a while, with a warning message.

If you want to continue to use the previous/old keybindings permanently, please set your configuration up like this. Note that this will require you to keep maintaining custom keybindings in the future when we introduce others.

    use({
        "andrewferrier/debugprint.nvim",
        config = function()
            require("debugprint").setup({ create_keymaps = false })
        end,
    })

    vim.keymap.set("n", "dqp", function()
        return require('debugprint').debugprint()
    end, {
        expr = true,
    })
    vim.keymap.set("n", "dqP", function()
        return require('debugprint')({ above = true })
    end, {
        expr = true,
    })
    vim.keymap.set("n", "dQp", function()
        return require('debugprint')({ variable = true })
    end, {
        expr = true,
    })
    vim.keymap.set("n", "dQP", function()
        return require('debugprint')({ above = true, variable = true })
    end, {
        expr = true,
     })

@andrewferrier
Copy link
Owner Author

This is technically not a breaking change, but commit ffaaee1 includes a change to the default plain (not variable) debug lines such that they contain a snippet of the line above or below them, to help orientate you when viewing output.

I think this is really helpful, but if you don't like this change, you can go back to the old behaviour by setting the global option display_snippet to false.

@andrewferrier
Copy link
Owner Author

As of commit e1827741b7b8, debugprint.nvim requires NeoVim 0.8+ and will issue a warning on startup if it's not present. This is because nvim-treesitter has required 0.8+ for some time, and although this is only an optional dependency for debugprint.nvim, it causes some of the tests to break and we cannot afford the overhead of managing the behaviour separately for 0.7.

If you are still using NeoVim 0.7, for now your choices are to ignore the warning (debugprint.nvim will still work, except for the treesitter functionality) or to pin your package manager to commit f8e7abd054 for debugprint.nvim. The latter will only eliminate the warning, you still won't be able to use treesitter keybindings until you upgrade to 0.8+.

@andrewferrier
Copy link
Owner Author

As of commit 7c3a43cf1, some filetypes now use print logic that will print to stderr rather than stdout - as had been raised in #48, this is more logical since these are debugging/error messages and for some types of development/testing that may be important. For those using debugprint in a fairly casual way you should generally not see any difference although for some filetypes you may need to tweak your imported modules etc. Some filetypes are still to be migrated to this new approach and #48 remains open to track them.

@andrewferrier
Copy link
Owner Author

As of commit ee9d6ffa, the mechanism for setting up keymappings or commands for debugprint.nvim has changed to resolve some issues some users saw with custom mapping of keys - see GitHub issue #44 for the history. If you didn't customize the default keymappings or commands before, you shouldn't have to change anything. However, if you did, you should switch to the new mechanism instead. Please see README for an explanation of the new mechanism. Old keymapping configuration should continue to work for now, although direct keymapping via vim.keymap.set() is no longer officially supported and may be removed in future, and you may see deprecation warnings.

@andrewferrier
Copy link
Owner Author

andrewferrier commented Apr 28, 2024

As of commit be12ffc, the use of the ignore_treesitter option at a global level has been softly deprecated by removal from the documentation and is discouraged. You can achieve the same effect by using the variable_below_alwaysprompt and variable_above_alwaysprompt keybindings rather than variable_below and variable_above - just configure those in your setup() function as per the documentation.

In a later release, this option will be hard-deprecated and will start generating a warning on use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant