diff options
-rw-r--r-- | doc/modules/utils.html | 29 | ||||
-rw-r--r-- | lua/colorizer.lua | 9 |
2 files changed, 34 insertions, 4 deletions
diff --git a/doc/modules/utils.html b/doc/modules/utils.html index ecb555b..af8d2ff 100644 --- a/doc/modules/utils.html +++ b/doc/modules/utils.html @@ -70,6 +70,10 @@ <td class="summary">Obvious.</td> </tr> <tr> + <td class="name" nowrap><a href="#byte_is_valid_colorchar">byte_is_valid_colorchar (byte)</a></td> + <td class="summary">Obvious.</td> + </tr> + <tr> <td class="name" nowrap><a href="#get_last_modified">get_last_modified (path)</a></td> <td class="summary">Get last modified time of a file</td> </tr> @@ -149,6 +153,31 @@ </dd> <dt> + <a name = "byte_is_valid_colorchar"></a> + <strong>byte_is_valid_colorchar (byte)</strong> + </dt> + <dd> + Obvious. + + + <h3>Parameters:</h3> + <ul> + <li><span class="parameter">byte</span> + number + </li> + </ul> + + <h3>Returns:</h3> + <ol> + + boolean + </ol> + + + + +</dd> + <dt> <a name = "get_last_modified"></a> <strong>get_last_modified (path)</strong> </dt> diff --git a/lua/colorizer.lua b/lua/colorizer.lua index ed8d596..7aac39e 100644 --- a/lua/colorizer.lua +++ b/lua/colorizer.lua @@ -371,6 +371,7 @@ function colorizer.setup(config) all = { file = false, buf = false }, default_options = merge(USER_DEFAULT_OPTIONS, user_default_options), } + BUFFER_OPTIONS, BUFFER_LOCAL = {}, {} local function COLORIZER_SETUP_HOOK(typ) local filetype = vim.bo.filetype @@ -412,8 +413,7 @@ function colorizer.setup(config) end end - local au_group_id = augroup(AUGROUP_NAME, {}) - AUGROUP_ID = au_group_id + AUGROUP_ID = augroup(AUGROUP_NAME, {}) local aucmd = { buf = "BufWinEnter", file = "FileType" } local function parse_opts(typ, tbl) @@ -446,12 +446,13 @@ function colorizer.setup(config) end end autocmd({ aucmd[typ] }, { - group = au_group_id, + group = AUGROUP_ID, pattern = typ == "file" and (SETUP_SETTINGS.all[typ] and "*" or list) or nil, callback = function() COLORIZER_SETUP_HOOK(typ) end, }) + COLORIZER_SETUP_HOOK(typ) elseif tbl then vim.notify_once(string.format("colorizer: Invalid type for %stypes %s", typ, vim.inspect(tbl)), "ErrorMsg") end @@ -461,7 +462,7 @@ function colorizer.setup(config) parse_opts("buf", buftypes) autocmd("ColorScheme", { - group = au_group_id, + group = AUGROUP_ID, callback = function() require("colorizer").clear_highlight_cache() end, |