|
From: SourceForge.net <no...@so...> - 2006-07-18 11:53:02
|
Bugs item #1382388, was opened at 2005-12-16 13:19 Message generated for change (Comment added) made by kpouer You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1382388&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: text area and syntax packages Group: None Status: Open Resolution: None Priority: 5 Submitted By: Denis Koryavov (dkoryavov) Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect Python code indentation Initial Comment: Hello. I have found a little bug: processing the "Indent Lines" command (CTRL + I) to the Python code causes the wrong identation of selected text. Example: Before: if (row +1) > self.grid.GetNumberRows(): self.table.data.append(obj) self.grid.AppendRows(1, True) else: self.grid.SetCellValue(row, 0, fileName) self.table.data.append(obj) self.grid.AutoSizeColumn(0, True) after: if (row +1) > self.grid.GetNumberRows(): self.table.data.append(obj) self.grid.AppendRows(1, True) else: self.grid.SetCellValue(row, 0, fileName) self.table.data.append(obj) self.grid.AutoSizeColumn(0, True) ---------------------------------------------------------------------- >Comment By: Matthieu Casanova (kpouer) Date: 2006-07-18 13:52 Message: Logged In: YES user_id=285591 maybe we could add some unindentthisline and unindentnextlines properties for lines with else: except: finally: and probably others. This will not be perfect of course but this is what is wanted in most case when you write such statement I think so it would be better than nothing ---------------------------------------------------------------------- Comment By: Nicholas O'Leary (olearyni) Date: 2006-07-18 12:43 Message: Logged In: YES user_id=631957 The problem with python is that it uses indentation to express blocks of code - not just to make the code look pretty. This makes it very difficult to automatically indent a file. For example, how do you distinguish between the following examples (using @ to preserve spaces): if (foo): @@@ echo "foo" if (bar): @@@ echo "bar" and if (foo): @@@ echo "foo" @@@ if (bar): @@@ @@@ echo "bar" and if you had an 'else' statement after these 'if's, which 'if' should auto-indent align it with?! Not sure if this is possible to resolve - will look into how other editors handle it. ---------------------------------------------------------------------- Comment By: Alan Ezust (ezust) Date: 2006-07-16 04:08 Message: Logged In: YES user_id=935841 I don't know why slava was assigned this bug, but there are some indenting issues and I don't think slava is going to fix them, so I changed it to "unassigned". ---------------------------------------------------------------------- Comment By: Brad Mace (bemace) Date: 2006-03-21 19:44 Message: Logged In: YES user_id=370261 Ok, now I see what you mean. Indentation is controlled by the Edit Mode file. I verified that this does happen with the default mode included with jEdit. I don't know enough about python coding conventions to tweak the mode file. Someone else will have to do that, or you could try fixing it yourself and submitting an updated mode file. ---------------------------------------------------------------------- Comment By: Brad Mace (bemace) Date: 2006-03-15 21:56 Message: Logged In: YES user_id=370261 Indentation wasn't preserved. If you attach a file we can see what you mean. ---------------------------------------------------------------------- Comment By: Denis Koryavov (dkoryavov) Date: 2005-12-16 13:23 Message: Logged In: YES user_id=1382365 jEdit version: 4.3 Pre2 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100588&aid=1382388&group_id=588 |