From 70541308916d8f4c8e7779e10d7516b2ba26d7d4 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Sun, 7 Sep 2014 12:14:52 -0400 Subject: [PATCH] *added ability to copy and paste endlines inside texted for objects --- pd/src/g_rtext.c | 2 +- pd/src/pd.tk | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c index c17f7c971..d9d9ee0ad 100644 --- a/pd/src/g_rtext.c +++ b/pd/src/g_rtext.c @@ -558,7 +558,7 @@ void rtext_key(t_rtext *x, int keynum, t_symbol *keysym) if (keynum) { int n = keynum; - if (n == '\r') n = '\n'; + if (n == '\r' || n == '\v') n = '\n'; if (n == '\b') /* backspace */ { if (x->x_selstart && (x->x_selstart == x->x_selend)) diff --git a/pd/src/pd.tk b/pd/src/pd.tk index 48748edaa..2cce6f657 100644 --- a/pd/src/pd.tk +++ b/pd/src/pd.tk @@ -7098,10 +7098,14 @@ proc pdtk_pastetext {} { global pdtk_pastebuffer set pdtk_pastebuffer "" catch {global pdtk_pastebuffer; set pdtk_pastebuffer [clipboard get]} - #puts stderr [concat paste $pdtk_pastebuffer] + #puts stderr "paste <$pdtk_pastebuffer>" for {set i 0} {$i < [string length $pdtk_pastebuffer]} {incr i 1} { set cha [string index $pdtk_pastebuffer $i] scan $cha %c keynum + #puts stderr "keynum=<$keynum>" + #if { $keynum == 11 } { + # set keynum 15 + #} if {$i == [expr [string length $pdtk_pastebuffer] - 1]} { # unlike key command which would be pd [concat pd key 1 $keynum 0\;] # we add first digit to ask for force getscroll as we limit the number of -- GitLab