Skip to content

Filetypes duplicates when you set filetype #3186

@dustdfg

Description

@dustdfg

Description of the problem or steps to reproduce

TL;DR it is not a problem of the filetype but almost about reloading and solvable by #3062

When I use set filetype <filetype> the auto-completion duplicate names

  1. Open micro
  2. Write set filetype
  3. Press tab
  4. Press enter
  5. Write again set filetype
  6. Press tab again

screen-1710697530

Roots of the problem

Firstly I thought problem in https://github.com/zyedidia/micro/blob/5ae2799b7044f625012dbde916091f81a01b383a/internal/action/infocomplete.go#L62-L96
But then I realized that code for color schemes auto-completion is the same as for filetype auto-completion.
https://github.com/zyedidia/micro/blob/5ae2799b7044f625012dbde916091f81a01b383a/internal/action/infocomplete.go#L190-L194
They even used both in the same way so the problem not in the action/infocomplete.go

The problem is somewhere inside the buffer.SetOption function which tries to make reload

https://github.com/zyedidia/micro/blob/5ae2799b7044f625012dbde916091f81a01b383a/internal/buffer/settings.go#L22-L33

Specifications

Version: 2.0.14-dev.77
Commit hash: 5ae2799
OS: debian 12/testing
Terminal: foot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions