popup: keep only computed geometry in Popup; one fallback for slivers

numx, textx and selx were compile-time constants stored per layout;
the number column starts at PopupPad and text at PopupPad+PopupNumw,
which dat.h now says once. The height fallback tried dropping the
marker, then the preedit, then the padding as three separate refits;
below one padded row it now shows as many bare rows as fit, at least
one, which is what those steps added up to.
This commit is contained in:
2026-08-16 18:27:24 +09:00
parent 68678283cd
commit 3f1ff03b94
3 changed files with 25 additions and 34 deletions

10
dat.h
View File

@@ -142,6 +142,11 @@ struct Drawcmd
Caret caret;
};
/*
* Popup geometry from popuplayout: n rows from row0 of the candidates,
* each Fontsz tall; a section's y is -1 when it is absent. Numbers
* start at PopupPad, text at PopupPad+PopupNumw.
*/
typedef struct Popup Popup;
struct Popup
{
@@ -152,14 +157,11 @@ struct Popup
int prey;
int sepy;
int rowsy;
int numx;
int textx;
int textw;
int markx;
int marky;
int markx;
int markw;
Str mark;
int selx;
int sely;
int selw;
};