spyder-ide / spyder-vim

A plugin for Spyder to enable Vim keybindings
https://www.spyder-ide.org
MIT License
126 stars 26 forks source link

PR: Fix a bug with p command #90

Closed ryohei22 closed 1 year ago

ryohei22 commented 1 year ago

Description of Changes

I modified the p() function to not run when there is nothing to paste.

Description of the bug

There was a bug with the p command as reported in issue #86. When there is nothing to paste, more specifically, when executing the p command before any of the d, dd, y, and yy commands, the P() function is executed without a required valuable. I noticed that only char, line, and block were expected as values for the selection_state parameter in widgets.py but it can be False as well.

Issue(s) Resolved

Fixes #86. The issue occurs because :y is not implemented yet and doesn't yank anything.

ryohei22 commented 1 year ago

I wish I could implement block text pasting. By the way, I noticed that I can yank multiple lines and paste them with the p command. Is this different from block text pasting mentioned in the code?

ok97465 commented 1 year ago

I wish I could implement block text pasting. By the way, I noticed that I can yank multiple lines and paste them with the p command. Is this different from block text pasting mentioned in the code?

Thank you for your PR. When spyder-vim says block, it means visual mode, not V-Line mode.

ccordoba12 commented 1 year ago

@ryohei22, the failure in our tests seems legitimate. Do you know how to run our tests locally so you can take a look at it?

ryohei22 commented 1 year ago

@ccordoba12 Thank you for making sure that. I know how to run the tests. I have a deadline at the end of this month, so it may be late to work on this. Sorry for the late update.

ryohei22 commented 1 year ago

Even tho I said I might make you wait, now my changes passed all of the tests.

ccordoba12 commented 1 year ago

@ok97465, what do you think about @ryohei22's fix?

ok97465 commented 1 year ago

@ccordoba12 This PR seems to resolve the issue.