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

Lookbehind local keymap setting #588

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ilan-schemoul
Copy link
Contributor

Problem : #156 we may want a global setting (e.g: lookahead) for most keymaps and then override that setting for one keymap (e.g: lookbehind)
You can now add a local lookbehind/lookahead in the keymap that takes precedence :

      textobjects = {
        select = {
          enable = true,
          lookahead = true,
          keymaps = {
            ["t="] = { query = "@type", desc = "Select right hand side of an assignment", lookbehind = true }, 
          }
        }
      }

@ilan-schemoul ilan-schemoul force-pushed the lookbehind-local-keymap-setting branch 2 times, most recently from 56fd5a9 to 1a15e87 Compare April 3, 2024 12:36
@ilan-schemoul ilan-schemoul force-pushed the lookbehind-local-keymap-setting branch from 1a15e87 to 3abfc72 Compare April 3, 2024 22:03
@ribru17
Copy link
Member

ribru17 commented Apr 10, 2024

Thank you for the contribution! I think we may have to wait on merging this until #523, due to the nature of the change.

@kiyoon
Copy link
Collaborator

kiyoon commented Dec 4, 2024

The development is now done in main and master is frozen. Can you open a new PR with this feature?

@@ -94,10 +94,18 @@ local val_or_return = function(val, opts)
end
end

function M.select_textobject(query_string, query_group, keymap_mode)
function M.select_textobject(query_string, query_group, keymap_mode, local_lookahead, local_lookbehind)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name of the args could be lookahead and lookbehind. If they are not defined just use the global. Or I would name it like override_lookahead etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants