# Editor text-indent and padding-inline-start calculating improperly

**URL:** <https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281>\
**Category:** Bug reports\
**Tags:** wontfix, repro\
**Created:** [March 31, 2023, 5:09pm UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281 "2023-03-31T17:09:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sailKite](https://forum.obsidian.md/user_avatar/forum.obsidian.md/sailkite/32/30369_2.png) [@sailKite](https://forum.obsidian.md/u/sailKite)\
**Post date:** [March 31, 2023, 5:09pm UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281/1 "2023-03-31T17:09:42Z")

</div>

### Steps to reproduce

1. Create a note with a tight list in it. (An example will be provided as an attachment.)
2. Either: Close and re-open the note, or navigate back/forward to and from some other note (forcing the note to re-render in the editor is the goal here).
3. The note will now have a certain set of inline styles on its HTML for `text-indent` and `padding-inline-start`. Input some kind of state change in the app, pretty much anything will work.
4. The note will recalculate the two properties to use different values than it initialized with. The second values should persist through most state changes, though things which re-render entire views may cause the issue cycle as well (an example shown to me by another user is the `Maximize pane` command from the [Pane Relief](https://github.com/pjeby/pane-relief) plugin.)

### Expected result

There should be no reflow of content or change in these properties, as they should hopefully be calculated correctly the first time by whatever internal TypeScript handles them.

### Actual result

Content reflows, and the values passed to the style attribute in the element HTML is changed.

### Environment

```auto
SYSTEM INFO:
	Obsidian version: v1.1.16
	Installer version: v1.1.9
	Operating system: Windows 10 Home 10.0.19043
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 0

RECOMMENDATIONS:
	none

```

* * *

### Additional information

Attachments:

1. A `.gif` demonstrating the reflow issue.
  - ![lorem list 1](https://forum.obsidian.md/uploads/default/original/3X/7/3/734ee145a982097e8587919d37c38b19b1255288.gif)

2. A `.md` file used in the demonstration.
  - [lorem list.md](https://forum.obsidian.md/uploads/short-url/cFQozG0Trdg6bgl8wO0fXOciBhX.md) (1.3 KB)

3. A `.png` showing the inline style values on view initialization.
  - ![indent before](https://forum.obsidian.md/uploads/default/original/3X/9/e/9e307b104c4e97f95523a2e060c19c9611446618.png)

4. A `.png` showing the inline style values after any sufficient update event.
  - ![indent after](https://forum.obsidian.md/uploads/default/original/3X/3/0/306be9bd79e6581ef7c82d499b2eb96b887f1e59.png)

---

<div class="post-metadata">

**Author:** ![VanderG](https://forum.obsidian.md/user_avatar/forum.obsidian.md/vanderg/32/45467_2.png) [@VanderG](https://forum.obsidian.md/u/VanderG)\
**Post date:** [March 31, 2023, 5:15pm UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281/2 "2023-03-31T17:15:39Z")

</div>

Let me add that this happens on macOS, too.

---

<div class="post-metadata">

**Author:** ![bar](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/b/b77776/32.png) [@bar](https://forum.obsidian.md/u/bar)\
**Post date:** [July 1, 2023, 10:46am UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281/3 "2023-07-01T10:46:23Z")

</div>

Same here on macOS, too.

The most disappointing thing for me is that I cannot even align with spaces in the math/latex block of the source mode, see

![this example](https://forum.obsidian.md/uploads/default/original/3X/6/c/6ce40c318a5420309c07a0cfab6f591dff300e02.png).

A workaround is to add

```css
.cm-line{
    text-indent: 0 !important;
    padding-inline-start: 0 !important;
}

```

into CSS Snippets, but I do not know if there are any side-effects as I am not familiar with Obsidian’s source code.

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [July 6, 2023, 4:31pm UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281/4 "2023-07-06T16:31:49Z")

</div>

This is a very complex problem. We have done some work in the past to have these jumps be less pronounced. I don’t think that this will be dealt with anytime soon.

Related: [https://forum.obsidian.md/t/live-preview-checklist-indentation-is-offset-when-i-navigate-to-another-note-and-back/29938](https://forum.obsidian.md/t/live-preview-checklist-indentation-is-offset-when-i-navigate-to-another-note-and-back/29938)

---

<div class="post-metadata">

**Author:** ![ArloZ](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@ArloZ](https://forum.obsidian.md/u/ArloZ)\
**Post date:** [July 10, 2023, 8:42pm UTC](https://forum.obsidian.md/t/editor-text-indent-and-padding-inline-start-calculating-improperly/57281/5 "2023-07-10T20:42:47Z")

</div>

Sounds good, thank you so much for following up!
