New line starts with a comment after pressing enter

Hi Doom Emacs Community!

Suppose I have the following code:

import pandas as pd

data = {"calories": [420, 380, 390], "duration": [50, 40, 45]}
df = pd.DataFrame(data)

If I put my cursor (in insert mode) infront of df, hit SHIFT End, then comment out the highlighted line with M-;, I’m left with the line totally commented and the cursor at the end of the line.

If I then hit ENTER, the new line that appears underneath begins with a comment character. How would I go about disabling this so that the new line does not contain a comment character and stays in insert mode?

System information


Loading data dump...

It looks like this behavior can be disabled by adding

(setq-hook! 'python-mode-hook comment-line-break-function nil)

to your doom/config.el file and then running doom/reload. See for example: https://github.com/doomemacs/doomemacs/issues/2081

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.