MATLAB: Does the mouse cursor jump to a different line in the code when I type the tilde sign (“~”) with the laptop keyboard in MATLAB 7.12 (R2011a)

MATLAB

When I am typing a simple code with several instances of the same variable in the MATLAB Editor, every time I type the tilde sign using the FN+ALT+126 key combination, the mouse cursor jumps to another line in the code and places the tilde sign there instead of where I intended it to show up.
Some keyboards (f.ex. italian keyboards) do not have a key for the tilde sign, so I am using the FN+ALT+"ASCII number" combinations.

Best Answer

When using the FN + ALT + 126 combination this interferes with a built-in shortcut in MATLAB 7.11 (R2010b) or newer versions. The "Go To Next Underline or Higlight" and "Go To Previous Underline or Higlight" are configured with the keyboard shortcuts ALT+DOWN and ALT+UP. These interfere with the FN+ALT+126 key combination since when the numerical pad is not enabled the 2 is interpreted as the DOWN key.
To workaround this issue you can either change the shortcuts for "Go To Next Underline or Higlight" and "Go To Previous Underline or Higlight" under File > Preferences > Keyboard > Shortcuts to something different than ALT+DOWN and ALT+UP or you need to enable the numerical pad before using ALT+126 to place the tilde sign at the right position.