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

Ability to edit symlink destination #1690

Closed
alexandrustinov opened this issue May 21, 2023 · 3 comments
Closed

Ability to edit symlink destination #1690

alexandrustinov opened this issue May 21, 2023 · 3 comments

Comments

@alexandrustinov
Copy link

The Midnight Commander has pretty nice feature File->Edit symlink , once you select the symlink you can change the destination that way

For far2l there are F4 or Ctrl+A keystrokes, Attributes dialog shows destination link path but input box is disabled (read/only).
I can change practically any attribute there but not the symlink destination path.

Is it possible to allow to change the symlinks destination by the Attributes dialog box?

@elfmz elfmz closed this as completed in 65e1870 Jul 8, 2023
@akruphi
Copy link
Contributor

akruphi commented Jul 8, 2023

@elfmz After 65e1870 change symlink has strange behavior:

  1. if I change field Symlink and press Enter on any field in dialog the symlink has not changed without any Errors
  2. if I change field Symlink and click on { Set } or press Enter only in button { Set } the symlink has changed and give error in any case because after the line
    int r = sdc_symlink(DlgParam.SymLink.GetMB().c_str(), strSelName.GetMB().c_str());
    check if (r !=0) was lost and now Message with Msg::SetAttrSymlinkFailed must be always shown.

But I cann't explain situation 1.

akruphi added a commit to akruphi/far2l that referenced this issue Jul 9, 2023
Improvements after elfmz#1690 & 65e1870 & 93a50b2

* SA_TXTBTN_INFO & SA_EDIT_INFO fields now never hidden (when seleceted >1 it shows the number of selected files + directories)

* SA_EDIT_INFO not readonly only if symlink

* If symlink then let's first focus not on the editable SA_EDIT_INFO, but on the button SA_TXTBTN_INFO
@alexandrustinov
Copy link
Author

The issue has not been perfectly completed yet :)
Shortcut Ctrl+A works fine.
Shortcut F4 over good symlinks to folders shows the "Attributes" dialog, that way is possible to redirect the symlink as well, that's nice too.

But If I'm trying to "edit" broken symlink using the F4 shortcut (symlink which points to non-existent file/folder) - far2l shows me red message box with text "No such file or directory (2) Cannot open the file" and nothing else happens further.

That's a bit unexpected, because the main goal there - is to be able to fix broken symlink in place.

From other hand the Ctrl+A works fine with the broken symlinks, as I said before.

@akruphi
Copy link
Contributor

akruphi commented Jul 10, 2023

@alexandrustinov This is the common F4 behavior: on file try open it for edit; on directory show attribute dialog.

Additional in #1744 I add confirmation for case when new symlink target not exist.
Now confirmation texts are draft. Please give response and/or may be advice about more clearer variants of text in messagebox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants