From a5e6fe9cfa3e2321938645effbf392ee07c7d7d9 Mon Sep 17 00:00:00 2001 From: Marco Kellershoff Date: Mon, 15 Jul 2024 19:18:56 +0200 Subject: [PATCH] fix(parser): document variables with underscores --- lua/kulala/globals/init.lua | 2 +- lua/kulala/parser/init.lua | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/kulala/globals/init.lua b/lua/kulala/globals/init.lua index de97314..5472ab3 100644 --- a/lua/kulala/globals/init.lua +++ b/lua/kulala/globals/init.lua @@ -2,7 +2,7 @@ local FS = require("kulala.utils.fs") local M = {} -M.VERSION = "2.2.0" +M.VERSION = "2.2.1" M.UI_ID = "kulala://ui" M.HEADERS_FILE = FS.get_plugin_tmp_dir() .. "/headers.txt" M.BODY_FILE = FS.get_plugin_tmp_dir() .. "/body.txt" diff --git a/lua/kulala/parser/init.lua b/lua/kulala/parser/init.lua index c759f9e..13e9c12 100644 --- a/lua/kulala/parser/init.lua +++ b/lua/kulala/parser/init.lua @@ -124,11 +124,11 @@ M.get_document = function() if is_request_line == false then is_body_section = true end - elseif line:match("^@%w+") then + elseif line:match("^@([%w_]+)") then -- Variable -- Variables are defined as `@variable_name=value` -- The value can be a string, a number or boolean - local variable_name, variable_value = line:match("^%@(%w+)%s*=%s*(.*)$") + local variable_name, variable_value = line:match("^@([%w_]+)%s*=%s*(.*)$") if variable_name and variable_value then -- remove the @ symbol from the variable name variable_name = variable_name:sub(1) diff --git a/package.json b/package.json index e798d14..aa5afc4 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,4 @@ { "name": "kulala.nvim", - "version": "2.2.0" + "version": "2.2.1" }