files-community / Files

Building the best file manager for Windows
https://files.community
MIT License
34.15k stars 2.18k forks source link

Bug: Home key doesn't move to the 1st character when renaming item in List View layout #15048

Open andrew-james-heard opened 6 months ago

andrew-james-heard commented 6 months ago

Description

When renaming a file with a long name in Windows Explorer, the whole name is displayed, whereas Files only displays part of the name. In Files, when the name is in edit mode (F2) the Home & End keys only move to the start & end of the visual/ displayed text rather than the 1st or last character. This issue seems to stem from Files difference in how it displays long file names; generally they are shown in a truncated form whereas Explorer generally shows the whole name.

Steps To Reproduce

  1. say clipboard contains "this is a long file name, this is a long file name" but the layout is List, showing 28 characters.
  2. move focus to any file
  3. press F2 to rename the file
  4. press ctrl+V to paste the new long filename
  5. observe only a truncated part of the new long filename is displayed, and pressing Home only moves the cursor to the 1st displayed character rather than (as with Explorer) the 1st actual character

Requirements

Not quite sure, but its currently confusing. Initially I thought a truncated name was being pasted, but you can use the cursor-left key to see all the other characters are actually pasted, just not displayed.

Files Version

3.3

Windows Version

11 23H2

Log File

this should be optional?

yaira2 commented 6 months ago

Thank you for the report, I can repro this issue in the List View as well. Interestingly it's not an issue in the Details View.

andrew-james-heard commented 6 months ago

Wow - can I give you 11 out of 10 stars for speed of testing?

yaira2 commented 6 months ago

Having clear repro steps helps in this regard!

Reproducing doesn't mean it'll be fixed right away, but it does mean that it's added to our project board and marked as ready to build.

nunescostr commented 6 months ago

I think I know how to fix this, may I be assigned to this ? Also should I write tests for it ?

Thank you.

Josh65-2201 commented 6 months ago

If your able to fix this issue, just open a PR with it.

yaira2 commented 6 months ago

Also should I write tests for it ?

Tests aren't necessary but you should verify it works and include the steps you used to verify in the PR.