Hi, When I want to rename a filename into Thunar, a dialog box appears prompting to correct the filename. (Rename 'filename' / Enter the new name). into edit field, some standard shortcuts works fine ('copy' CTRL+C, 'paste' CTRL+V), but the standard 'undo' CTRL+Z not). Thanks for your work. Best regards.
Changed to "enhancement" ... dont think there is any field at all in thunar which supports CTRL+Z. To to be discussed if we generally want that, since afaik it complicates the code alot, which could lead to performance problems / more memory usage. Thunar is known as a lightweight file browser. So it depends on the impact of the feature if it will be added. However if I am wrong with my estimation, it would be fine for me to add CTRL+Z support .. patches are always welcome !
Hi, I agree with your comment. Because some standard shortcuts works, I didn't know if CTRL+Z disable is a bug or not. When you want to rename a file whit Thunar, the filename without extension is selected, so, if you accidentally hit a key on keyboard (instead arrows keys) before unselect the filename, the filename is erased. It is in this way that I tryed CTRL+Z to undo erase operation. If this shortcut disable is not a dysfunction, I let you discuss if it is a good idea. It is conceivable that it is not reasonable to add all features suggested by users and designers must maintain a certain coherence. Best regards.
Created attachment 8181 patch Unfortunately there is nothing disabled, GtkEntry itself does not support undo/redo operations. We could extend it as ThunarEntry, however I don't think we should. @alexxcons, I checked how Nautilus handles this, and it's surprisingly simple, on ctrl+z it just reverts to the current filename, there is no "edits stack". I prepared the attached patch, let me know what you think.
@Andre Miranda Real nice work, IMO that's a fair tradeoff ! Just tested it, works fine for me. Only some minor things I noticed during review: - indention of variable declarations in both new methods - 863: /* check if we don't have a directory here */ --> /* check if we have a directory here */ IMO would be nice to have in the 4.14 branch as well.
Andre Miranda referenced this bugreport in commit 812e5675a184fd73d5a5125860e71bd2d1eb006d Add support for CTRL+Z in rename dialog (Bug #14956) https://git.xfce.org/xfce/thunar/commit?id=812e5675a184fd73d5a5125860e71bd2d1eb006d
Andre Miranda referenced this bugreport in commit 56d1afc1b04591007d5664360b606361ff768ac6 Add support for CTRL+Z in rename dialog (Bug #14956) https://git.xfce.org/xfce/thunar/commit?id=56d1afc1b04591007d5664360b606361ff768ac6
Andre Miranda referenced this bugreport in commit a7d40e5f57b6e5255696a09a95738c0dd2ee4642 Add support for CTRL+Z in rename dialog (Bug #14956) https://git.xfce.org/xfce/thunar/commit?id=a7d40e5f57b6e5255696a09a95738c0dd2ee4642
@alexxcons thanks for catching my formatting slips. I also pushed to 4.12 in case we release 1.6.16 someday.