Skip to content

fix "slice bounds out of range" in cmd-delete-word-back - #1976

Merged
joelim-work merged 1 commit into
gokcehan:masterfrom
dazzywi:master
May 7, 2025
Merged

fix "slice bounds out of range" in cmd-delete-word-back#1976
joelim-work merged 1 commit into
gokcehan:masterfrom
dazzywi:master

Conversation

@dazzywi

@dazzywi dazzywi commented May 6, 2025

Copy link
Copy Markdown
Contributor

Hello, while trying to edit file names with Cyrillic characters in them, I encountered error when performing cmd-delete-word-back action to remove words:

runtime error: slice bounds out of range [:18] with capacity 16 

To reproduce you can create two folders, one named test test test and тест тест тест, position your cursor at the end of file name (like this тест тест тест| as denoted by |), and try to delete one word back.

You may also need to bind this action to some key beforehand in lfrc, like this cmap <c-w> cmd-delete-word-back.

Prior to this commit, after deleting one word back in file names:
test test test will become test test
тест тест тест will crash lf, when it is expected to become тест тест

@joelim-work joelim-work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the bug fix!

@joelim-work
joelim-work merged commit ce13438 into gokcehan:master May 7, 2025
@joelim-work joelim-work added the fix Pull requests that fix existing behavior label May 7, 2025
@joelim-work joelim-work added this to the r36 milestone May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Pull requests that fix existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants