405 Commits

Author SHA1 Message Date
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
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
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
niten94
85b4b2b788 Disable sudo save prompt on Windows
Display message stating that saving with sudo is unsupported on Windows,
immediately without a prompt when permission is denied.
2025-09-21 00:30:07 +08:00
cutelisp
0b9c7c0c4a Add toggle & togglelocal command (#3783) 2025-09-05 20:56:02 +02:00
deepdring
b8057f28c6 refactor: use a more modern writing style to simplify code (#3834)
Signed-off-by: deepdring <deepdrink@icloud.com>
2025-08-26 02:00:51 +02:00
cutelisp
3a7705a090 Enhance GetNativeValue 2025-07-11 11:21:40 +02:00
blamedrop
55a553041b Update log buffer name as well
Using such fake path have some issues as mentioned in https://github.com/zyedidia/micro/pull/3791#discussion_r2176197355 comment
2025-07-09 00:47:15 +02:00
blamedrop
532a229c57 Add buffer name for raw pane 2025-07-09 00:47:15 +02:00
Dmytro Maluka
baa632e6cc Remove PluginCBRune()
Now that we can pass extra args directly to PluginCB(), we can remove
PluginCBRune() for simplicity.
2025-06-21 03:09:55 +02:00
Dmytro Maluka
7861b00cd1 Pass mouse info to {on,pre}MouseXXX callbacks
Pass *tcell.EventMouse to action callbacks for "mouse actions", i.e. to
onMousePress, preMouseDrag and so on, similarly to how we pass it to lua
functions bound to mouse events.
2025-06-21 03:06:48 +02:00
Dmytro Maluka
54ba3cdb4f Make PluginCB() a variadic function
So that we can pass extra arguments to bufpane callbacks easily, by
passing them directly to PluginCB().
2025-06-21 03:04:37 +02:00
cutelisp
5eddf5b85d Change MainTab calls (#3750)
Swaping `MainTab` calls to `h.tab` will not change the normal micro
behaviour.
This changes will make possible to call `ForceQuit`, `VSplitIndex` and
`HSplitIndex` for tabs that aren't main one.
2025-05-26 22:07:14 +02:00
Jöran Karl
58b6917526 command: Apply small cosmetics to openTerm() 2025-05-08 06:27:11 +02:00
Jöran Karl
63b6a1e6cf command: Extract term() as dedicated openTerm() function 2025-05-08 06:27:07 +02:00
Jöran Karl
4769a94fb1 command: Exit loop in TermCmd() after terminal call
Otherwise the last opened pane is closed instead of the active one.
2025-05-07 19:33:31 +02:00
cutelisp
ca32ffbb4a Change variable visibility (#3720)
Changed DoubleClick and TripleClick to public so they can be accessed by
Lua plugins.
2025-04-29 20:55:01 +02:00
niten94
c457ae421a Generalize save prompt on close code into method
This slightly changes the open and term command to be similar with the
Quit action, where the buffer or pane is replaced after the prompts are
completed if "n" wasn't pressed after the 1st prompt.
2025-04-18 19:21:27 +08:00
niten94
0d5b2b73e3 Skip save on open or term command if buffer is shared 2025-04-18 19:19:19 +08:00
Mikko
79fe4ae3e3 fix cycling through completion suggestions ending in non-word character (#3650) 2025-04-15 21:02:41 +02:00
cutelisp
b88300ef7f Fix comment (#3716) 2025-04-12 12:27:00 +02:00
niten94
f2454c9248 Specify tags where term emulation is unsupported
Copy build constraints in actions_other.go to terminal_unsupported.go,
to avoid maintaining separate build constraints that are similar with
terminal_supported.go.
2025-04-05 17:49:57 +08:00
niten94
a699cac3be Support term emulation on solaris, netbsd, openbsd/*
Support terminal emulation on platforms below:
- Solaris
- NetBSD: Supported in creack/pty since v1.1.12
- OpenBSD with GOOS != amd64
  - Other architectures are supported now in creack/pty
2025-04-05 17:49:57 +08:00
Dmytro Maluka
948b05745f Fix remaining gofmt complaints 2025-03-24 23:04:06 +01:00
Dmytro Maluka
eadc402ae0 Import paths: fix non-alphabetic order
Make gofmt happy about that.
2025-03-24 23:01:48 +01:00
Dmytro Maluka
1bd86a8f79 Build constraints: switch to new syntax
Make gofmt happy about that.
2025-03-24 22:54:32 +01:00
Neko Box Coder
9003243178 Removing the use of SetName() for file buffers 2025-03-12 19:24:36 +00:00
Neko Box Coder
c9f12206e9 Updating SaveCmd to use saveBufToFile instead 2025-03-11 03:11:03 +00:00
Jöran Karl
49aebe8aca save+util: Provide a meaningful error message for safe (over-)write fails 2025-02-28 18:57:53 +01:00
Jöran Karl
63d68ec441 bindings: Perform write process safe 2025-02-28 18:57:53 +01:00
Jöran Karl
1663a1a6e4 actions: Don't overwrite the buffers Path
This is fully handled within the buffers `save` domain.
2025-02-28 18:57:53 +01:00
Jöran Karl
6e8daa117a ioutil: Remove deprecated functions where possible 2025-02-28 18:57:53 +01:00
Jöran Karl
18a81f043c util: Generalize the file mode of 0666 with util.FileMode 2025-02-28 18:57:53 +01:00
Jöran Karl
5aac42dbe7 bindings: Convert os.IsNotExist() into errors.Is() 2025-02-28 18:57:53 +01:00
Jöran Karl
3fcaf16074 actions: SaveCmd: Print the error of SaveAs to the InfoBar 2025-02-28 18:57:53 +01:00
Jöran Karl
5c21241fc4 actions: SaveAs: Print the error of os.Stat() to the InfoBar 2025-02-28 18:57:53 +01:00
Jöran Karl
ddc6051b33 actions: Use SetOptionNative() instead of setting options directly
Setting options directly in (h.)Buf.Settings without calling SetOption() or
SetOptionNative() is generally not the best idea, since it may not
trigger the needed side effects.
In particular, after https://github.com/zyedidia/micro/pull/3343,
directly setting `diffgutter` and `ruler` causes them not being tracked as
locally overridden per buffer, so if we run the `reload` command,
it unexpectedly replaces them with the default ones.
2025-02-20 20:24:07 +01:00
Jöran Karl
e4b0ad7107 Merge pull request #3620 from JoeKar/feature/cursor-overwrite-indicator
statusline: Provide `overwrite` mode indicator
2025-01-31 17:59:36 +01:00
Neko Box Coder
dc18642985 Add missing resize in TabMove (#3619) 2025-01-28 21:04:05 +01:00
yz778
c02036e52f Prompt to save or discard new files even with autosave enabled (#3626) 2025-01-25 20:24:31 +01:00
Jöran Karl
c61670e86f buffer: Store the overwrite mode 2025-01-22 17:12:50 +01:00