Newly introduced: {} and cursor positioning

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: Newly introduced: {} and cursor positioning

Post by EvilBMP »

Karlis wrote:Also you did not mention about trailing space removal option, so we did not test that. If that is on, there are some problems indeed.
But imho no problems with the auto-indent. I'm not sure what interaction this option should have with the auto-indent. Sure, if you don't type anything (and move to another line) then the indent will be removed - that's correct and I'm aware of this. So please just concentrate on the "Use Tab key for indenting" enabled or not, so that tabs or spaces are used for the indent AND make sure, that the auto-indent cares about still existing indent.

:arrow: That's "all" to fix - after that it should work correctly 8)

Many thanks, EvilBMP
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: Newly introduced: {} and cursor positioning

Post by blepore »

EvilBMP wrote:
Karlis wrote:Also you did not mention about trailing space removal option, so we did not test that. If that is on, there are some problems indeed.
But imho no problems with the auto-indent. I'm not sure what interaction this option should have with the auto-indent. Sure, if you don't type anything (and move to another line) then the indent will be removed - that's correct and I'm aware of this. So please just concentrate on the "Use Tab key for indenting" enabled or not, so that tabs or spaces are used for the indent AND make sure, that the auto-indent cares about still existing indent.

:arrow: That's "all" to fix - after that it should work correctly 8)

Many thanks, EvilBMP
Actually, this does affect things and having the 'remove trailing spaces' checked does indeed present a bug that needs to be fixed. Consider my situation:

Using 9.0.0.95 with Auto indent and Use Tab both set to 3, convert tab unchecked and remove trailing spaces and tabs checked. Consider the following indents (where every three dots represent one tab):

if (true) {
...if (true) {
......if (true) {
.........if (true) {
...// this is where my cursor went
.........}
......}
...}
}

(Yes, that code makes no sense but was just used to illustrate the point).
ajmaske
Posts: 38
Joined: Fri Jun 01, 2007 4:15 am
Location: Modesto, CA
Contact:

Re: Newly introduced: {} and cursor positioning

Post by ajmaske »

blepore wrote:
EvilBMP wrote:
Karlis wrote:Also you did not mention about trailing space removal option, so we did not test that. If that is on, there are some problems indeed.
But imho no problems with the auto-indent. I'm not sure what interaction this option should have with the auto-indent. Sure, if you don't type anything (and move to another line) then the indent will be removed - that's correct and I'm aware of this. So please just concentrate on the "Use Tab key for indenting" enabled or not, so that tabs or spaces are used for the indent AND make sure, that the auto-indent cares about still existing indent.

:arrow: That's "all" to fix - after that it should work correctly 8)

Many thanks, EvilBMP
Actually, this does affect things and having the 'remove trailing spaces' checked does indeed present a bug that needs to be fixed. Consider my situation:

Using 9.0.0.95 with Auto indent and Use Tab both set to 3, convert tab unchecked and remove trailing spaces and tabs checked. Consider the following indents (where every three dots represent one tab):

if (true) {
...if (true) {
......if (true) {
.........if (true) {
...// this is where my cursor went
.........}
......}
...}
}

(Yes, that code makes no sense but was just used to illustrate the point).
This was exactly what I was trying to originally say... The way I was able to get the behavior I wanted (which fixed this...) was to ...

Auto-indent: on
use TAB key for indenting: on
Convert tabs to spaces: on
Remove trailing spaces and tabs: off

Indent size: 4
Tab size: 4

This consistantly put the cursor where expected....
Anthony
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: Newly introduced: {} and cursor positioning

Post by EvilBMP »

Indeed - you're right ...

If "Remove trailing spaces and tabs" is disabled, everything works as expected. Very surprising :o

Nevertheless, the "Convert tabs to spaces" option makes no sense for enabling Tabs instead of Spaces in auto-indent mode!
blepore
Posts: 13
Joined: Fri Mar 07, 2008 4:53 pm

Re: Newly introduced: {} and cursor positioning

Post by blepore »

EvilBMP wrote:Indeed - you're right ...

If "Remove trailing spaces and tabs" is disabled, everything works as expected. Very surprising :o

Nevertheless, the "Convert tabs to spaces" option makes no sense for enabling Tabs instead of Spaces in auto-indent mode!
Which version are you using, and which version did you start with? I mean, did you purchase an older version and were upgraded to a new one? I just purchased it a few days ago and thus have a totally fresh copy of 9.0.0.95 and I do not have "Convert tabs to spaces" checked, and it does insert tabs like I want it to.

