Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hywiki.el - Fix WikiWord:L2:C3 not highlighting properly #649

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading