On Wed, May 14, 2008 at 05:54:19PM +0100, Nick Warne wrote: >>>> When I select a text and the last character is a " " (i.e. a >>>> space) it is not copied to the clipboard. When a printable >>>> character is behind it, then it's copied to the clipboard, but if >>>> a newline follows, the space is not copied, newline is! This is >>>> very annoying if one needs an *exact* copy of the selected text >>>> (which is something I use all the time!). >>> >>> Hmm. I don't think this is easily fixable. From the way the data is >>> stored, we have no way of differentiating between the output of the >>> following two commands >>> >>> echo "a " >>> echo "a" >>> >>> This will take a bit of work to fix, and we welcome patches :). >> >> Ummm. Interesting. I get this issue too, and found it slightly >> annoying. >> >> Just having a look, in src/screen.c are several define calls in line >> 5029: >> >> void >> rxvt_selection_make( ... >> >> #ifdef DONT_SELECT_TRAILING_SPACES >> STRIP_TRAILING_SPACE(str, new_selection_text); >> #endif >> >> which expand earlier in this file (line 144) to: >> >> #ifdef DONT_SELECT_TRAILING_SPACES >> # define STRIP_TRAILING_SPACE(str, fence) \ >> while (str > fence && ' ' == str[-1]) \ >> str --; >> #endif >> >> Sooo, looking, in src/feature.h line 526 is (which I have changed >> here!!) >> >> >> /* Strip trailing spaces from selection */ >> /* define DONT_SELECT_TRAILING_SPACES */ >> #undef DONT_SELECT_TRAILING_SPACES >> >> ...and this now appears to work OK for me :-) I haven't a clue if >> it's the right thing to do, but it only appears to affect the >> 'selection' at the time. >> >> find . -name \* -exec grep -Hn "DONT_SELECT_TRAILING_SPACES" {} \; >> ./src/feature.h:526:/* define DONT_SELECT_TRAILING_SPACES */ >> ./src/feature.h:527:#undef DONT_SELECT_TRAILING_SPACES >> ./src/screen.c:144:#ifdef DONT_SELECT_TRAILING_SPACES >> ./src/screen.c:5122:#ifdef DONT_SELECT_TRAILING_SPACES >> ./src/screen.c:5171:#ifdef DONT_SELECT_TRAILING_SPACES >> >> Nick > > So, with no replies, I guess what I done is wrong then? Works OK for > me (tm).
I looked at the code after you posted the first message. Looks OK. (IIRC while we can't distinguish from spaces and nothing, mrxvt does know the position of new lines. The code uses this to get the trailing spaces correctly.) If it looks like something popular, we can move it from feature.h to a configure option, GI -- 100 THINGS I'D DO IF I EVER BECAME AN EVIL OVERLORD 39. If I absolutely must ride into battle, I will certainly not ride at the forefront of my Legions of Terror, nor will I seek out my opposite number among his army.
pgpL2a8kKQKed.pgp
Description: PGP signature
------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________ Materm-devel mailing list Materm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/materm-devel mrxvt home page: http://materm.sourceforge.net