Thursday, December 3, 2020

Re: Vim9 dict key notation old fashion depreciated

> This, as a bypass, seems to work:
>
> g:fzf_colors = { fg: ['fg', 'Normal'],
> \ bg: ["bg", "Normal"],
> \ hl: ["fg", "IncSearch"],
> \ info: ["fg", "IncSearch"],
> \ border: ["fg", "Ignore"],
> \ prompt: ["fg", "Comment"],
> \ pointer: ["fg", "IncSearch"],
> \ marker: ["fg", "IncSearch"],
> \ spinner: ["fg", "IncSearch"],
> \ header: ["fg", "WildMenu"] }
> g:fzf_colors['fg+'] = ["fg", "CursorLine", "CursorColumn", "Normal"]
> g:fzf_colors['bg+'] = ["bg", "CursorLine", "CursorColumn"]
> g:fzf_colors['hl+'] = ["fg", "IncSearch"]

Looks like your problem is with the "fg+" key, the plus character is not
allowed in a literal key. You can use the Javascript notation, using
square brackets:

g:fzf_colors = { fg: ['fg', 'Normal'],
bg: ["bg", "Normal"],
hl: ["fg", "IncSearch"],
info: ["fg", "IncSearch"],
border: ["fg", "Ignore"],
prompt: ["fg", "Comment"],
pointer: ["fg", "IncSearch"],
marker: ["fg", "IncSearch"],
spinner: ["fg", "IncSearch"],
header: ["fg", "WildMenu"],
['fg+']: ["fg", "CursorLine", "CursorColumn", "Normal"],
['bg+']: ["bg", "CursorLine", "CursorColumn"],
['hl+']: ["fg", "IncSearch"],
}

In Vim9 script you don't need the backslashes.


--
ARTHUR: Ni!
BEDEVERE: Nu!
ARTHUR: No. Ni! More like this. "Ni"!
BEDEVERE: Ni, ni, ni!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/202012031133.0B3BXjta181738%40masaka.moolenaar.net.

No comments: