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

Line Operations - leave 1 empty line #498

Closed
ghost opened this issue Nov 10, 2016 · 2 comments
Closed

Line Operations - leave 1 empty line #498

ghost opened this issue Nov 10, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2016

For code readability it is common to skip a line every now and then (between functions, variable declarations and so on). May be it is nice to have an option in Line operations to leave those lines.

Easiest way to do this would be to provide a new option which does exactly the same as "Remove empty lines" with the following exception. If there are "n" blank lines together, only delete "n-1" of them.

@smostertdev
Copy link
Contributor

smostertdev commented Dec 20, 2016

I think that adding a "Remove n-1 empty lines" to LineOperations is great idea.

However, there are some concerns:

  • Implementing this function should be simple enough, but I feel like this kind of plugin can quickly get out of hand with unused functions. Are there enough people who would use this function?

  • This is stepping over the line into the land of 'code styling'.

    • This plugin is not really intended to format code (that stuff gets crazy real quick)

If you are looking for a quickly solution try this:

  1. In find and replace (ctrl-h)
    check: "Use regular expressions", "Use multi-line matching", "Case sensitive"
  2. Search for: "\n{3,}" (or "(\r\n){3,}" in windows)
  3. Replace with: "\n\n" (or "\r\n\r\n" in windows)

If you are looking for a more complex solution try AStyle.

If you can convince me that my concerns above are not a problem, then I would be more than happy to add this function. Please let me know what you think after reading this.

@ghost
Copy link
Author

ghost commented Dec 20, 2016

I agree. I raised this issue before I knew about AStyle or ClangFormat. I also came across this plugin for Geany. So, if Geany devs think that this is an unnecessary function, please feel free to close this issue.

@ghost ghost closed this as completed Jan 9, 2017
This issue was closed.
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

1 participant