I think I've find a bug in the duplicate line TM proc:
If you are in _the middle of_ a line with accented chars, dup-line (⌃⇧D) do an strange thing sending the char besides the cursor to the dupped line:
cout << "Estadística|" << endl; (| indicates the cursor) and press ⌃⇧D
makes
cout << "Estadística << endl; cout << "Estadística"" << endl;
I don't know if this bug is already booked, my apologizes if so do.
.juan falgueras
Well, I can verify this. It seems to happen whenever you invoke duplicate on a line containing characters other than 7-bit ASCII, and you don't have a selection (i.e. the cursor is in that line somewhere). You get varying behaviour, depending on where the cursor is. Try this for instance:
abcåäödef
and hit ⌃⇧D with the cursor in different positions.
This is with textMate 1.5.7 (1436)
/Sven Axelsson
On 26/11/2007, Hans-Jörg Bibiko bibiko@eva.mpg.de wrote:
On 26.11.2007, at 12:59, Juan Falgueras wrote:
cout << "Estadística|" << endl;
I cannot verify this behaviour. If I do this I'll get a correct copy.
Do you have an other example? Which TM version and MAC OS do you're using?
--Hans ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 26/11/2007, Sven Axelsson sven.axelsson@gmail.com wrote:
Well, I can verify this. It seems to happen whenever you invoke duplicate on a line containing characters other than 7-bit ASCII, and you don't have a selection (i.e. the cursor is in that line somewhere). You get varying behaviour, depending on where the cursor is. Try this for instance:
abcåäödef
and hit ⌃⇧D with the cursor in different positions.
This is with textMate 1.5.7 (1436)
and OS 10.5.1
/Sven Axelsson
On 26 Nov 2007, at 12:59, Juan Falgueras wrote:
[...] I think I've find a bug in the duplicate line TM proc:
The reason for the confusion is that this is only a problem on Leopard.
The duplicate line uses bash with byte-offsets into the line string variable, but starting with Leopard, bash will treat the offsets as code-point offsets.
So we need to rewrite the command in some other scripting language to ensure compatibility with both Tiger and Leopard…
On 26 Nov 2007, at 16:06, Allan Odgaard wrote:
On 26 Nov 2007, at 12:59, Juan Falgueras wrote:
[...] I think I've find a bug in the duplicate line TM proc:
The reason for the confusion is that this is only a problem on Leopard.
The duplicate line uses bash with byte-offsets into the line string variable, but starting with Leopard, bash will treat the offsets as code-point offsets.
So we need to rewrite the command in some other scripting language to ensure compatibility with both Tiger and Leopard…
I can't test it with Leopard yet, but try this one:
On Tiger it works.
Cheers,
--Hans
I don't know if this was an issue with the original command or not, but try this:
$obj = new Object(); $obj = new Object();
Selecting both lines and then running the command gives this result:
= new Object(); = new Object(); = new Object(); = new Object();
... which obviously leaves out the four expected $obj. -- Ian Potter
On Nov 26, 2007, at 11:02 AM, Hans-Joerg Bibiko wrote:
On 26 Nov 2007, at 16:06, Allan Odgaard wrote:
On 26 Nov 2007, at 12:59, Juan Falgueras wrote:
[...] I think I've find a bug in the duplicate line TM proc:
The reason for the confusion is that this is only a problem on Leopard.
The duplicate line uses bash with byte-offsets into the line string variable, but starting with Leopard, bash will treat the offsets as code-point offsets.
So we need to rewrite the command in some other scripting language to ensure compatibility with both Tiger and Leopard…
I can't test it with Leopard yet, but try this one:
<Duplicate Line : Selection (Tiger:Leopard).tmCommand>
On Tiger it works.
Cheers,
--Hans ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 26/11/2007, Hans-Joerg Bibiko bibiko@eva.mpg.de wrote:
On 26 Nov 2007, at 17:18, Ian Potter wrote:
I don't know if this was an issue with the original command or not, but try this:
$obj = new Object(); $obj = new Object();
Ooops, sorry, I forgot to escape '$'.
This should work.
--Hans
Yes, that works fine. Thanks.
I was trying to grok your code and managed to find this error:
TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])} ${0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else
selecting both lines (at line 13 of your command) and invoking the command gives
TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])} ${0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])} ${0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else
Looks like backslashes aren't being escaped, or something. They're certainly missing from the second line. -- Ian Potter
On Nov 26, 2007, at 11:26 AM, Hans-Joerg Bibiko wrote:
On 26 Nov 2007, at 17:18, Ian Potter wrote:
I don't know if this was an issue with the original command or not, but try this:
$obj = new Object(); $obj = new Object();
Ooops, sorry, I forgot to escape '$'.
This should work.
--Hans
<Duplicate Line : Selection (Tiger:Leopard).tmCommand> ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 26 Nov 2007, at 17:43, Ian Potter wrote:
I was trying to grok your code and managed to find this error:
TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])\}
${0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else
selecting both lines (at line 13 of your command) and invoking the command gives
TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])\}
${0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else TextMate.exit_insert_snippet("#{e_snp(ENV['TM_SELECTED_TEXT'])}$ {0:#{e_snp(ENV['TM_SELECTED_TEXT'])}}") else
;P I don't see the forrest for trees.
OK hopefully the last one ;)
--Hans
On Nov 26, 2007, at 11:04 AM, Hans-Joerg Bibiko wrote:
;P I don't see the forrest for trees.
OK hopefully the last one ;)
<Duplicate Line : Selection (Tiger:Leopard).tmCommand>
Looks good to me, passed all the tests I threw at it. :)
Committed, thanks!