Repository navigation
Conversation
The bundled Objective-C syntax file declares `filetype: objective-c`, but the comment plugin keyed its comment type as `objc`. The lookup in updateCommentType() never matched, so .m/.mm buffers fell back to the default "# %s" and toggling a comment prefixed the line with `#`, which Objective-C treats as a preprocessor directive. Co-Authored-By: Claude <noreply@anthropic.com>
Andriamanitra
approved these changes
Oct 19, 2026
Andriamanitra
left a comment
Collaborator
There was a problem hiding this comment.
Good catch, objc must have slipped in accidentally even though the filetype is called objective-c.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The comment plugin keys Objective-C as
ft["objc"], but the bundledruntime/syntax/objc.yamldeclaresfiletype: objective-c, and that is the value a buffer gets (b.Settings["filetype"] = b.SyntaxDef.FileTypeininternal/buffer/buffer.go). The lookup inupdateCommentType()therefore never matches, and.m/.mmbuffers fall back to the default# %s.To reproduce: open a
.mfile, put the cursor onint x = 1;and pressAlt-/. The line becomes# int x = 1;instead of// int x = 1;. A leading#is a preprocessor directive in Objective-C, so the file no longer compiles.This renames the key to
objective-cincomment.luaand in the plugin's help list, matching the other entries, which use the syntax files' filetype names (c,c++,csharp, ...).Checked by loading the real
comment.luainto gopher-lua with a stubimportand callingupdateCommentType()on a stub buffer:filetypeobjective-c# %s// %sc// %s// %sunknown# %s# %sft["python3"]andft["conf"]don't match any bundled filetype either (Python ispython), but they would fall back to# %s, which is the same value, so I left them alone.Prepared with AI assistance (Claude Code). I did not build or run micro itself; the only local check was running the plugin function in gopher-lua as shown above, before and after the change.
🤖 Generated with Claude Code