GithubHelp home page GithubHelp logo

Comments (2)

wellle avatar wellle commented on July 25, 2024

If you type the command ci{, the resulting output should (intuitively) erase "arg 2" and leave you in the appropriate spot in insert mode. The current behavior ends up with

I agree that it would be sometimes useful to change arg 2 with ci{, but if I prefer to seek into targets in the current line over selecting the surrounding target it will be impossible to work on the surrounding target.

One idea could be to add a modifier like c (for current) that doesn't seek. In that case ci} could operate on arg 2, while cic} would select the big block. This would collide with textobj-word-column.vim.

Alternatively we could add a modifier that seeks like s. In this case ci{ would select the surrounding target while cis{ would seek into arg 2. This would collide with sentence text objects (which I don't use).

Additionally, it's also worth noting that vim's built in % matching command seems to automatically match the first line with the "matching" bracket 50 lines down, just like your plugin does.

That sounds like there are some unmatched brackets in your file (like the ] in ]p). This confuses Vim's pair matching that targets.vim relies on. I use the same % command internally.

If I'm within, say, 10-15 characters of something more narrow that matches the command, then act on that instead of the wider selection, and if I'm further away from it (say, at the other end of a line of code), the plugin should act on the larger area.

I'm not a big fan of such random numbers. It's always hard to judge how the plugin will behave depending on such limits. As commented elsewhere I could like the idea of not seeking into a target that is completely off screen. Or even only seeking into targets that at least touch the current line.

I could start to like the idea of seeking into targets that are completely contained in the current line, even if there is a bigger surrounding target present, but I'm not sure yet.

In any case, thank you for your feedback, I will consider it in the future!

Let me know what you think of my comments.

from targets.vim.

wellle avatar wellle commented on July 25, 2024

@thang1thang2: Sorry for the late update, but seeking has been improved and made customizable in #129. I just tested your example again and it works now as you desired. Thanks!

from targets.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.