unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36884: Default python mode with electric-indent-mode sometimes indents empty lines
@ 2019-08-01  7:06 Jarosław Rzeszótko
  2019-08-01  7:56 ` Andreas Röhler
  0 siblings, 1 reply; 7+ messages in thread
From: Jarosław Rzeszótko @ 2019-08-01  7:06 UTC (permalink / raw)
  To: 36884

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

When pressing enter with the cursor like this:

def test():
    print("test")
[cursor]

Emacs (26.1) correctly just inserts a blank line. However, with this:

def test():
    if True:
          print("test")
[cursor]

Emacs inserts a blank line and indents it one level. With this:

def test():
    if True:
        if False:
              print("test")
[cursor]

it inserts a blank line and indents it two levels, etc. Moreover, with two
methods like this:

def test1():
    if True:
          print("test")

[cursor]def test2():
    if True:
          print("test")

pressing enter will also indent the def block, instead of just inserting
the empty line.

[-- Attachment #2: Type: text/html, Size: 1152 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-02 14:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-01  7:06 bug#36884: Default python mode with electric-indent-mode sometimes indents empty lines Jarosław Rzeszótko
2019-08-01  7:56 ` Andreas Röhler
2019-08-01  8:51   ` Jarosław Rzeszótko
2019-08-02  1:25   ` Noam Postavsky
2019-08-02  5:08     ` Jarosław Rzeszótko
2019-08-02 10:39       ` Andreas Röhler
2019-08-02 14:55         ` Jarosław Rzeszótko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).