aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2024-01-27 08:26:01 -0600
committerGitHub <noreply@github.com>2024-01-27 08:26:01 -0600
commit5ca330859cf2392badde8108693d398a30e08243 (patch)
tree602b57ed1c5b36784516d655be61421292101a34
parente35ae6fbc2ef47a7be1a787031072ba911f7e918 (diff)
downloadrneovim-5ca330859cf2392badde8108693d398a30e08243.tar.gz
rneovim-5ca330859cf2392badde8108693d398a30e08243.tar.bz2
rneovim-5ca330859cf2392badde8108693d398a30e08243.zip
fix(decor): check decor kind before accessing union field (#27205)
The data.sh.url field is valid only when item.kind is kDecorKindHighlight. The `if` block just before this line already does that check (as well as checking `active`) so move the access of `data.sh.url` into that block.
-rw-r--r--src/nvim/decoration.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c
index 8d9b234bbc..755655856d 100644
--- a/src/nvim/decoration.c
+++ b/src/nvim/decoration.c
@@ -629,9 +629,9 @@ next_mark:
} else if (item.data.sh.flags & kSHSpellOff) {
spell = kFalse;
}
- }
- if (active && item.data.sh.url != NULL) {
- attr = hl_add_url(attr, item.data.sh.url);
+ if (item.data.sh.url != NULL) {
+ attr = hl_add_url(attr, item.data.sh.url);
+ }
}
if (item.start_row == state->row && item.start_col <= col
&& decor_virt_pos(&item) && item.draw_col == -10) {