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

Behavior of line join #2031

Open
kuchaguangjie opened this issue Jan 2, 2019 · 4 comments
Open

Behavior of line join #2031

kuchaguangjie opened this issue Jan 2, 2019 · 4 comments

Comments

@kuchaguangjie
Copy link

kuchaguangjie commented Jan 2, 2019

Hi,

I changed the shortcut of join lines to Ctrl + J, then tried to join lines.

Seems following behavior exists:

  • It will join all following lines, till a line start with blank char (while space / new line).
  • If the current line start with blank char, it won't join.

To my experience, the rule is not very convenient in reality.

So, is it possible to customize to following behavior:

  • Only join current line and the next line, despite the content of this or next line.
    This also seems to be the behavior of:
    • Vim, via Shift + J
    • IDEA, via Ctrl + Shift + J
    • Eclipse, via Ctrl + Alt+ J
@elextr
Copy link
Member

elextr commented Jan 2, 2019

Please note, Geany isn't Vim, IDEA, Eclipse or any other editor.

That binding is undocumented so it could do anything, including eating your shorts. And it does not have a menu entry. And in fact it does join_paragraph() so its also misnamed. So in general that entry should be deleted. Especially as joining a paragraph has been superseded by reflow lines.

After its deleted someone could replace it with some other functionality, like simple join lines, and this time with a menu entry as well. Just needs somebody to make a pull request.

@lpaulsen93
Copy link
Contributor

@elextr: do you really think it's OK to boldly remove the exisiting capability? If yes, maybe we should remove it in Geany core and the new feature "Join lines" (as described above) IMHO is also a good candidate for the Line Operations plugin.

@elextr
Copy link
Member

elextr commented Oct 1, 2019

@LarsGit223 on further consideration I guess join paragraph is useful for some HTMLists who have their paragraphs on one line and similar use-cases and reflow doesn't do the same thing.

IRC (without checking) reflow uses the join_paragraph() code so its not going to be removable even if it was exposed from line operations.

So since it already exists in Geany I guess that although "Join Lines" is technically correct it does not actually describe which lines. So the keybinding should to renamed to "Join Paragraph", added to the Edit menu (eg next to reflow), and documented rather than removal.

One day "somebody" will go through the keybindables and find all those not in the menus and add them so they are discoverable, but thats a separate issue.

@ntrel
Copy link
Member

ntrel commented Feb 17, 2023

That binding is undocumented

Documented in #3402.

And in fact it does join_paragraph() so its also misnamed

It's more subtle than that, see the above PR.

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

No branches or pull requests

4 participants