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

Rename file with a long name #1213

Closed
ixzh opened this issue Oct 28, 2021 · 9 comments
Closed

Rename file with a long name #1213

ixzh opened this issue Oct 28, 2021 · 9 comments

Comments

@ixzh
Copy link

ixzh commented Oct 28, 2021

Is your feature request related to a problem? Please describe.
Can't see what's been modified due to truncation to screen width

Describe the solution you'd like

If the file name is longer than screen width, the inplace rename will only display the beginning of the file name. Most of the time I want to modify the file extension or prepend some number before it, but can't see the cursor due to truncation. See below example:
image

Describe alternatives you've considered

ctrl-a and ctrl-e to jump to start/end of the line, and show it on screen (scrolling?)

Thanks!

@jarun
Copy link
Owner

jarun commented Oct 28, 2021

Duplicate of #279.

@jarun
Copy link
Owner

jarun commented Oct 28, 2021

Reopening as this can probably be fixed if the name itself can be scrolled when the cursor is at the edges but I don't have time for that.

@N-R-K @luukvbaal @leovilok any of you wanna give it a try?

@jarun jarun added the bug label Oct 28, 2021
@jarun jarun reopened this Oct 28, 2021
@jarun
Copy link
Owner

jarun commented Oct 29, 2021

I think the change needs to go in xreadline():

3488                 mvaddnwstr(xlines - 1, x, buf, len + 1);                                                                                                                                                           
3489                 move(xlines - 1, x + wcswidth(buf, pos));

where we should account for the number of columns and show the string till the cursor position when it exceeds COLS.

@jarun jarun closed this as completed in b498c71 Oct 29, 2021
@jarun
Copy link
Owner

jarun commented Oct 29, 2021

@ixzh please confirm if the issue is fixed with the patch.

jarun added a commit that referenced this issue Oct 29, 2021
@jarun jarun mentioned this issue Oct 29, 2021
17 tasks
@ixzh
Copy link
Author

ixzh commented Oct 29, 2021

@ixzh please confirm if the issue is fixed with the patch.

Yes, it works! Thank you !!!

@N-R-K
Copy link
Collaborator

N-R-K commented Oct 29, 2021

Hmmm, the cursor is one char to the left of where it should be for me.
Think we're off by one.

-			mvaddnwstr(xlines - 1, x, buf + (pos - (xcols - x)), xcols - x);
+			mvaddnwstr(xlines - 1, x, buf + (pos - (xcols - x) + 1), xcols - x);

@jarun
Copy link
Owner

jarun commented Oct 29, 2021

Sorry, I can't repro. Please do the required manipulation and raise the PR.

@jarun
Copy link
Owner

jarun commented Oct 29, 2021

Sorry, saw the full mail now.

@jarun
Copy link
Owner

jarun commented Oct 29, 2021

I will add the fix now. Thanks!

@jarun jarun mentioned this issue Nov 4, 2021
KenJean pushed a commit to KenJean/nnn that referenced this issue Nov 23, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants