Author Topic: Improve column mode edit, restore zero-with selection  (Read 4681 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Improve column mode edit, restore zero-with selection
« on: April 21, 2011, 02:40:13 pm »
While stumbling over an thread comparing editors i get an idea, maybe from interest?


While in column mode (Alt+C) i can do an zero-with selection with the mouse or by using Shift+Arrow-Keys Up/down.
I can even move this selection by using Arrow-Keys Left/right. That's good.
But once i have used this zero-with selection to type something i get an blue selected area
and i can't move the zero-with selection to an other column anymore.
On the other hand i can move the zero-with selection to an other column
if i doesn't type but only delete to the left or right. That's nice.

So i have two suggestions:

1.) we already talked somehow about to not create an new selection if i type in an zero-with selection,
and so be able to move the caret around even after typing.
Maybe this can be improved to allow to move the zero-with selection even after start typing to an other column.

2.) maybe you can store the start- and end line of an zero-with selection
and restore this zero-with selection by an command ,
something like "Edit > Selection > Restore"
but "Edit > Selection > Restore Zero-With Selection"

Or restore it by first pressing of Shift+Arrow (see above),
if an user then press the arrow key an second time
this restored zero-with selection is removed again and HE starts to do an new zero-with selection.
Or something like this.


All in all, what an user wants to do is
* make an zero-with selection
* type something
* move to an other column
* type there some more
Stefan, HippoEDIT beta tester 
HippoEDIT - the editor programmers wants to code thyself when they are dreaming.        -Don't just edit. HippoEDIT!-

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Improve column mode edit, restore zero-with selection
« Reply #1 on: April 21, 2011, 07:44:15 pm »
Hi Stefan,

OK,  I think I will agree here. Maybe zero-width selection should be handled differently then non-zero-width. Also taking into account, that it is already different and can be moved and so on.. So, I think the right way will be to to extend zero-width selection if user start typing, so then it will be possible to move it also. If user has non-zero-width selection, he can decrease it to zero-width and than move. Will check if there were some technical problems on my side to do this.

Nevertheless, yes, I think such behavior is more user friendly and should be implemented. But already on 1.50. It is already more less stable for "experienced" users so you will be able to check the feature soon. I am planinng to update 1.50 soon, wait till that time.

Best regards,
Alex.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Improve column mode edit, restore zero-with selection
« Reply #2 on: April 27, 2011, 01:31:41 am »
will be done in 1.49 -> was one line of code change. Hope this will not influence stability :)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Improve column mode edit, restore zero-with selection
« Reply #3 on: May 02, 2011, 07:42:50 am »
809

Question: (c|sh)ould there be an option to skipping writing to empty lines?

F.ex. see picture
where i have tested zero-width selection over multiple lines incl. empty lines
where i want to modify only the lines containing text
(or maybe even more specially: containing  text only at the current column working on)

I have not fully invented when and how, and i am not sure if and how you would be able to detect such thing,
(because i think you would have to remember if there was text in that lines at that column right before starting editing)
but want to mention just as an idea or at least as an hint for later request about this behaviour.

As for the main improvement i think it works very well as far as i have seen now, thank you (review will follow)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Improve column mode edit, restore zero-with selection
« Reply #4 on: May 02, 2011, 09:35:42 am »
Yes,  I see the point (based on your screenshot). Generally, I agree that such behavior is better.

there are several problems I see:
- what is the default: edit all lines or only not empty? I do not want to have one more mode or a "special" shortcut. Nobody will remember this.
- theoretically, I can detect empty (completely) lines, and skip them during processing, but with your request for specific column I will delay (the implementation is not trivial and maybe generic case will be sufficient in 80% of cases).
- this feature is already "big/risky" for 1.49. So, it will go in 1.50. I think it s already fine, and can be used by experienced users (not all features yet inside, but rest should work fine). I have updated it yesterday, you can check. Installer link is in 1.50 post.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Improve column mode edit, restore zero-with selection
« Reply #5 on: May 02, 2011, 12:26:07 pm »
Both possibilities could be an feature.
I just wanted to think about.
I think it is fine as it is right now, but maybe for your code you should keep the door open for alternatives.

- - -

Just for reference the both possibilities form my POV:


Case A
* default: edit all but not empty lines
* if i want to modify the column in non-empty lines too,  i would fill those line up with an special sign like ###, and use search&replace to empty the lines again afterwards

Code: [Select]
1.
AAAAAAAAAAAAAAAAAAAA

BBBBBBBBBBBBBBBBBBBBBBB


2.
AAAAAAAAAAAAAAAAAAAA
####################
BBBBBBBBBBBBBBBBBBBBBBB


3.
AAAAAAAAXXXAAAAAAAAA
#########XXX########
BBBBBBBBBXXXBBBBBBBBBBB


4.
AAAAAAAAXXXAAAAAAAAA
        XXX
BBBBBBBBBXXXBBBBBBBBBBB


Case B
* default: edit all incl. empty lines (like it is right now)
* if i didn't want the empty lines to be modified, i have to delete the modifications afterwards

Code: [Select]
1.
AAAAAAAAAAAAAAAAAAAA

BBBBBBBBBBBBBBBBBBBBBBB


2.
AAAAAAAAXXXAAAAAAAAA
        XXX
BBBBBBBBBXXXBBBBBBBBBBB


3.
AAAAAAAAXXXAAAAAAAAA

BBBBBBBBBXXXBBBBBBBBBBB



In both cases
* shorter lines in between should not be handled specifically, they are just non-empty but no data at that column. That would be anyway an special case.

- - -

Alex> "what is the default: I do not want to have..."
The default could be an setting in XML for that session.
Of course it is always better to have an case-wise setting, i.e. switchable from menu...
but i think it would be enough to have at least an session-wise setting to allow the user to set his/her preferences.

Let's talk about for version 12 or so  :police:

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2183
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Improve column mode edit, restore zero-with selection
« Reply #6 on: May 02, 2011, 02:14:58 pm »
I like Case A as default, and user can switch logic back with XML flag.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Improve column mode edit, restore zero-with selection
« Reply #7 on: May 04, 2011, 07:18:46 pm »
Quote
Version 809: - 02 May 2011
Improved column mode edit Zero-Width selection.

Works very well.
Now i can move the zero-width selection and modify just an other column.
Also restoring the last used zero-width selection works, meaning i can restore the selection even if i do other things in between.
See video at http://www.youtube.com/watch?v=yz1NoXnjzPo

Awesome, that's how it should work i think.
Many thanks. This is an great plus for HippoEDIT.

- - -

Info for readers:

Too make an zero-width selection
hold Shift+Alt keys and make an selection with the Up/Down arrow keys
or hold the Alt-key and use the left mouse to make an vertical selection.
Press Up or Down arrow key to unselect.

See pictures below how this zero-width selection looks like.
In first picture i had made an zw sel to ad "New. "  in front to some lines.
In second i had made an zw_sel at the end of the lines to ad  trailing "</p>"

Use menu "Edit | Selections | Restore" to restore just the last selection, no matter if line, column or zero-width selection.
« Last Edit: May 04, 2011, 07:46:37 pm by Stefan »

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
3200 Views
Last post February 01, 2009, 01:31:11 pm
by Stefan
5 Replies
3307 Views
Last post April 17, 2009, 03:38:58 pm
by alex
3 Replies
1729 Views
Last post August 27, 2009, 08:43:20 pm
by alex
8 Replies
3258 Views
Last post August 13, 2010, 06:30:27 pm
by knn
2 Replies
1815 Views
Last post August 11, 2010, 03:46:24 pm
by alex