cursor jumps when entering chunk

Asked by Ranko Radonić

when i place the cursor at the beginning of a ruby chunk in a .html.erb file, the cursor "jumps" two characters to the right. i'd like to get rid of this behaviour.
a similar thing happens when i place the cursor at the end of a ruby chunk, i.e. when i enter it from the right side. in this case the cursor jumps two characters to the left.

is there a variable i can set to prevent this?

thanks

Question information

Language:
English Edit question
Status:
Solved
For:
nXhtml Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
lborgman (lennart-borgman) said :
#1

Hi rradonic, thanks for telling about this. It sounds like a bug somewhere. I have converted your question to a bug report. Can you please follow the link to the bug report and give more details?

I think I need an example so I can reproduce it. Which version of nXhtml are you using?

Revision history for this message
Ranko Radonić (ranko-radonic) said :
#2

i'm using nxhtml 2.05. i downloaded the .zip from http://ourcomments.org/Emacs/DL/elisp/nxhtml/zip/nxhtml-2.05-091202.zip. i'm using ubuntu and emacs 23.1.1, the version in the ubuntu repos.

to reproduce:
1) open an .html.erb file containing some html and some ruby.
2) start with the cursor inside some html.
3) move the cursor to the right, until you get to the beginning of a ruby chunk. the ruby chunks start with <% or <%= and end with %>, so place the cursor on the < character.

expected behaviour:
the mode switches from nXhtml/eruby-nxhtml to Ruby/eruby-nxhtml, the cursor stays on the < character.

actual behaviour:
the mode switches from nXhtml/eruby-nxhtml to Ruby/eruby-nxhtml, the cursor jumps two characters to the right, positioning it after the % character.

something similar happens when i approach a ruby chunk from the right. i move the cursor to the left until it's on the > character at the end of a ruby chunk. the cursor will then jump two characters to the left, positioning it before the % character.

Revision history for this message
lborgman (lennart-borgman) said :
#3

Thanks. Unfortunately I can't reproduce it here. Can you grab the latest version beta version from Launchpad and try that? Or should I upload it as a zip file?

Could you perhaps also show me a file where you get this problem? (It is easier to do that if you switch over to the bug report since you can attach a file there.)

Revision history for this message
lborgman (lennart-borgman) said :
#4

I think this is solved, see the linked bug.