Skip to content

Open new line after head moves point back to the beginning of head #5

@wyuenho

Description

@wyuenho

Reproduction:

  1. visit a new buffer called ~/test.rst
  2. type .. code-block:: python
  3. RET
  4. See point now jumped back to the beginning of the head, instead of at the beginning of the new line.

Expectation:

poly-rst-mode should allow me to open a new line after the head without moving my point. It should treat the newline as part of the head because reStructuredText requires 3 newlines and an indentation to the column of the beginning of the directive (i.e. before the c of code-block) to go into code block parsing state.

In essence, in a restructured text file:

Lorum Ipsum

.. code-block: python

   print("hello")
   print("world")

Lorum Ipsum

I expect the string .. code-block: python\n\n\n to be the head, and poly-rst-mode should under no circumstances be interfering with how the host mode indents when I'm still typing the head.

Why is polymode overriding the host mode's indent-line-function and indent-region-function anyway?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions