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

Refactor code for printing directories #1150

Merged
merged 1 commit into from
Mar 12, 2023
Merged

Refactor code for printing directories #1150

merged 1 commit into from
Mar 12, 2023

Conversation

joelim-work
Copy link
Collaborator

Fixes #602, Fixes #889

Changes:

  • Calculate window width correctly when drawbox is enabled. For example, the default configuration contains three windows (shaped like | 1 | 2 | 3 |), so four spaces needs to be subtracted from the screen width, but the current implementation only subtracts one space from the last window.
  • The renew function now calls getWins directly, instead of executing its own code which does the same thing.
  • A maxlength variable is defined to indicate the maximum amount of space for displaying a filename, including the icon, the filename itself and the file info. This is the space left over from the window width after subtracting the space for line numbers and the select marker.

I have tested this using various combinations of settings including drawbox, number, relativenumber and icons. I would appreciate it if anyone else has the time to test this as well.

@jackielii
Copy link
Contributor

Not sure if it's related, but I had to subtract image preview width by one in Tmux setup: #1143

@joelim-work
Copy link
Collaborator Author

Not sure if it's related, but I had to subtract image preview width by one in Tmux setup: #1143

@jackielii Yes, that is the same issue. Hopefully this patch should fix that particular problem for you.

@gokcehan
Copy link
Owner

@joelim-work Thanks for the patch. I hope this won't break anything else.

@gokcehan gokcehan merged commit db9de4d into gokcehan:master Mar 12, 2023
@joelim-work joelim-work deleted the refactor-printdir branch March 13, 2023 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants