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

Weird syntax highlighting behavior in 'custom syntax support' #379

Closed
serg3295 opened this issue Feb 4, 2021 · 1 comment
Closed

Weird syntax highlighting behavior in 'custom syntax support' #379

serg3295 opened this issue Feb 4, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@serg3295
Copy link
Contributor

serg3295 commented Feb 4, 2021

When replacing the function name with the plugin.lua script the replacement is performed correctly, but part of the function name is highlighted in a different color.

Screenshots

luaSrvErr3.mp4

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? no
  • Client: VSCode

plugin.lua

function OnSetText(uri, text)
  local diffs = {}
  local textAny = text:sub(1, 2)
  diffs[#diffs+1] = {
        start  = 1,
        finish = 2,
        text   = (textAny),
  }

  for displTypePos, finish in text:gmatch '[%w_]+%s*%=%s*ucg%.()[%w_]+_hw_spi()' do
    diffs[#diffs+1] = {
        start  = displTypePos,
        finish = finish - 1,
        text   = ('ucgDisplayType'),
    }
  end

  for displTypePos, finish in text:gmatch '[%w_]+%s*%=%s*u8g2%.()[%w]+_i2c_[%w_]+()' do
    diffs[#diffs+1] = {
        start  = displTypePos,
        finish = finish - 1,
        text   = ('u8g2DisplayTypeI2C'),
    }
  end

  for displTypePos, finish in text:gmatch '[%w_]+%s*%=%s*u8g2%.()[%w]+_[^i][%w_]+()' do
    diffs[#diffs+1] = {
        start  = displTypePos,
        finish = finish - 1,
        text   = ('u8g2DisplayTypeSPI'),
    }
  end

   return diffs
end
@sumneko sumneko added the bug Something isn't working label Feb 4, 2021
@sumneko sumneko closed this as completed in 09377c7 Feb 4, 2021
@serg3295
Copy link
Contributor Author

serg3295 commented Feb 4, 2021

Everything works fine. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants