On 16-Feb-2021 06:39, Bram Moolenaar wrote:
Patch 8.2.2518
Problem: 'listchars' should be window-local.
Solution: Make 'listchars' global-local. (Yegappan Lakshmanan, Marco Hinz,
closes #5206, closes #7850)
Files: runtime/doc/options.txt, src/buffer.c, src/charset.c,
src/drawline.c, src/drawscreen.c, src/evalfunc.c, src/globals.h,
src/indent.c, src/message.c, src/misc1.c, src/option.c,
src/option.h, src/optiondefs.h, src/optionstr.c,
src/proto/screen.pro, src/screen.c, src/structs.h,
src/testdir/test_listchars.vim, src/testdir/test_listlbr.vim
After this patch, HP-UX throws this error message:
<snip>
cc -c -I. -Iproto -DHAVE_CONFIG_H -O2
-D_REENTRANT -o objects/screen.o screen.c
cc: "screen.c", line 4773: error 1521: Incorrect initialization.
cc: "screen.c", line 4774: error 1521: Incorrect initialization.
cc: "screen.c", line 4775: error 1521: Incorrect initialization.
cc: "screen.c", line 4776: error 1521: Incorrect initialization.
cc: "screen.c", line 4777: error 1521: Incorrect initialization.
cc: "screen.c", line 4778: error 1521: Incorrect initialization.
cc: "screen.c", line 4779: error 1521: Incorrect initialization.
cc: "screen.c", line 4780: error 1521: Incorrect initialization.
*** Error exit code 1
Stop.
*** Error exit code 1
Stop.
</snip>
The attached patch is one attempt to make the compiler happy. Not the
most elegant though.
Cheers
John
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/cb5d059f-59f7-6093-8b68-e562e13d2bd4%40internode.on.net.
--- screen.c 2021-02-16 07:07:19.084563500 +1100
+++ screen_new.c 2021-02-16 13:39:00.789096500 +1100
@@ -4770,19 +4770,15 @@
};
struct charstab lcstab[] =
{
- {&wp->w_lcs_chars.eol, "eol"},
- {&wp->w_lcs_chars.ext, "extends"},
- {&wp->w_lcs_chars.nbsp, "nbsp"},
- {&wp->w_lcs_chars.prec, "precedes"},
- {&wp->w_lcs_chars.space,"space"},
- {&wp->w_lcs_chars.tab2, "tab"},
- {&wp->w_lcs_chars.trail,"trail"},
- {&wp->w_lcs_chars.lead, "lead"},
-#ifdef FEAT_CONCEAL
- {&wp->w_lcs_chars.conceal, "conceal"},
-#else
- {NULL, "conceal"},
-#endif
+ {NULL, "eol"},
+ {NULL, "extends"},
+ {NULL, "nbsp"},
+ {NULL, "precedes"},
+ {NULL, "space"},
+ {NULL, "tab"},
+ {NULL, "trail"},
+ {NULL, "lead"},
+ {NULL, "conceal"},
};
struct charstab *tab;
@@ -4792,6 +4788,38 @@
entries = sizeof(lcstab) / sizeof(struct charstab);
if (varp == &wp->w_p_lcs && wp->w_p_lcs[0] == NUL)
varp = &p_lcs;
+
+ for (i = 0; i < entries; i++) {
+ if (strcmp(tab[i].name, "eol") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.eol;
+ }
+ else if (strcmp(tab[i].name, "extends") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.ext;
+ }
+ else if (strcmp(tab[i].name, "nbsp") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.nbsp;
+ }
+ else if (strcmp(tab[i].name, "precedes") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.prec;
+ }
+ else if (strcmp(tab[i].name, "space") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.space;
+ }
+ else if (strcmp(tab[i].name, "tab") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.tab2;
+ }
+ else if (strcmp(tab[i].name, "trail") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.trail;
+ }
+ else if (strcmp(tab[i].name, "lead") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.lead;
+ }
+#ifdef FEAT_CONCEAL
+ else if (strcmp(tab[i].name, "conceal") == 0) {
+ tab[i].cp = &wp->w_lcs_chars.conceal;
+ }
+#endif
+ }
}
else
{