GithubHelp home page GithubHelp logo

Comments (8)

wellle avatar wellle commented on August 28, 2024

Thank you for letting me know! I can reproduce the issue and agree that it should be fixed. I will address this in the next days.

from targets.vim.

UnrealQuester avatar UnrealQuester commented on August 28, 2024

Use IB instead of iB. I is exluding whitespace whereas i is everything inside the braces. If you do not like this behaviour you can change g:targets_aiAI and switch I and i.

from targets.vim.

dhleong avatar dhleong commented on August 28, 2024

Should the brace be considered "inside" the brace, though? That doesn't
seem logical, not to mention breaking expected behavior with default vim.

from targets.vim.

UnrealQuester avatar UnrealQuester commented on August 28, 2024

The brace is not selected when executing >iB, but the whitespace before it in the same line is. You can canfirm this with viB. ">" does not care what is actually selected by the text object. It only operates on lines. Because the last line with the brace has the whitespace selected it is indented as well. However, I agree that the default behaviour of I and i should be switched. But this would break backwards compatibility.

from targets.vim.

dhleong avatar dhleong commented on August 28, 2024

Ah, I see. Thank you for explaining.

from targets.vim.

wellle avatar wellle commented on August 28, 2024

@UnrealQuester Thank you for the explanation. I was actually thinking about switching i and I for a while now. Most of the time excluding the whitespace seems to be more natural. However, both versions have their use case:

  • when changing, whitespace should be preserved cI}
  • when deleting, whitespace should be removed di}

I am not sure what is the more common operation. One could even think about combining i} to work differently depending on the pending operator. But that sounds complicated and is not easy to expand when working with third party operators like vim-surround or vim-exchange.

If you want to continue this discussion, feel free to open a separate issue. 👍

from targets.vim.

wellle avatar wellle commented on August 28, 2024

@dhleong The issue is fixed with #70. Multiline selections where the last line consists only of whitespace will exclude that whitespace now. This should be compatible with default Vim.

Thanks again!

from targets.vim.

dhleong avatar dhleong commented on August 28, 2024

Awesome, thank you!

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.