Skip to content

Commit 6ad399d

Browse files
committed
hywiki.el - Fix WikiWord:L2:C3 not highlighting properly
1 parent bb5879c commit 6ad399d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
2025-01-18 Bob Weiner <[email protected]>
22

3+
* hywiki.el (hywiki-get-referent-hasht): Fix when building
4+
'hywiki--any-wikiword-regexp-list', allow for either or both #section
5+
and :Lnum:Cnum. This fixes not highlighting "WikiWord:L2".
6+
37
* hyrolo.el (hyrolo-refresh-file-list): Add to refresh internal expanded list
48
of HyRolo search files.
59
test/hyrolo-tests.el (hyrolo-tests--get-file-list): Fix this test by using

hywiki.el

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 21-Apr-24 at 22:41:13
6-
;; Last-Mod: 18-Jan-25 at 22:17:01 by Bob Weiner
6+
;; Last-Mod: 18-Jan-25 at 23:45:34 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -458,7 +458,7 @@ non-# and non-whitespace characters.")
458458
Group 4 is the optional 0-based column number.")
459459

460460
(defconst hywiki-word-with-optional-suffix-regexp
461-
(concat hywiki-word-regexp hywiki-word-section-regexp "?"
461+
(concat hywiki-word-regexp hywiki-word-section-regexp "??"
462462
hywiki-word-line-and-column-numbers-regexp "?")
463463
"Regexp for a HyWiki word with an optional #section, :Lline-num, :Ccol-num.
464464
Section may not contain whitespace or square brackets. Use '-' to
@@ -485,7 +485,7 @@ Group 6 is any optional 0-based column number to jump to for any
485485
file-based referents.")
486486

487487
(defconst hywiki-word-with-optional-suffix-exact-regexp
488-
(concat "\\`" hywiki-word-regexp "\\(#[^][\n\r\f]+\\)?"
488+
(concat "\\`" hywiki-word-regexp "\\(#[^][\n\r\f]+\\)??"
489489
hywiki-word-line-and-column-numbers-regexp "?\\'")
490490
"Exact match regexp for a HyWiki word with an optional #section.
491491
The section may contain spaces or tabs but not square brackets;
@@ -2246,8 +2246,7 @@ regexps of wikiwords, if the hash table is out-of-date."
22462246
(delq nil (nconc wikiword-sublist
22472247
(mapcar #'hywiki-get-plural-wikiword wikiword-sublist))))
22482248
(concat (regexp-opt wikiword-sublist 'words)
2249-
"\\("
2250-
hywiki-word-section-regexp "?\\)"
2249+
"\\(" hywiki-word-section-regexp "??" hywiki-word-line-and-column-numbers-regexp "?" "\\)"
22512250
hywiki--buttonize-character-regexp))
22522251
(hypb:split-seq-into-sublists
22532252
(hash-map #'cdr hywiki--referent-hasht) 25)))

0 commit comments

Comments
 (0)