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

[Bug] Error when attempting to rename empty space #95

Closed
EtiamNullam opened this issue Nov 26, 2021 · 1 comment · Fixed by #97
Closed

[Bug] Error when attempting to rename empty space #95

EtiamNullam opened this issue Nov 26, 2021 · 1 comment · Fixed by #97
Assignees
Labels
bug Something isn't working
Milestone

Comments

@EtiamNullam
Copy link

Describe the bug

Invoking rename method will throw this error when you attempt it on empty space:

E5108: Error executing lua ~\.vim-plug\renamer.nvim/lua/renamer/init.lua:129: attempt to perform arithmetic on local 'word_start' (a nil value)
stack traceback:
	~\.vim-plug\renamer.nvim/lua/renamer/init.lua:129: in function 'rename'
	[string ":lua"]:1: in main chunk

To reproduce

Steps to reproduce the behavior:

  1. Place cursor on space or newline.
  2. Run lua require('renamer').rename().
  3. See error.

Expected behavior

There should be short and less distracting message displayed instead.

Environment

  • Renamer: v3.0.2
  • Neovim: v0.5.1
  • OS: Windows, version: 10
@EtiamNullam EtiamNullam added the bug Something isn't working label Nov 26, 2021
@filipdutescu filipdutescu self-assigned this Nov 26, 2021
@filipdutescu filipdutescu added this to the 3.0.3 milestone Nov 26, 2021
@filipdutescu
Copy link
Owner

Thanks for submitting the two issues, good catches as well! Will come with a fix this weekend.

filipdutescu added a commit that referenced this issue Nov 29, 2021
TODO

Closes: GH-95
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit that referenced this issue Nov 29, 2021
TODO

Closes: GH-95
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit that referenced this issue Nov 29, 2021
TODO

Closes: GH-95
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit that referenced this issue Nov 29, 2021
Prevent the popup from being drawn if the cursor is on an empty space
and log a debug message regarding it.

Add `lua/renamer/constants.lua` to store all reused hardcoded strings
and any other strings that should be managed in a proper way.

Closes: GH-95
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
filipdutescu added a commit that referenced this issue Nov 29, 2021
Prevent the popup from being drawn if the cursor is on an empty space
and log a debug message regarding it.

Add `lua/renamer/constants.lua` to store all reused hardcoded strings
and any other strings that should be managed in a proper way.

Closes: GH-95
Signed-off-by: Filip Dutescu <filip.dutescu@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants