set filetype sets the filetype for all opened tabs and not the current focused
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)
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.
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.
Okay. Thank you for the quick reply. Is it fixed in a released version?
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.
I was looking at old issues but 2.0.14 has been released now, so I think this can be closed.