diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_meson.lua | 1 | ||||
-rw-r--r-- | plugins/language_sh.lua | 2 | ||||
-rw-r--r-- | plugins/memoryusage.lua | 18 |
3 files changed, 19 insertions, 2 deletions
diff --git a/plugins/language_meson.lua b/plugins/language_meson.lua index 4bbee68..97fde72 100644 --- a/plugins/language_meson.lua +++ b/plugins/language_meson.lua @@ -6,7 +6,6 @@ syntax.add { comment = "#", patterns = { { pattern = { "#", "\n" }, type = "comment" }, - { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "'", "'", '\\' }, type = "string" }, { pattern = { "'''", "'''" }, type = "string" }, { pattern = "0x[%da-fA-F]+", type = "number" }, diff --git a/plugins/language_sh.lua b/plugins/language_sh.lua index 075b4a6..9b04008 100644 --- a/plugins/language_sh.lua +++ b/plugins/language_sh.lua @@ -14,7 +14,7 @@ syntax.add { { pattern = "%f[%w_][%d%.]+%f[^%w_]", type = "number" }, { pattern = "[!<>|&%[%]=*]", type = "operator" }, { pattern = "%f[%S]%-[%w%-_]+", type = "function" }, - { pattern = "${[^}]*}", type = "keyword2" }, + { pattern = "${.-}", type = "keyword2" }, { pattern = "$[%a_@*][%w_]*", type = "keyword2" }, { pattern = "[%a_][%w_]*", type = "symbol" }, }, diff --git a/plugins/memoryusage.lua b/plugins/memoryusage.lua new file mode 100644 index 0000000..38ca59d --- /dev/null +++ b/plugins/memoryusage.lua @@ -0,0 +1,18 @@ +-- original implementation by AqilCont +local style = require "core.style" +local StatusView = require "core.statusview" + +local get_items = StatusView.get_items + +function StatusView:get_items() + local left, right = get_items(self) + local t = { + style.text, (math.floor(collectgarbage("count") / 10.24) / 100) .. " MB", + style.dim, self.separator2, + } + for i, item in ipairs(t) do + table.insert(right, i, item) + end + return left, right +end + |