When I type in ~ on my laptop (FN + ALT + 126) the cursor jumps and misplaces the tilde

5 views (last 30 days)
So far I checked 3 different laptops and I observe a rather annoyng behaviour on the last MATLAB release (also on R2010b?).
R2011a WIN32 Vista
A = rand(10,1);
idx = A > .5;
A(~idx)
When I position the cursor on the last idx to type the ~, after I press the FN + ALT + 126 the cursor automatically jumps to the first idx, then when I release the combination of keywords it places the tilde!
I tried to play with the shortcuts to find the conflict but didn't come up with a solution.
Is this a bug? [No]
EDIT
On QWERTY keyboards with no ~ (see italian keyboards), otherwise I would just use that.
EDIT Addressing Walter questions:
  • No matching idx to jump to: then it jumps before the |(|
  • idx further away: irrelevant
  • idxification: here comes the fun. Apparently it's the same as if the first bullet point BUT it interacts with A. If there's a preceding line starting with A but the first one, it jumps right before it. If the A appears only in the creation of the index, then again we are in the first bullet case BUT if no A appears in that line, then it DOESN'T jump.
  • idx.blentish: same behavior as previous bullet
  • Emacs was already turned off.
Other fun:
  • if I add operators as *+/- it jumps right before the last inline operator (no preference which one is the last)
  • Adding parenthesis make it jumps before the left outmost
  2 Comments
Walter Roberson
Walter Roberson on 12 Aug 2011
For clarification: FN+ALT+126 is the way on MS Windows to enter the character whose decimal sequence number is 126, which corresponds to ~ . Note all country-specific QWERTY keyboards have the ~ character.
Oleg, what happens if there is no matching "idx" to jump to? What happens if the "idx" is further away? What happens if the previous "idx" is part of a longer substring, such as "idxificiation" ? Or "tridx" ? What happens if there is a longer string such as idx.blentish -- does it try to match everything up to the ')' or everything up to certain tokens such as comma ? What happens if you turn off emacs-style searching in the preferences (if that can be done) ?

Sign in to comment.

Accepted Answer

Oleg Komarov
Oleg Komarov on 29 Aug 2011
If you have:
  • Windows OS
  • MATLAB 2010b or earlier
  • Laptops that do not have a ~ (tilde) on the keyboard (see Italian QWERTY).
The technical support suggested two solutions to insert the tilde:
  1. In File > Preferences > Keyboard > Shortcuts assign different combinations to "Go To Next Underline or Higlight" and "Go To Previous Underline or Higlight". I used respectively ALT+PAGE DOWN and ALT+PAGE UP.
  2. Enable the numerical pad before using ALT+126. In my case: FN+BLOC NUM > ALT+126 > FN+BLOC NUM.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!