how to sort then remove duplicate line?

Started by swu, August 10, 2011, 04:59:53 AM

Previous topic - Next topic

swu

Is there such a fucntion?  If I have sorted the text and want to remove duplicate entries such as one extra line2 below (otherwise it's a new feature request :-):

line1
line2
line2
line3

swu

well, I found the answer myself under Format menu.  However I run into issue with Join line as it introduces extra space at the end of each line item joined.

e.g. it looks like
A,
B,
C,

after join line it is like
A, B, C,  (extra space before the comma)

Stefan

Quote06 July 2011, Once more update for 1.49 release. Build number 821.
- Fixed. Join Lines logic has been corrected to insert additional space between joined lines, if there are no spaces already

I am afraid it was me suggesting this behavior, and today i think that was not an good idea.
However it had made sense for joining sentences but not for joining other strings as you show us here.
Because while i can easily add an trailing space after each line before joining,
it is not that easy to find and remove unwanted spaces inside an string after joining.

Since i think Alex didn't want to provide two join commands in the menu i would agree it is an good idea to go back to the old logic.
The question is: what is more common? joining sentences or joining string?
Since HE is an code editor i think now the second, and that it is not always good to let the program be as smart as it could be (remember me later again about this wise words)

- - -

As an meanwhile work around i would add an additional trailing sign like:
A,~
B,~
C,

and then after joining
A,~ B,~ C,

remove that sign-space-pair
A,B,C,
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

alex

Hi Stefan,

maybe you have also requested this feature (adding of extra space if not exist between lines on join), but it was an request of another user (by mail). I have also verified the logic with Notepad++, which works exactly like now. So, it is unclear, really, what is right. And I do not want to create a second Join function :).

Maybe the solution will be as usual an addition XML flag, controlling the logic...

BR, Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]

swu

thanks for reply.  I also have Notepad++ before purchase HE, so I think this means there are things I see in HE when decided to switch. :)

A clear answer to the question or any at all, is to what extent a side effect can be consdider normal.  Personally I will be surprised if I type a character i and the editor automatically expands to it (say the next word in the dictionary that matches) without needing some kind of shortcut key.

HE doesn't need to mimic other editor's behavior, but it should have its own standard and definition.  To conclude, I am absolutely surprised that extra spaces come free by using the join function, or when selecting multiple lines, there are extra characters at the end of each line which you don't see if you hit 'End' to position cursor at the end of the line. 

Please consider this behavior as a user option in the editor configuration, let the user decide what is the right behavior for join line, he can pick any character he want - for me it means nothing should be inserted.

alex

Hi swu,

HE does not mimic some other editor, but if new function is added or something is changed, I do not want to invent new / change standards if they already exist. Because from one side people already used with them and will ask me for the same behaviour and from another side, I believe, that if somebody already did a decision before, he has done an investigation what is better.

But this does not mean that if I see that way existing is bad, I take it without any doubts, this only mean that for decision I am not 100% sure and which are not obvious, I use others experience.

But nevertheless, I will restore old behavior, and will move current as alternative, to be switchable with new xml flag.

BR, Alex.
HippoEDIT team
[url="http://www.hippoedit.com/"]http://www.hippoedit.com/[/url]