micro icon indicating copy to clipboard operation
micro copied to clipboard

set filetype sets the filetype for all opened tabs and not the current focused

Open theredcmdcraft opened this issue 1 year ago • 4 comments

Description of the problem or steps to reproduce

If you have multiple files opened in multiple tabs and press Ctrl+e for the Micro internal shell and set the filetype with set filetype txt to txt, for example, this will change the filetype for all open tabs and not for the current focused tab. I would expect that if i set the filetype it only will happen for the current focused tab.

If you need more informations about my system or something else, feel free to ask me.

Specifications

Commit hash: Version: 2.0.11 OS: Debian 12.5

user@host ~ # cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Terminal: xterm-256color (hopefully correct)

theredcmdcraft avatar Jul 17 '24 21:07 theredcmdcraft

There is a separate setlocal command that you can use instead of set when you only want to change a setting in the current buffer.

Andriamanitra avatar Jul 17 '24 21:07 Andriamanitra

Actually the filetype option is a special case, it is local-only, so even set filetype should set the filetype for the current buffer only. It was fixed in #3042.

dmaluka avatar Jul 17 '24 22:07 dmaluka

Okay. Thank you for the quick reply. Is it fixed in a released version?

theredcmdcraft avatar Jul 18 '24 05:07 theredcmdcraft

No, the latest release 2.0.13 was in Oct 2023, while #3042 was merge in Mar 2024. Maybe we will make a new release soon. In the meantime you can either use a nightly build from https://github.com/zyedidia/micro/releases/tag/nightly, or compile micro yourself, or just use setlocal filetype.

dmaluka avatar Jul 18 '24 20:07 dmaluka

I was looking at old issues but 2.0.14 has been released now, so I think this can be closed.

niten94 avatar Jan 25 '25 04:01 niten94