899 Commits
Author SHA1 Message Date
Dmytro Maluka 290d8071be plugins: Don't parse repo.json for built-in plugins
Built-in plugins don't have repo.json and never will, there is no point
in checking if they have one, this only results in code duplication and
dead code.
2026-09-29 00:07:34 +02:00
Dmytro Maluka 227ebdfab6 plugins: Parse repo.json only, not every json file
According to the documentation, micro reads plugin info from the
`repo.json` file in the plugin's directory. In reality, micro reads
plugin info from each and every `*.json` file in the plugin's directory,
not only from `repo.json` (so if there are multiple json files, each
next one overrides info read from the previous one). Fix this absurdity.
2026-09-28 23:52:25 +02:00
Artem Lytkin 50a6fe59d3 config: Don't panic on plugin JSON files without a plugin entry (#4247)
A .json file in a plugin directory that decodes to an empty list (`[]`
or `null`) made NewPluginInfo index info[0] on an empty slice. The panic
happens in InitPlugins(), before the recover() in main(), and the
deferred exit(0) ends micro silently with status 0 on every start.

A file whose first entry has no Name did not crash, but it replaced the
plugin name with an empty string, so the plugin was dropped as "not a
plugin".

Return the existing ErrMissingName in both cases. InitPlugins() already
skips files that fail to parse, so the plugin keeps its directory name.
2026-09-28 23:40:52 +02:00
Mikko 6f2601f20e add default keybindings CtrlShiftHome and CtrlShiftEnd (#4214) 2026-09-10 23:25:04 +02:00
Neko Box Coder 393cf24858 Fixing commandbar/plugin autocomplete regression from #4028 (#4200)
PR #4028 moved the check for autocomplete from action autocomplete to
the buffer one, which caused a few regression for upstream callers
(commandbar autocomplete & plugins that use buffer autocomplete)
that use the buffer autocomplete.

This commit restores pre #4028 behavior by adding a callback variant
for buffer autocomplete functions while keeping the multi-cursor
autocomplete function.
2026-09-01 00:32:35 +02:00
usfbih8uandusfbih8u 1e666bd44e docs(internal/buffer): remove the reference to the old ToCharPos function (#4182)
The function was removed in commit `dc68183fc114ab2911d6ba934cf5df019566d0cf`.

Co-authored-by: usfbih8u <>
2026-08-27 18:03:27 +02:00
redstiandredsti 4c47a2713a Autocomplete support for multiple cursors (#4028)
Co-authored-by: redsti <[email protected]>
2026-08-24 18:45:24 +02:00
usfbih8u 1c8b82b32e fix(buffer/eventhandler): MultipleReplace() comment (#4169) 2026-08-09 13:50:30 +02:00
Puneet Dixit 0e0f16cbe1 Merge pull request #4116 from puneetdixit200/fix-plugin-info-json5
fix: parse plugin repo metadata as JSON5
2026-08-07 18:52:06 +02:00
Jöran Karl 5bff230b34 test: Fix colorscheme_test to compare against the tcell attributes type
Otherwise assert.NotEqual() still passes since the attributes type is not int.
2026-08-02 19:31:20 +02:00
Jöran Karl 355d965b6b colors: Add blink, dim and strikethrough to the colorscheme attributes 2026-07-17 09:27:21 +02:00
Neko Box Coder 4c2704021c Fixing resize split can cause crashes when node is root (#4139)
Fixing resize split can cause crashes when node is root.

"Regression" of #3983 where ResizeSplit() assumed that the root node
always has a single child which aligns to the previous behavior
2026-07-13 18:33:51 +02:00
Neko Box Coder 25a1b0a2a8 Using file complete for the save command (#4140)
Using file complete for the save command. This is useful when trying to
save as a different file or simply auto complete the directories you
want to save to
2026-07-12 21:59:48 +02:00
Jöran Karl ee8f6de484 buffer: Remove buffer invalidation in CloseOpenBuffers() (#4133)
This resolves issue #4131, and a local copy is used to prevent the issue
resolved by #2898 from recurring.
2026-07-09 18:48:34 +02:00
Art Chaidarun e4a92a19d9 Add tabalways option to always show tab bar (#4120) 2026-06-25 19:01:18 +02:00
Dmytro Voytko 147f2c112a Empty return consistency (nil) 2026-05-31 11:37:38 +00:00
Dmytro Voytko 1c6b849a65 Make missing plugin repo errors more informative 2026-05-30 21:36:10 +00:00
Jöran Karl 253065a4af Merge pull request #3997 from JoeKar/fix/symlinks
buffer: Store potential resolved symlinks as `AbsPath`
2026-05-04 19:07:24 +02:00
Jöran Karl 2cb49c4653 buffer: Resolve symlinks in file paths
Otherwise we can't identify if we have the same file open multiple times via
different symlinks.
The test must be adapted to resolve symlinks in `findBuffer()`.
2026-04-28 19:20:51 +02:00
Jöran Karl e323cde09c buffer: Don't Serialize in case the buffer is shared
Otherwise we unnecessarily serialize the shared buffer every time when closing
a bufpane with this buffer, so every such serialize overwrites the previous one,
thus only the last serialize (when closing the last instance of the buffer, i.e.
when actually closing the file, i.e. when the buffer is not shared anymore) will
be used anyway.
2026-04-08 16:17:38 +02:00
Jöran Karl ef57bdcf9b buffer: Don't cancel the backup in case the buffer is shared
Otherwise it will be removed async, which shouldn't happen in case there is
still one buffer open with the same modified file.
2026-04-08 16:17:38 +02:00
Nilton Perim Neto 8f14c3c315 buffer: check sudo binary exists before creating backup
Verify the sudo command is available via exec.LookPath() before
creating the backup in safeWrite(). This avoids bogus backup files
when the sudo binary is not found.

Signed-off-by: Nilton Perim Neto <[email protected]>
2026-04-02 13:59:00 -03:00
Nilton Perim Neto d9ad8310b2 buffer: fix sudo TTY race on privileged file save
When saving a protected file, micro spawned two sudo dd subprocesses
concurrently: a truncation dd and a write dd. Both competed for the
TTY to prompt for the sudo password, racing on TCGETS2/TCSETS2 ioctls
and deadlocking stdin routing. This strictly fails with sudo-rs, which
enforces auditable escalation boundaries.

Fix by removing notrunc and the separate truncation subprocess entirely.
A single dd subprocess now handles truncation and write in one shot,
making the race impossible by construction. The conv=fsync guarantee is
preserved on platforms that support it.

Move writeBackup() before openFile() in safeWrite() for the sudo path
so the backup always exists before dd truncates the file. If openFile()
fails after the backup is created, return OverwriteError so the user
knows their data is safe in the backup. The non-sudo path is unchanged.

Link: https://github.com/micro-editor/micro/issues/4050
Signed-off-by: Nilton Perim Neto <[email protected]>
2026-04-02 13:59:00 -03:00
Nick 1c88f24ad7 Suspend the whole process group along with micro. (#4060)
Fixes https://github.com/micro-editor/micro/issues/4059
2026-04-02 00:34:46 +02:00
bibaka 4ddf4fe2b1 Rewrite Loc.MoveLA(n): do not call util.Abs(n) in cycle, cleaner code 2026-03-28 02:12:08 +03:00
bibaka 1be75cc697 Fix documentation for Loc.LessThan() and other similar functions 2026-03-28 02:09:00 +03:00
Jöran Karl 4f32b47075 settings: Add glob: as prefix for file globbing maps
This gives the advantage to differentiate internal options from user defined
file globs with the same name.
2026-03-19 19:35:24 +01:00
Jöran KarlandDmytro Maluka bcd6c81f50 settings: Don't return maps with ParsedSettings()
Map-typed values in the parsedSettings map do not represent settings for
individual options, they represent maps of settings for multiple options for
the given glob or ft: pattern, and their keys are not option names, they are
glob and ft: patterns. So do not expose them to the callers of ParsedSettings(),
to prevent the callers from mistakenly treating those patterns as option names,
with unpredicted consequences.

Co-authored-by: Dmytro Maluka <[email protected]>
2026-03-18 19:46:36 +01:00
usfbih8uandusfbih8u d38f0dfe7a Fix documentation typo (#4006)
Co-authored-by: usfbih8u <>
2026-02-12 20:19:21 +01:00
Dmytro Maluka 4aa706cbc5 serialize: Don't save undo stack if saveundo=off (#4003)
Micro always saves the undo stack information into the serialized buffer
file as long as either `saveundo` or `savecursor` is enabled. Whereas in
the case when only `savecursor` is enabled, while `saveundo` is
disabled, this information is not used afterwards, so it only wastes the
disk space in `~/.config/micro/buffers`. (And given that currently micro
never automatically removes any serialized buffer files, it may
significantly contribute to the overall ever growing size of the
`~/.config/micro/buffers` directory.)

So avoid saving the undo info if `saveundo` is disabled. This makes the
size of each serialized buffer file with savecursor=on saveundo=off
small and predictable, e.g. around 600 bytes in my observations (whereas
without this fix, it may grow indefinitely big, depending on the number
of modifications the user made before saving the file).
2026-02-10 20:32:16 +01:00
Jöran Karl 1317a2deb1 Merge pull request #3983 from Neko-Box-Coder/FixRootSplitBug
Fixing missing case for handling root node for splitting
2026-02-09 18:39:01 +01:00
Neko Box Coder fda43aff15 Adding special case for root node for flatten() 2026-02-08 21:57:50 +00:00
Neko Box Coder 7ef8ca476d Fixing missing case for handling root node for splitting, fixes #3980 2026-02-08 21:57:50 +00:00
hemmingsv 3a7403bde4 feat(textfilter): Select output if input was from selection (#3974) 2026-01-28 19:41:51 +01:00
Dmytro Maluka dc2d70bfe1 Fix default keybindings for Ctrl-c and Ctrl-x in command mode (#3973)
Micro doesn't support chained actions for command mode keybindings yet,
it only supports them for regular buffer keybindings. Whereas Ctrl-c and
Ctrl-x are bound by default to the chained actions Copy|CopyLine and
Cut|CutLine in both buffer mode and command mode, so in command mode
Ctrl-c and Ctrl-x don't work at all (with default keybindings).

Luckily CopyLine and CutLine would not be not very useful in command
mode anyway. So fix the issue by changing the default keybindings in
command mode to the simple non-chained actions Copy and Cut.
2026-01-23 19:07:13 +01:00
Jöran Karl ab8c242044 gofmt after renaming the URL 2026-01-21 20:29:57 +01:00
Jöran Karl 4ead0e453b Change zyedidia/micro to micro-editor/micro 2026-01-21 20:29:55 +01:00
niten94 a544015a35 Use argument passed to OpenCmd without splitting (#3946)
"Split(args[0])" has been performed since "open" was added[1], but it
may had been left by accident. It's unlikely desired when using the
command prompt, and doesn't seem to have been added once to commands
such as "vsplit" [2] which were implemented days before.

[1]: 5825353f64
[2]: 541daf212e
2026-01-11 11:19:50 +01:00
Jöran Karl adfc136506 command: Fix typo in documentation of HelpCmd() (#3956) 2026-01-11 11:19:09 +01:00
Jöran Karl 9a6c827880 config: Don't hardcode the fakecursor under Windows console any longer (#3959)
* config: Don't hardcode the `fakecursor` under Windows console any longer

We just set the global default and allow the user to override it.

* help: Add a concrete note for the `fakecursor` option in the Windows Console
2026-01-10 20:13:29 +01:00
Dmytro Maluka 118f5a3e35 gofmt fix 2025-12-03 01:19:35 +01:00
Mikko 70dfc7fcb4 fix drawing of wide characters in InfoWindow (#3919) 2025-11-27 19:45:30 +01:00
Jöran Karl a2620d1c02 Merge pull request #3914 from matthias314/m3/fix-issue-3700
quick fix for #3700
2025-11-27 19:24:52 +01:00
matthias314 560bfcf749 ensure regexp error messages are displayed in findCallback 2025-11-25 17:19:26 -05:00
matthias314 a577fc95ff handle regexps with missing \E (quick fix for #3700) 2025-11-25 17:19:26 -05:00
Jöran Karl bc5e59c670 Merge pull request #3618 from Neko-Box-Coder/LockConfig
Removing the ability for plugins to modify settings.json and bindings.json. Adding an option to reject plugins to bind keys.
2025-11-18 21:28:19 +01:00
Neko Box Coder 4f1d2bb543 Adding lockbindings option for disallowing lua to modify bindings at all 2025-11-18 19:12:20 +00:00
Neko Box Coder 7a250b7df4 Changing behavior for SetGlobalOption*() for lua to not write to file 2025-11-18 19:12:05 +00:00
Neko Box Coder b39b5b5916 Changing behavior for TryBindKey() for lua to not write to bindings.json 2025-11-18 19:12:04 +00:00
Jöran Karl bab39079b3 save: Remove a possible written backup in case the path has changed 2025-10-18 21:07:07 +02:00