jakewvincent / mkdnflow.nvim

Fluent navigation and management of markdown notebooks
GNU General Public License v3.0
695 stars 41 forks source link

message "A to-do symbol is longer than one character or may be a utf8 symbol. ..." although lua-utf8 luarocks is installed #139

Closed svenXY closed 1 year ago

svenXY commented 1 year ago

I have

 use({'jakewvincent/mkdnflow.nvim',
    rocks = 'luautf8', -- Ensures optional luautf8 dependency is installed
  })

in my packer configuration and it also claims to have it installed, but whenever opening a file, I get this warning message.

if user_config.to_do.symbols then
            local symbols = table.concat(user_config.to_do.symbols)
            if string.len(symbols) > #user_config.to_do.symbols and not utils.moduleAvailable('lua-utf8') then
                warn('⬇️  A to-do symbol is longer than one character or may be a utf8 symbol. To-do functionality may not work as expected. If you wish to use utf8 symbols, install the lua-utf8 luarocks dependency.')
            end
        end
jakewvincent commented 1 year ago

Hi @svenXY. Are you using any non-default to-do symbols? If so, I'd like to take a look at your mkdnflow config to see if I can reproduce this. Thanks.

svenXY commented 1 year ago

pretty default, except the complete symbol:

require('mkdnflow').setup({
    create_dirs = true,
    perspective = {
        priority = 'root',
        fallback = 'current',
        root_tell = 'index.md',
    },
    silent = false,
    links = {
        style = 'markdown',
        name_is_source = false,
        conceal = false,
        context = 0,
        implicit_extension = nil,
        transform_implicit = false,
        transform_explicit = function(text)
            text = text:gsub(" ", "-")
            text = text:lower()
            text = os.date('%Y-%m-%d_')..text
            return(text)
        end
    },
    to_do = {
        symbols = {' ', '.', '✓'},
        update_parents = true,
        not_started = ' ',
        in_progress = '.',
        complete = '✓'
    },
})
jakewvincent commented 1 year ago

@svenXY everything in your config looks fine, so I think it may be an issue with the lua-utf8 installation (or with mkdnflow finding it). Can you run the following in nvim and let me know what the output is?

:lua print(require('mkdnflow').utils.moduleAvailable('lua-utf8'))
svenXY commented 1 year ago

The answer is true

jakewvincent commented 1 year ago

Interesting, so the module is definitely installed and should be accessible to mkdnflow. What OS are you on?

svenXY commented 1 year ago

macOS ventura. Afaicr I copied the symbol from the symbols and special characters app (I think it is called "character viewer")

svenXY commented 1 year ago

✔︎ HEAVY CHECK MARK Unicode: U+2714 U+FE0E, UTF-8: E2 9C 94 EF B8 8E

I think it is

svenXY commented 1 year ago

update it wasn't the heavy check mark from above, but by copying this check mark from this github issue, I was able to reproduce the problem

jakewvincent commented 1 year ago

Interesting, thanks for the update @svenXY. I'm going to go ahead and close this, as I still can't reproduce this even by copying the symbol from this issue, and it seems like this might be resolved for you now. I suppose this this had something to do with how the symbol copied to the clipboard from the macOS app.