themerdev / themer

🎨 themer takes a set of colors and generates themes for your apps (editors, terminals, wallpapers, and more).

Home Page:https://themer.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vim undefined variable

Luke-zhang-04 opened this issue · comments

commented

Description

Usage of themer along with @themer/vim causes undefined variable errors

To reproduce

Steps to reproduce the behavior:

  1. Use themer template
  2. generate

Screenshots

image

Expected behavior

No errors

Environment information

CLI

Please fill out the following information if you are using the command-line interface. For the web UI, you can delete this section.

  • Device [e.g. iPhone6, MacBook Pro]: MacBook Air
  • OS [e.g. iOS, macOS]: Arch Linux
  • OS version [e.g. 14.0]: Linux 5.8.13, Latest Arch
  • Node version [e.g. 14.4.0]: 14.13.0
  • themer version [e.g. 3.3.4]: 3.3.4
  • Other themer packages and their versions [e.g. @themer/vscode@2.2.1]: @themer/vim@3.3.0
  • Vim version: 8.2

Additional context

Here's my config file

module.exports.colors = {
    dark: {
        accent0: "#FF4050",
        accent1: "#F28144",
        accent2: "#FFD24A",
        accent3: "#A4CC35",
        accent4: "#26C99E",
        accent5: "#66BFFF",
        accent6: "#CC78FA",
        accent7: "#F553BF",
    
        shade0: "#282629",
        shade1: "#474247",
        shade2: "#656066",
        shade3: "#847E85",
        shade4: "#A29DA3",
        shade5: "#C1BCC2",
        shade6: "#E0DCE0",
        shade7: "#FFFCFF",
    },
}

The problem is the if statement causing the variable to be scoped locally

  
  if &background == 'dark'
    
  let s:guishade0 = "#282629"
  let s:guishade1 = "#474247"
  let s:guishade2 = "#656066"

  . . .
  
  endif

I know the s: is supposed to scope the variable to the script, but for some reason, I get those errors. If I remove the if statements, themer works.

commented

Massive facepalm

Is it working for you now, @Luke-zhang-04 ? If so, what was the issue?

commented

Is it working for you now, @Luke-zhang-04 ? If so, what was the issue?

I didn't set my background to dark to the code under the if didn't execute 🤦‍♂️

Ahh, I see 😁 I'm glad it's working now!