question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incomplete IndentGuides display

See original GitHub issue

monaco-editor version: 0.19.0 Browser: Google OS: win10 Playground code that reproduces the issue:

I’m fine on the playground, but not in my vue project. Only the first column has IndentGuides.

image

There is really only one node in html. image

import * as monaco from 'monaco-editor';

const arr = [
  {
    "value": "",
    "url": ""
  }
]

export default {
 mounted() {
    this.$nextTick(() => {
      this.editor = monaco.editor.create(this.$el, {
         value: JSON.stringify(arr, null, 2),
	 language: "json",
         theme: 'vs-dark',
      });
    });
  },
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pengxiaotiancommented, Jan 6, 2020

thank you very much.

0reactions
alexdimacommented, Jan 6, 2020

That has to do with indentation settings.

When creating the editor with the value [], the string [] has no indentation, so the editor cannot guess what your indentation is. It falls back to the default settings, tabSize: 4, insertSpaces: true. So an indent guide is rendered every 4 spaces.

You can define this explicitly via tabSize: 2, e.g.:

const arr = [
    {
        "value": "",
        "url": ""
    }
]

let editor = monaco.editor.create(document.getElementById("container"), {
    tabSize: 2,
    value: "[]",
    language: "json",
    theme: 'vs-dark',
});

editor.setValue(JSON.stringify(arr, null, 2));
Read more comments on GitHub >

github_iconTop Results From Across the Web

You Might Not Need a Vim Plugin to Visualize Line Indents
We'll cover a few Vim motions and mappings to jump between or manipulate text within tags.Hit the subscribe button to receive more videos ......
Read more >
How to show indentation guides in TextMate
There is a menu item somewhere, or a preference settings called "show invisible characters". That's what is used in TextMate to show ......
Read more >
Indent Guides - Visual Studio Marketplace
Displays indent and page width guides in Visual Studio text editor windows. Guides can be displayed at the indent specified in your settings, ......
Read more >
Display only incomplete tasks - Microsoft Project Quick Tips ...
Display only incomplete tasks. “ - [Instructor] Filtering your task list to see what is and isn't done is easy. When you need ......
Read more >
Add subtasks to reminders on Mac
Indent reminders to turn them into subtasks of the reminder right above them. A reminders list showing the reminders organized into subtasks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found