-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rotating dash not removed #2163
Comments
|
remove rotating dash when finished rotating |
This has been bugging me forever, and I don't know why I didn't take time to fix it much earlier. My system is fast enough that I rarely see the dash actually rotating, but I'm always disturbed by the artifact it leaves behind, it just looks ugly to me.
Could you please review the patch?
Whenever rotating the dash finishes, I redraw the character that should be there. I believe there are 2 cases only: if the menubar is shown (then it's a space char, using menubar color), or if it's hidden (then it's the upper right corner of the panel, using the main color).
[As a really minor bug, if the menubar is shown but the terminal is way too narrow to show it fully (e.g. less than 42 chars wide in English), I print a space although a letter (the last visible one from the cropped menubar line) should be printed. Honestly I don't care about it as mc is useless anyways on such narrow terminals :) ]
As a side note, I inverted the boolean arg of find_rotate_dash() to be consistent with the new rotate_dash() behavior and to be intuitive. For me, FALSE meaning to show something and TRUE meaning to hide it was counter-intuitive. I couldn't figure out where this rotating dash appears, though. |
Replying to egmont:
In general, patch is OK. Thanks!
I moved dash to the corner of the right/top panel from the corner of the screen. Menubar is untouched now.
This part of your patch I applied with small modifications as a separate commit.
Branch: 2163_rotating_dash. |
Thanks! One thing, though, please do
sizeof() counts the terminating zero, hence a 5th phase, a caret also shows up.
I'm not sure about the widget infrastructure of mc, but are you sure that using midnight_dlg does not interfere with any actual dialog that might be open while the dash is rotated? (If you're sure then that's okay! :)) |
Replying to egmont:
Indeed.
sizeof (rotating_dash) == 5.
In case of
sizeof (rotating_dash) == 4.
I changed declaration of rotating_dash.
I hope everything is OK here. :) |
I believe in case of
sizeof(rotating_dash) accidentally happens to be 4 because the size of a pointer is 4 bytes, and not because the length of the string contained there is 4. |
Yup, sizeof(rotating_dash) == 8 on x86-84.
Please stick to the [] declaration (that's when the length can be known in compile time) and the -1 offset. Or the hardwired 4 :) Or you can do
in which case the trailing zero is not stored in memory at all and then sizeof gives 4, but you still have to manually maintain the length in that declaration line.
In case of "char *" the length might change at runtime hence sizeof() (which is evaluated at compile time) has no chance of knowing it, and it would be weird if the "const" modifier changed the behavior of sizeof(). |
Replying to egmont:
Ok. Thanks. |
It's cool now, thx! |
8000
You guys are doing awesome work! Just so that you know... |
It is still possible to get sizeof() == 4, not hard-code any magic numbers and make the variable immutable at the same time. The code would look like this:
|
Good point, Mike! |
|
|
Merged to master: [d38589c].
|
|
Unfortunately the fix is not complete yet. The rotating dash is now drawn by using a widget which is not resized when mc is resized. So if you make mc's terminal wider, the rotating dash and the box corner when it's removed is drawn at an incorrect position. |
Oops, sorry. My bad. It is indeed fixed.
(I forgot that I had downgraded to 4.8.9 because #3047 was driving me crazy.) |
|
Important
This issue was migrated from Trac:
egmont
(@egmontkob)When reading a large directory, mc shows a rotating dash in the upper right corner (if enabled in the config). This symbol is not removed when mc finishes reading the directory. (It disappears on a subsequent Ctrl-R or window resize, though).
The easiest way to test it: stand on a directory, press and hold the Enter key for a long time (mc toggles back and forth between two directories).
When mc finishes reading a directory, it should remove the rotating dash.
Note
Original attachments:
egmont
(@egmontkob) onMay 19, 2013 at 23:01 UTC
The text was updated successfully, but these errors were encountered: