Emerald Editor Discussion
March 25, 2017, 02:48:41 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Idea for Line-Copy/Cut and Pasting  (Read 11892 times)
0 Members and 1 Guest are viewing this topic.
demiller9
Prospector
*
Posts: 3


« on: August 25, 2007, 04:05:03 pm »

I read some of the discussions about line-copy/-cut/-paste and how people don't like pasting because sometimes it inserts the text into the middle of a line. The only way (currently) to avoid it doing that is to move the caret to the start of the line where you want to insert the clipboard contents.

How about if CE 'remembers' whether the clipboard contents are a line-copy or just a selection-copy, and paste accordingly: selection copy goes to the caret location and line-copy goes to the start of the current line. [Devils Advocate here] What if the clipboard contents are modified or added outside of CE? [Response to DA] Maybe CE should generate a hash value of the clipboard contents when you do a line-copy so it can see if the clipboard was loaded externally, or contains just what (and how) it was loaded by CE. The paste function could decide like this: if the line-copy mode flag is on then we think the clipboard has CE line-copied text in it, compute the hash of the clipboard and confirm that it is still the contents CE put in the clipboard. If the hash matches the hash created when the line-copy was done, do a line-paste, otherwise reset the line-copy flag and do a paste to the caret. I think hash functions (especially for reasonable length clipboard contents) are fast enough this would be transparent to users.

Don
Logged
John Yeung
Senior Miner
***
Posts: 85


« Reply #1 on: August 26, 2007, 08:37:23 pm »

The idea that Crimson could keep what is essentially its own copy of the clipboard for unselected line copy/cut was already discussed, and it was decided that although it was technically feasible, too few people depend on this behavior while most of the rest of the users find this behavior unintuitive at best and extremely annoying at worst.

The idea that Crimson could make this behavior optional was also discussed, and it was decided that again, it helps too few people to be worth the added complexity and preference clutter.

John
Logged
Pvt_Ryan
Master Jeweller
******
Posts: 422



WWW
« Reply #2 on: August 27, 2007, 04:54:11 am »

As John has pointed out.

however if you wish i can create a patch to make this function optional/deactivate it and if you follow the instructions for compiling on VS express you can download our svn version, apply the patch and compile your own version. The change to make it is trival tbh so while the patch may not always be compatible with the svn repo in the future it should take in the region of 45secs to re-add/remove the required lines of code.

FYI clicking on a line number will highlight that line of code (yes I know thats an extra click but its not a huge effort)
Logged
demiller9
Prospector
*
Posts: 3


« Reply #3 on: August 27, 2007, 04:37:45 pm »

Yes, I suppose I could add the patch and compile my own copy. I am a software developer and use CE all day long. I use the keyboard for nearly every operation, and only have to reach for the mouse occasionally to select something in the file browser pane or reselect back to the main text pane. Everything else is done with the keyboard, which is why I posted the other thread about the unusability of build 1.90

Don
Logged
John Yeung
Senior Miner
***
Posts: 85


« Reply #4 on: August 28, 2007, 06:29:53 am »

I use the keyboard for nearly every operation, and only have to reach for the mouse occasionally

I was an avid vi user, so I appreciate as much as anyone how desirable it is to stay on the keyboard.  With vi, I didn't even have to make the trek to the arrow or page keys.  Once learned to the point of muscle memory, I know of nothing faster than vi.  (Presumably anything you could do in vi you can do in Vim, but the bulk of my programming for many years now has been on the AS/400, and I'm no longer proficient with vi.)

Anyway, I agree that clicking on a line number with a mouse is distracting and slow.  Faster for many users would be Home, Shift, and down-arrow (if you must make the selection).

John
Logged
Pvt_Ryan
Master Jeweller
******
Posts: 422



WWW
« Reply #5 on: August 28, 2007, 11:48:16 am »

Just doing the patch now..

Also anyone else that feels strongly that removing this was a mistake, please post here and if a significant number do complain then I will readd the option to enable/disable this behaviour.
Logged
Pvt_Ryan
Master Jeweller
******
Posts: 422



WWW
« Reply #6 on: August 28, 2007, 12:02:41 pm »

Patch attached.. Copying, Cutting and pasting empty lines is still disabled, but i assume you didnt care about that..

patch attached, built against rev 191.

There is a thread about how to compile under VS 2k5 express edition.
With the std or pro version of VS2k5. just apply patch to source and compile in release mode.

* AllowLineCutCopy.patch (1.17 KB - downloaded 483 times.)
« Last Edit: August 28, 2007, 12:04:21 pm by Pvt_Ryan » Logged
rageboy
Jeweller
*****
Posts: 305

Ankit Singla


« Reply #7 on: August 29, 2007, 07:01:38 pm »

This functionality actually already exists in current builds (well the cut/copy). I haven't yet figured out how to do line pastes, but for line cut and copy, check out the Edit>Line Oriented submenu. If you're building yourself, you can add keyboard shortcuts using the project resources. I didn't put them in because that would require a full overhaul of current keyboard shortcuts. If anyone knows how to make them customizable, PLEASE PLEASE PLEASE let me know! Smiley
Logged
pn8830
Global Moderator
Jeweller
*****
Posts: 252



« Reply #8 on: October 09, 2007, 05:34:24 pm »

I'm trying to document this functionality now. It seems confusing. So is Line Oriented Paste no different from regular paste?
PN
Logged

Entities should not be multiplied beyond necessity
rageboy
Jeweller
*****
Posts: 305

Ankit Singla


« Reply #9 on: October 14, 2007, 03:32:55 am »

Woah. Sorry for the delayed response. Yes, currently, but that's not the intended behavior. I've just had and will have this semester zero time to work on it. If I pull some out of my butt, I'll let you know, but this thread was trying to figure out what should be done.
Logged
champy
Prospector
*
Posts: 1



« Reply #10 on: May 13, 2009, 01:11:28 pm »

When line editing, its best to think of lines as objects, and so
yes inserting a line into the middle of another is inappropriate.
To detect if clipboard contents contain a line or not, look for a
CR/LF pair (assuming DOS ASCII encoding) at the end to indicate clipboard
contents are a line.
Also its nice to restore the caret to its original horozontal position after the
line insertion.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.127 seconds with 18 queries.