From 2b11655ab8e6ab4e4ee5ee73622a5f7e494eb547 Mon Sep 17 00:00:00 2001 From: "METANEOCORTEX\\Kotti" Date: Tue, 17 Feb 2026 17:24:37 +0100 Subject: [PATCH] fix: URL extraction - handle final single-quote smart - try to fix issue #5464 --- src/Edit.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Edit.c b/src/Edit.c index 5d4da6227..7268373be 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -8300,13 +8300,21 @@ static void _UpdateIndicators(const int indicator, const int indicator2nd, break; // wrong match } + // URL-specific: if match ends with single-quote and is preceded by one, strip trailing quote + DocPos mlen_adj = mlen; + if ((indicator == INDIC_NP3_HYPERLINK) && (mlen_adj > 4)) { + if ((SciCall_GetCharAt(end - 1) == '\'') && (start > 0) && (SciCall_GetCharAt(start - 1) == '\'')) { + --mlen_adj; + } + } + _ClearIndicatorInRange(indicator, indicator2nd, start_m, end); SciCall_SetIndicatorCurrent(indicator); - SciCall_IndicatorFillRange(start, mlen); + SciCall_IndicatorFillRange(start, mlen_adj); if (indicator2nd >= 0) { SciCall_SetIndicatorCurrent(indicator2nd); - SciCall_IndicatorFillRange(start, mlen); + SciCall_IndicatorFillRange(start, mlen_adj); } // next occurrence