Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 293548 - [block selection][typing] Can only replace selected block with space, not tab
Summary: [block selection][typing] Can only replace selected block with space, not tab
Status: CLOSED DUPLICATE of bug 264168
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-28 05:35 EDT by Missing name CLA
Modified: 2010-02-08 12:35 EST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2009-10-28 05:35:12 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: 20090920-1017

I had a few lines indented like this

	aaa
		bbb
	ccc
		ddd
		eee
	fff
	ggg

I then wanted to mark a few of them with a character in the beginning of the line for later action:

x	aaa
x		bbb
xx	ccc
		ddd
x		eee
	fff
x	ggg

When I was done I wanted to use block selection to remove the Xs. This caused several problems.

1 If I selected the Xs all the way from the aaa to the ggg line I could not include the second x on the ccc-line. An example (the upper case Xs are selected. Note the lower case X on the ccc-line)

X	aaa
X		bbb
Xx	ccc
		ddd
X		eee
	fff
X	ggg

A work around for this was to include the tab character after the X on the ggg-line (again, upper case X, as well as underscores (_) for white space characters, indicates selection):

X_______aaa
X_______	bbb
XX______ccc
________	ddd
X_______	eee
________fff
X_______ggg


However, when trying to replace the whole selection with a tab, nothing happened. Replacing it with space or any regular letter (i.e. a) worked fine. Ended up doing the edit in jEdit instead which had no problem selecting everything from the beginning of the line until the first tab stop and then replacing the selection with a tab.

This was in an XML-file, in a comment.

Reproducible: Always
Comment 1 Remy Suen CLA 2009-10-28 07:35:14 EDT
(In reply to comment #0)
> This was in an XML-file, in a comment.

Does it work in a regular text editor?
Comment 2 Dani Megert CLA 2009-10-28 11:42:31 EDT
Tab key doing a shift to the right is standard behavior and there's no way we'll change that.
Comment 3 Missing name CLA 2009-10-30 08:37:19 EDT
That is a stupid answer. This is a real issue. Suggest a solution to it rather than WONTFIX.
Comment 4 Dani Megert CLA 2009-10-30 08:43:26 EDT
The answer is not stupid, it just tells you we won't fix it.
Comment 5 Missing name CLA 2009-10-30 09:26:42 EDT
Still, it is a real issue.  It is not uncommon that you want to replace a character in the middle of a line with a tab.
Comment 6 Dani Megert CLA 2009-10-30 09:56:17 EDT
>Still, it is a real issue.
I didn't say it's not an issue (that would be INVALID or WORKSFORME). We just won't spend time to fix this.

There's a simple workaround: copy Tab, select, paste.
Comment 7 ChristophK CLA 2010-02-08 04:18:52 EST
Couldn't the behaviour for tabs depend on whether block selection is active or not? If there is a block selected, tab would be inserted at the block, if normal selection is active, tab would indent/unindent the lines.
Comment 8 Dani Megert CLA 2010-02-08 04:34:42 EST
Tom, we once discussed this (see comment 7). What do you think?
Comment 9 Tom Hofmann CLA 2010-02-08 12:35:32 EST
This is certainly doable... see bug 264168 for the discussion about tab behavior. The bug is against JDT-Text, but also affects other editors.

*** This bug has been marked as a duplicate of bug 264168 ***