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

feat: add an UI option to ignore conceal warnings #778

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

- Added `opts.ui.ignore_conceal_warn` option to ignore conceal-related warnings.

### Added

- Added `opts.follow_img_func` option for customizing how to handle image paths.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ This is a complete list of all of the options that can be passed to `require("ob
-- This requires you have `conceallevel` set to 1 or 2. See `:help conceallevel` for more details.
ui = {
enable = true, -- set to false to disable all additional syntax features
ignore_conceal_warn = false, -- set to true to disable conceallevel specific warning
update_debounce = 200, -- update delay after a text change (in milliseconds)
max_file_length = 5000, -- disable UI features for files with more than this many lines
-- Define how various check-boxes are displayed
Expand Down
2 changes: 2 additions & 0 deletions lua/obsidian/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ end
---@class obsidian.config.UIOpts
---
---@field enable boolean
---@field ignore_conceal_warn boolean
---@field update_debounce integer
---@field max_file_length integer|?
---@field checkboxes table<string, obsidian.config.CheckboxSpec>
Expand Down Expand Up @@ -438,6 +439,7 @@ config.UIOpts = {}
config.UIOpts.default = function()
return {
enable = true,
ignore_conceal_warn = false,
update_debounce = 200,
max_file_length = 5000,
checkboxes = {
Expand Down
2 changes: 1 addition & 1 deletion lua/obsidian/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ M.setup = function(workspace, ui_opts)
callback = function()
local conceallevel = vim.opt_local.conceallevel:get()

if conceallevel < 1 or conceallevel > 2 then
if (conceallevel < 1 or conceallevel > 2) and not ui_opts.ignore_conceal_warn then
log.warn_once(
"Obsidian additional syntax features require 'conceallevel' to be set to 1 or 2, "
.. "but you have 'conceallevel' set to '%s'.\n"
Expand Down