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

Add paragraph + indenation text object/motion #1580

Closed
cyruseuros opened this issue Jan 26, 2022 · 5 comments · Fixed by #1627
Closed

Add paragraph + indenation text object/motion #1580

cyruseuros opened this issue Jan 26, 2022 · 5 comments · Fixed by #1627
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements

Comments

@cyruseuros
Copy link

These are very simple to define (by whitespace) and often reflect logical groupings that are not part of a programming language's grammar (not Treesitter's domain).

I tend to put lines of code that are related together, and I do my best to indent things semantically. I think this applies to most programmers across all filetypes so it makes sense as language-agnostic functionality.

@cyruseuros cyruseuros added the C-enhancement Category: Improvements label Jan 26, 2022
@archseer
Copy link
Member

very simple to define

Actually, there was quite a bit of work to get it working properly: #784

@pickfire is going to do another pass at it.

Partly duplicate of #753

@cyruseuros
Copy link
Author

@archseer my mistake, I didn't mean that it would be easy from an implementation standpoint. What I meant to say was that it is very easy to unambiguously define across languages, i.e.:

  • a paragraph is all text between two consecutive newlines
  • an "indentation" is a contiguous portion of text (possibly separated by newlines) preceded by an identical sequence of non-newline whitespace characters.

@pickfire
Copy link
Contributor

Yes, the first implementation I want it to be in a behavior that I would like to use, but it end up being more complicated that I thought, so I guess I am just gonna port kakoune's implementation over.

But lately I am busy, I really like this feature too so I guess I need to speed on this since someone is requesting it too.

@kirawi kirawi added the A-tree-sitter Area: Tree-sitter label Jan 26, 2022
@cyruseuros
Copy link
Author

@pickfire kakoune's implementation sounds great to me. Which differences did you originally plan to implement?

Honestly, the absence of this and searching with an interactive prompt are the only things that still have me occasionally opening Vim, and I'd say that's pretty impressive for an editor this young. Keep up the good work!

@pickfire
Copy link
Contributor

@pickfire kakoune's implementation sounds great to me. Which differences did you originally plan to implement?

When you select paragraph from the end of the file, it will select the last paragraph with previous whitespace, kakoune does not do that but vim do that.

pickfire added a commit to pickfire/helix that referenced this issue Feb 7, 2022
Also improved testing facility.

Fix helix-editor#1580
pickfire added a commit to pickfire/helix that referenced this issue Feb 21, 2022
Also improved testing facility.

Fix helix-editor#1580
pickfire added a commit to pickfire/helix that referenced this issue Mar 7, 2022
Also improved testing facility.

Fix helix-editor#1580
pickfire added a commit to pickfire/helix that referenced this issue Apr 1, 2022
Also improved testing facility.

Fix helix-editor#1580
archseer pushed a commit that referenced this issue Apr 2, 2022
Also improved testing facility.

Fix #1580
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants