jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

pymode.sl patch


Hi John and all other core jed hackers,
I've had a look at the pymode.sl file to add the new keywords that's
been added to python 2.3.
See attachment.

There's also an annoying bug in the python mode to do with py_endblock_cmd()
If you a line like this:
   return "foo"

When you hit enter to go to the next line it cleverly dedents back one
step since 'return' will always close the block. However, if you hit
enter at the end of this line:
   returning("foo")
it closes the blog too because of the presence of the word "return" in
"returning".

In lib/pymode.sl at around line 87 you'll find::

private define py_endblock_cmd()
{
  bol_skip_white();
  if (looking_at("return") or
      looking_at("raise")  or
      looking_at("break")  or
      looking_at("pass")  or
      looking_at("continue"))
    return 1;
  return 0;
}

I don't know how that works but it appears that looking_at("return")
returns true on "returning" too. Perhaps it should be blooking_at(). I
don't know.

I hope you can use my little changes.


--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com

Attachment: pymode.sl.patch
Description: Binary data


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]