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

Feature: fallback to swapping lines if not in a list #80

Open
IndianBoy42 opened this issue Jun 1, 2023 · 2 comments
Open

Feature: fallback to swapping lines if not in a list #80

IndianBoy42 opened this issue Jun 1, 2023 · 2 comments

Comments

@IndianBoy42
Copy link
Contributor

I think it just makes sense, and I have found myself wanted to swap lines of code sometimes.

Could also fallback ISwap -> ISwapNode and ISwapWith -> ISwapNodeWith instead but I think this has much less utility.

@mizlan
Copy link
Owner

mizlan commented Jun 5, 2023

hmm.... why can't the user just call the right function? Also iswapnode would work with expressions spanning multiple lines while naively swapping lines wouldn't, and I'm not sure if the latter is in the scope of my plugin

@IndianBoy42
Copy link
Contributor Author

IndianBoy42 commented Jun 5, 2023

Maybe it's just my preference, I like having just one keybinding or as few keybindings as I can for similar functions. It's why ive moved from 10 hop keybindings with treesitter stuff to just using leap.nvim to go anywhere. The thought process then simplifies from "I want to swap these things, they are lines, click the right key sequence and then labels" to "I want to swap these things, click the key sequences and then labels", and hopefully if me and the plugin are in sync about where labels should go it works out.

My idea was to add that as a fallback when we're not in the list, so not changing anyone's workflow just trying to make a guess at what the user might want, they can always Esc and cancel it.

I might try and code it up as a user configurable fallback function, or even user configurable target selection, and see how it fits in my workflow

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

No branches or pull requests

2 participants