That or my right and left arrow keys are moving by 3 spaces and I just *think* it's a tab it is moving by.

That said, I do have a the preferences.ini (or whatever it's called) settings of an older copy of RapidPHP copied over into this new WeBuilder. Maybe that's got it solved for me.
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: Newly introduced: {} and cursor positioning

Post by EvilBMP »

I have latest v8 and v9 in parallel mode...
User avatar
EvilBMP
Posts: 120
Joined: Thu Jan 04, 2007 1:57 am
Location: Germany

Re: Newly introduced: {} and cursor positioning

Post by EvilBMP »

Just installed 9.0.0.96RC a few secs ago and everything seems to work correctly with the auto-indent now :D

But I figured out another small bug ... if "Remove trailing spaces and tabs" is enabled and you copy a still indented line, then the paste indent is filled with space chars and not with tabs.

Again a small screencast, if you would like to have a look at the problem in action... :arrow: click me

Greets, EvilBMP
mboto
Posts: 8
Joined: Mon May 19, 2008 2:12 am

Re: Newly introduced: {} and cursor positioning

Post by mboto »

I think thereĀ´s still problems with the tab indenting in certain situations:
Maybe i misunderstanding something...
For example try this:
Create a new HTML document.
Put the cursor between the body tags and start typing:
TAB <div>
After closing the div you should get this code:

Code: Select all

<body>
	<div></div>
</body>
The cursor will appear in the middle of the div tags. Press enter twice to get a blank line between the divs. Press the up cursor one time to position the cursor in the newly created blank line. Hit TAB to indent the next tag. You will see that the initial indent that already was there will be converted to spaces.

Curiosly if you completely remove that blank line to get something like this:

Code: Select all

<<body>
	<div>
	</div>
</body>
and with the cursor positioned after the opening div tag hit enter (to add a new line) and then TAB to indent the space it will use the tabs as expected!

Unless iĀ´m doing something wrong...
Gatis
Blumentals Software Developer
Posts: 545
Joined: Sun Mar 05, 2006 12:30 am
Location: Latvia

Re: Newly introduced: {} and cursor positioning

Post by Gatis »

mboto : I think thereĀ´s still problems with the tab indenting in certain situations:
Please tell me what options have you enabled?
In another post you said "although I have option Use TAB for indenting enabled".
This option is used only when you indent a block of code.
If you want to make sure Tabs are not converted to spaces, you must make sure "Convert tabs to spaces" is not checked.
For now, I was not able to reproduce the problem you described.
EvilBMP: But I figured out another small bug ...
Thank you for pointing this out. Well, it seems to be true. However, I am not sure we will be able to do something about it very soon. I shall take a look at it, but I believe the problem here is actually inside the component we are using.
Kind regards,
Gatis Avots
mboto
Posts: 8
Joined: Mon May 19, 2008 2:12 am

Re: Newly introduced: {} and cursor positioning

Post by mboto »

After some more testing i think i know where the problem(?) relies.
Basically what i want to do is use tabs for all my indentation in all situations for both XHTML and CSS.

After following the steps i enumerated in my previous post i end up with this:
Image
See the three spaces i get in the beginning of the img tag line? Why isnĀ´t a tab used instead?

My options are set up like this:
Image

IĀ´ve followed the steps i described with Use TAB key for indenting option turned on and off.
Both gave me the same result you see in the first image.


The problem relies (i think) in the order i input the code.See this part from my previous post:
The cursor will appear in the middle of the div tags. Press enter twice to get a blank line between the divs. Press the up cursor one time to position the cursor in the newly created blank line. Hit TAB to indent the next tag. You will see that the initial indent that already was there will be converted to spaces.
When you press Enter for the second time, it creates a new blank line with an ENTER HIDDEN CHARACTER and the cursor will be positioned in the begining of the closing div tag.Then i press the up cursor key to bring the cursor back to the newly created blank line and press TAB to indent the next Tag. ThatĀ´s here in this situation that the ENTER HIDDEN CHARACTER is "converted" to three spaces.

Resuming, it converts the "ENTER HIDDEN CHARACTER" to spaces instead of tabs.
Hope this makes sense!
Post Reply