]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0921: popupmenu logic is a bit convoluted v9.1.0921
authorglepnir <glephunter@gmail.com>
Fri, 13 Dec 2024 11:13:23 +0000 (12:13 +0100)
committerChristian Brabandt <cb@256bit.org>
Fri, 13 Dec 2024 11:13:23 +0000 (12:13 +0100)
commitc942f84aadffd0c8969ecf81e3e9103722b2714f
treebad969ef47bcaa02fb38f3ea51c06fa3bd29fd1b
parent95a03fc321dcb9d6958ac508dbfb85f8e7752836
patch 9.1.0921: popupmenu logic is a bit convoluted

Problem:  popupmenu logic is a bit convoluted
Solution: slightly refactor logic and use MIN/MAX() macros to simplify
          (glepnir)

Define the MAX/MIN macros. Since we support some older platforms, C
compilers may not be as smart. This helps reduce unnecessary if
statements and redundant ternary expressions. Pre-calculate some
expressions by defining variables. Remove unnecessary parentheses.
Adjust certain lines to avoid exceeding 80 columns.

closes: #16205

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_getln.c
src/popupmenu.c
src/version.c