texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Keyboard bug + solution


From: Gubinelli Massimiliano
Subject: Re: [Texmacs-dev] Keyboard bug + solution
Date: Fri, 5 Nov 2010 23:47:35 +0100

I was just looking after the same problem.
Thanks for the fix. I've just submitted it.

Massimiliano

ps: if your editor reformat the sources then patches are unusable. you have to disable reformatting when working on texmacs code.


On 5 nov. 2010, at 23:22, Miguel de Benito Delgado wrote:

HI all,

  I've been experiencing a bug with the svn version of the code for some time. Pressing the "apostrophe" key ( ), the one needed to produce letters like , caused the program to crash apparently after a random number of times. The console showed pairs of

-[NSCFString characterAtIndex:]: Range or index out of bounds


and a, to my eyes, utterly undecipherable stack trace. It took me an embarrassing amount of time to think of searching for "characterAtIndex" and thus locate the problem in Plugins/MacOS/mac_utilities.mm, function mac_handler_body, around line 76. The new first few lines of it must check for empty strings:


NSEvent *mac_handler_body(NSEvent *event

{

  if (([event type] == NSKeyDown) || ([event type] == NSKeyUp)) {

    NSString *nss = [event charactersIgnoringModifiers];

    if ([nss length] > 0) {

      unichar key = [nss characterAtIndex:0];


and then a new closing brace must be added, of course. I have attached a diff for that file only, but my editor has messed up the indentation so it looks bigger than it is.

Best regards,
________________
Miguel de  Benito.
<diff-against-3522.zip>_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]