Skip to content

v1.1.0

Choose a tag to compare

@delphinus delphinus released this 12 Apr 08:30
· 13 commits to main since this release
d47f082

Simplify M.query() API

M.query() now takes only a word argument. Dictionary and regex operator configuration is done through the instance API.

Before

local migemo = require "luamigemo"
local pattern = migemo.query(nil, "kensaku", migemo.RXOP_PCRE)

After

local migemo = require "luamigemo"
local pattern = migemo.query("kensaku")

Customizing regex dialect or dictionary

Use migemo.get() to create an instance with full control:

local m = migemo.get()              -- bundled dict
m:set_rxop(migemo.RXOP_VIM)         -- Vim regex
local pattern = m:query("kensaku")

-- Or with a custom dictionary
local m = migemo.get("/path/to/dict")
m:set_rxop(migemo.RXOP_PCRE)
local pattern = m:query("kensaku")