Skip to content

mini.ai: troubles defining number with whitespace #971

Answered by echasnovski
simonmandlik asked this question in Q&A
Discussion options

You must be logged in to vote

Just replacing %w with %d I arrived at

custom_textobjects = {
  U = { "()()%f[%w]%w+()[ \t]*()" },
  S = { "()()%f[%d]%d+()[ \t]*()" }
}

Testing on 1234 , vaU correctly selects the whole line, whereas vaS only selects the first space. Where is the mistake please?

For me both vaU and vaS select 1234 and the whole whitespace to the right. This is the whole 'mini.ai' setup:

local ai = require('mini.ai')
ai.setup({
  custom_textobjects = {
    U = { '()()%f[%w]%w+()[ \t]*()' },
    S = { '()()%f[%d]%d+()[ \t]*()' },
  },
})

Make sure that S is not being overridden by something else. Output of :=MiniAi.config.custom_textobjects should show exactly what you'd expect.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@simonmandlik
Comment options

Answer selected by simonmandlik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants