From 62eb87b149166588d766d5a272e5232ecf86be5d Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Fri, 2 May 2025 07:33:28 +0300 Subject: auto-expand folds even after mouse events The ^KMOUSE macro can also change dot and it was possible to place dot into invisible areas at the end of the document. --- src/interface.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/interface.h') diff --git a/src/interface.h b/src/interface.h index 33b094b..b1ad2b8 100644 --- a/src/interface.h +++ b/src/interface.h @@ -93,6 +93,14 @@ teco_interface_ssm(unsigned int iMessage, uptr_t wParam, sptr_t lParam) */ void undo__teco_interface_ssm(unsigned int, uptr_t, sptr_t); +/** Expand folds, so that dot is always visible. */ +static inline void +teco_interface_unfold(void) +{ + sptr_t dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); + teco_interface_ssm(SCI_ENSUREVISIBLE, teco_interface_ssm(SCI_LINEFROMPOSITION, dot, 0), 0); +} + /** @pure */ void teco_interface_info_update_qreg(const teco_qreg_t *reg); /** @pure */ -- cgit v1.2.3