Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Inserts extra words "auto" and formats incorrectly #91

Open
Algashev opened this issue Jun 5, 2020 · 5 comments · May be fixed by #92
Open

Inserts extra words "auto" and formats incorrectly #91

Algashev opened this issue Jun 5, 2020 · 5 comments · May be fixed by #92

Comments

@Algashev
Copy link

Algashev commented Jun 5, 2020

Example of creating TOC

autoauto- [LimeAPIClient](#limeapiclient)auto - [Содержание](#содержание)auto - [Установка](#установка)auto - [Кэширование запросов](#кэширование-запросов)auto - [Интервал времени ожидания запроса](#интервал-времени-ожидания-запроса)auto - [Примеры использования](#примеры-использования)auto - [Конфигурирование клиента](#конфигурирование-клиента)auto - [Пример cоздания новой сессии](#пример-cоздания-новой-сессии)auto - [Получение баннера, рекомендованного данному устройству и приложению](#получение-баннера-рекомендованного-данному-устройству-и-приложению)auto - [Снятие (удаление) пометки «нежелательный» с баннера](#снятие-удаление-пометки-«нежелательный»-с-баннера)auto - [Пометить баннер как «нежелательный» и больше его не показывать](#пометить-баннер-как-«нежелательный»-и-больше-его-не-показывать)auto - [Получить баннер (информацию о нём)](#получить-баннер-информацию-о-нём)auto - [Получение списка каналов](#получение-списка-каналов)auto - [Получение списка каналов по группе id](#получение-списка-каналов-по-группе-id)auto - [Получение программы передач](#получение-программы-передач)auto - [Проверка работоспособности сервиса](#проверка-работоспособности-сервиса)autoauto

Additional Info

plugin version 1.5.6
Visual Code version 1.45.1
MacOS version 10.15.5 (19F101)

@Cadenus
Copy link

Cadenus commented Jun 15, 2020

You can workaround that.
When you open "Preferences / Settings" in Visual Studio Code and search foe "EOL", you will find an entry in "Text Editor"-->"Files".
This is set to "Auto" by default (at least on Mac) and will be just copied by the extension when you create a TOC.
Just set this to "\r" or "\r\n" and you are good to go.

@mcornella
Copy link

I've just started looking at the VSCode API so forgive me if I'm wrong, but it looks like we can access the currently open file's EOL if we have access to window.activeTextEditor (which we do): we can access the .document property which is of type TextDocument, which has a eol property.

We can also obtain the tabSize / insertSpaces values via the .options property of the same window.activeTextEditor, which has both a tabSize and an insertSpaces properties.

@alanwalk is this a fair assessment?

@mcornella mcornella linked a pull request Sep 23, 2020 that will close this issue
@tomryanx
Copy link

tomryanx commented Nov 3, 2020

Looks like it's using the string auto from files.eol literally!

@simonwiles
Copy link

There are multiple PRs open that address this issue (#72, #80, #92...).

@GarfieldZHU
Copy link

Any plan to merge a fix for it? 🙇

I have enabled "Setting Syncs" for VSCode among my Windows/Linux/macOS environments. Using "auto" should be the best EOL configuration for me, and it's kind of inconvenient to switch it to "\n" to create TOC and then switch back.

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

Successfully merging a pull request may close this issue.

6 participants