pioul / Minimalist-Online-Markdown-Editor

This is the simplest and slickest online Markdown editor.
http://markdown.pioul.fr
MIT License
265 stars 45 forks source link

Tabbing selected text cannot be undone #9

Closed janharms closed 9 years ago

janharms commented 9 years ago

When selecting a lot of text (e.g. code) which should be indented pressing the tab-key inserts a tab and removes all selected text. This operation cannot be undone. Since four empty spaces are the defacto standard to create a code block they should be inserted when a selection larger than one line.

(I am on windows 7 with chrome 38.0.2125.104 m)

(Thank you for your work on this product.)

philippe-git commented 9 years ago

Hey,

I've just published a new version of the editor that implements this feature :-)

Now, when multiple lines are selected and TAB is pressed, they'll be indented. Press SHIFT + TAB, and they'll be unindented. Indentation still uses tabs, though. I'll consider adding a switch "indent with spaces/tabs" if that's something you really care about.

Regarding undoing operations, although the text won't be replaced with a tab anymore (which was extremely annoying considering you couldn't undo it, agreed), the indenting operation remains non-undoable. This is due to the way Chrome handles such operations: Firefox behaves differently, and if you open up the web app there, you'll have a working undo mechanism.

The MME Chrome app does, however, implement a custom undo mechanism, which will eventually make its way into the web app.

Cheers!