This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to automatically remove blank lines - kdevelop

Tags: None
(comma "," separated)
sdemattia
Registered Member
Posts
9
Karma
0
is there a way/tool to automatically remove blank lines on kdevelop Version 4.3.1?
For instance

Code: Select all
    tmpTime.tm_year = RTC_Time->bYear1 * 100 + RTC_Time->bYear - 1900;

    tmpTime.tm_mon = RTC_Time->bMonth - 1;

    tmpTime.tm_mday = RTC_Time->bDay;


should be replaced by

Code: Select all
    tmpTime.tm_year = RTC_Time->bYear1 * 100 + RTC_Time->bYear - 1900;
    tmpTime.tm_mon = RTC_Time->bMonth - 1;
    tmpTime.tm_mday = RTC_Time->bDay;
User avatar
kfunk
KDE Developer
Posts
53
Karma
0
OS
Inside your document, press Ctrl+R (for Search/Replace)

Then enter "\n\n" (without quotes) in the Find input element.
Enter "" (without quotes) in the Replace input element.
Select "Regular Expression" mode.

Press Replace All.
sdemattia
Registered Member
Posts
9
Karma
0
thanks krf but that's a kind of workaround. Are there no visual solution like a checkbox for removing the blank lines? Thanks
User avatar
kfunk
KDE Developer
Posts
53
Karma
0
OS
Nope, there's no visual indicator for that kind of action.

You can file a bug/wish against Kate (KDevelop is using Kate as editor component) on bugs.kde.org for this kind of issue. I think it would be a good idea to have a separate action such as "Remove blank lines" hidden somewhere in the top menu. Other editors have that, too (e.g. Notepad++).
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Well, you can just write a Kate script to do this. Then you'll have a menu action, too. ;)

Cheers,
Sven


I'm working on the KDevelop IDE.
User avatar
kfunk
KDE Developer
Posts
53
Karma
0
OS
@sdemattia: Wouldn't that be a nice opportunity to contribute something to Kate? :)
sdemattia
Registered Member
Posts
9
Karma
0
@krf, yes that's sound nice. I hope I will have time and do it within the next 2 weeks


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]