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

Use math.min and math.max in doc.lua #18

Closed
wants to merge 1 commit into from

Conversation

she3o
Copy link
Collaborator

@she3o she3o commented Feb 8, 2024

No description provided.

@jalvesaq
Copy link
Member

jalvesaq commented Feb 9, 2024

This doesn't seem to be equivalent:

-            htwf = (wwidth > 80) and 88.1 or ((wwidth - 1) / 0.9)
+            htwf = math.min(wwidth, 80)

@jalvesaq
Copy link
Member

Perhaps we should simplify how the help window is open to the same algorithm used by Vim for its :help:

:h[elp]	Open a window and display the help file in read-only
	mode.  If there is a help window open already, use
	that one.  Otherwise, if the current window uses the
	full width of the screen or is at least 80 characters
	wide, the help window will appear just above the
	current window.  Otherwise the new window is put at
	the very top.

@jalvesaq jalvesaq closed this in c97a03e Feb 12, 2024
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

Successfully merging this pull request may close these issues.

2 participants