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

[patch] WindowCascade action #4184

Open
mc-butler opened this issue Jan 23, 2021 · 10 comments
Open

[patch] WindowCascade action #4184

mc-butler opened this issue Jan 23, 2021 · 10 comments
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4184
Reporter psprint (sg44567@….com)
Keywords windows, cascade

Hi!
I've implemented the main part of the requested non-fullscreen mode startup (see post).

The patch is fairly simple. It just:

  • registers the command in keybind.h/.c/*-defaults.c/mc.default.keymap,
  • then adds the case for it in editwidget.c,
  • and also a function + a helper function in the same file to implement it.

The implementation is a simple loop that arranges the windows in cascade arrangement. It's somewhat intelligent as it gradually lowers the shift between windows as seen in the asciicast.

Note

Original attachments:

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 23, 2021 at 20:45 UTC

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 23, 2021 at 20:48 UTC

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 24, 2021 at 3:54 UTC

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 24, 2021 at 6:07 UTC (comment 3)

Following comment:2:#4186 I've merged the #4185-4186 's into this one. Patch is attached. I've also:

  • added man documentation of -w/--cascade -T/--tile options,
  • extended Window menu with the two arrangement commands,
  • wrapped the options structures extension with #ifdef USE_INTERNAL_EDIT.

IMO -w is a very good option – it's read as "-w(indowed)". All other possible options like -c, -C are already taken, so the -w is quite a lucky last resort.

It would be difficult to add options just for mcedit as the code doesn't have such option-palette (like e.g.: --help-terminal). Plus the fact that mc has the option -e which basically works like the mcedit symlink – so it has sense to include -w/-T in general options.

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 24, 2021 at 6:07 UTC

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 24, 2021 at 6:25 UTC (comment 3.4)

Replying to psprint:

IMO -w is a very good option – it's read as "-w(indowed)".

"windowed" != "cascade"

Why misc/mc.default.emacs is ignored?

Reduce variable scope as much as possible.

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 24, 2021 at 6:56 UTC (comment 5)

For me -w seems natural for the cascade view… But I'm not going to cling on it, if you have better idea.

I'm attaching a patch with:

  • mc.default.emacs extended with the two actions,
  • WRect moved to the inner block (are there any other variable scopes that you've meant to limited?)
  • some comments added.

@mc-butler
Copy link
Author

Changed by psprint (sg44567@….com) on Jan 24, 2021 at 8:14 UTC

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 22, 2025 at 11:43 UTC

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 22, 2025 at 11:45 UTC (comment 7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress
Development

No branches or pull requests

1 participant