Skip to content

Commit

Permalink
Merge pull request #649 from rswgnu/rsw
Browse files Browse the repository at this point in the history
hywiki.el - Fix WikiWord:L2:C3 not highlighting properly
  • Loading branch information
rswgnu authored Jan 19, 2025
2 parents 03d01f0 + 6ad399d commit 31d77e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2025-01-18 Bob Weiner <[email protected]>

* hywiki.el (hywiki-get-referent-hasht): Fix when building
'hywiki--any-wikiword-regexp-list', allow for either or both #section
and :Lnum:Cnum. This fixes not highlighting "WikiWord:L2".

* hyrolo.el (hyrolo-refresh-file-list): Add to refresh internal expanded list
of HyRolo search files.
test/hyrolo-tests.el (hyrolo-tests--get-file-list): Fix this test by using
Expand Down
9 changes: 4 additions & 5 deletions hywiki.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Apr-24 at 22:41:13
;; Last-Mod: 18-Jan-25 at 22:17:01 by Bob Weiner
;; Last-Mod: 18-Jan-25 at 23:45:34 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -458,7 +458,7 @@ non-# and non-whitespace characters.")
Group 4 is the optional 0-based column number.")

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

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

0 comments on commit 31d77e4

Please sign in to comment.