Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoindent problem inside GFM fenced code block #78

Closed
lqueryvg opened this issue Apr 27, 2014 · 3 comments
Closed

autoindent problem inside GFM fenced code block #78

lqueryvg opened this issue Apr 27, 2014 · 3 comments

Comments

@lqueryvg
Copy link

Hi, I don't know if you intend to support Git Flavoured Markdown or not. If so I've noticed a problem inside fenced code blocks.
For example, enter the following:

```
- item 1
- item 2

Then press o to add a line below the last line and it will try to autoindent.

@lqueryvg lqueryvg changed the title autoindent inside GFM ``` section autoindent problem inside GFM fenced code block Apr 27, 2014
@cirosantilli
Copy link
Collaborator

Vim Markdown does support fenced code blocks by default.

To make sure I understand. Setup:

```
- a<cursor>

Action: o

Expected:

```
- a
<cursor>

Observed:

```
- a
    <cursor>

(4 spaces).

If that is what you mean, then its a difficult decision what is the best behavior.

When writing markdown code in markdown code, observed is the desired behavior.

What do you usually want to put in the code block (which programming language?) that often starts in hyphens - and does not require an indent on o?

@lqueryvg
Copy link
Author

Hi, thanks for responding.
Yes that's the observed behaviour.

I understand that the autoindent might be desired when writing markdown code.
But after the "fence" has started...

```

this is no longer markdown code. It's raw text which should be unformatted.

The text I'm writing is just a bunch of text notes - not a programming language. It could, for example be unix command output which I've annotated in some way.

I can understand if it's difficult for the plugin to detect if the user is in a fenced section or not - you'd have to match up pairs of fences. But if it can detect this then I would say it shouldn't interfere with the auto-indentation in a fenced section - it should not make any assumptions about the format of the raw text which is about to be entered.

Having said all of that, I've just been giving my vim config an over-hall and that behaviour seems to have gone away. Perhaps my Vundle has picked up a later version in which this behaviour has changed ?

@cirosantilli
Copy link
Collaborator

Weird, I still reproduce on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants