Commit Graph

3398 Commits

Author SHA1 Message Date
cutelisp
c9f84cd2b7 Documentation Fix (#3818) 2025-07-26 11:39:12 +02:00
cutelisp
f97cba34d2 Small Documentation Improvement (#3786) 2025-07-25 21:02:33 +02:00
Neko Box Coder
d7e43d4974 Adding missing file closes, rewriting safeWrite() to be more robust (#3807) 2025-07-22 22:58:18 +02:00
Dmytro Maluka
dbdf753f27 Merge pull request #3310 from Neko-Box-Coder/CppAndCLiteralSeparatorFix
Changing syntax behavior for single quote to allow binary and hex literal separator
2025-07-20 16:14:32 +02:00
Dmytro Maluka
7492195a5b Merge pull request #3799 from dmaluka/doc-update
Some documentation improvements
2025-07-19 14:19:11 +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
Jonathan
cf92f77fdc Add syntax highlighting for PRQL (#3313)
* Add syntax highlighting for PRQL

Adds a syntax highlighting mode for the PRQL query language.

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement.
https://prql-lang.org/
https://github.com/PRQL/prql

* Update runtime/syntax/prql.yaml

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>

* Update runtime/syntax/prql.yaml

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>

* Update runtime/syntax/prql.yaml

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>

* Update runtime/syntax/prql.yaml

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>

* Update prql.yaml

* Update prql.yaml

---------

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>
2025-07-08 11:45:29 +02:00
Dmytro Maluka
0694cd2c1b help: Document passing *tcell.EventMouse to mouse action callbacks 2025-07-05 17:23:19 +02:00
Dmytro Maluka
c267c7c9aa help: Update and correct documentation for onAction return value
The documentation says that the returned value of onAction callbacks
is used for determining whether the view should be relocated, which
has nothing to do with reality, this returned value is used for a
completely different thing. So update the docs accordingly.
2025-07-05 17:23:19 +02:00
Dmytro Maluka
ffdd4b43dd help: Update the list of mouse actions 2025-07-05 17:23:19 +02:00
Dmytro Maluka
61d7f68f9b help: Document binding keys to lua functions
This is still not properly documented (except for the example in
tutorial.md), so document it.
2025-07-05 17:23:19 +02:00
Dmytro Maluka
41b912b539 Merge pull request #3779 from dmaluka/on-pre-mouse-pass-te
Pass mouse info to {on,pre}MouseXXX callbacks
2025-06-29 22:46:10 +02:00
Jöran Karl
da02f836ff Merge pull request #3761 from dmaluka/colorscheme-plugins-regression-fix
Fix non-working colorscheme plugins
2025-06-25 20:57:49 +02:00
Neko Box Coder
4db233acf4 Minor fix for comment plugin and migrating to use "comment.type" option (#3424)
Fixing comment plugin not using user settings when overriding default
setting,
Migrating comment plugin to use "comment.type" option instead
2025-06-24 22:30:26 +02:00
Dmytro Maluka
e923640b37 Move loading colorschemes after initializing plugins
Micro "allows" plugins to register colorschemes via
config.AddRuntimeFile(). However, that has never really worked, since
InitColorscheme() is called earlier than plugins init() or even
preinit() callbacks are called.

To work around that, plugins that use it (e.g. nord-tc [1]) are using a
tricky hack: call config.AddRuntimeFile() not in init() or preinit() but
directly in Lua's global scope, so that it is called earlier, when the
plugin's Lua code is loaded. This hack is not guaranteed to work, and
works by chance. Furthermore, it only works when starting micro, and
doesn't work after the `reload` command. (The reason it doesn't work is
that PluginAddRuntimeFile() calls FindPlugin() which calls IsLoaded()
which returns false, since, well, the plugin is not loaded, it is only
being loaded. And the reason why it works when starting micro is that
in that case IsLoaded() confusingly returns true, since
GlobalSettings[p.Name] has not been set yet.)

So move InitColorscheme() call after calling plugins init/preinit/
postinit callbacks, to let plugins successfully register colorschemes
in any of those callbacks instead of using the aforementioned hack.

[1] https://github.com/KiranWells/micro-nord-tc-colors
2025-06-24 22:24:47 +02:00
Dmytro Maluka
73066fb69b Disable early validation of colorscheme option
Adding early validation of options in ReadSettings() caused a regression:
colorschemes registered by plugins via config.AddRuntimeFile() stopped
working, since ReadSettings() is called when plugins are not initialized
(or even loaded) yet, so a colorscheme is not registered yet and thus
its validation fails.

Fix that with an ad-hoc fix: treat the "colorscheme" option as a special
case and do not verify it early when reading settings.json, postponing
that until the moment when we try to load this colorscheme.
2025-06-24 22:24:47 +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
theredcmdcraft
97b5e3506e Nftables improvements (#3517) 2025-06-20 21:00:25 +02:00
Mikko
29dc892009 Fix Ruby syntax highlighting for predefined variables (#3778) 2025-06-20 20:53:46 +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
cd0dc9a701 options: Add truecolor to control the usage (#2867)
- `auto`: enable usage of true color if it is supported, otherwise disable it
- `on`: force usage of true color
- `off`: disable true color usage

Co-authored-by: Dmytro Maluka <dmitrymaluka@gmail.com>
2025-05-26 18:25:07 +02:00
Codemanticism
bf255b6c35 rust.yaml: Add the keyword "union" (#3759) 2025-05-25 12:59:59 +02:00
Dmytro Maluka
98ff79dbca Relocate buffer view after setting options that affect it (#3743)
Whenever the user changes the value of an option that affects the
calculation of display params in updateDisplayInfo(), we should
immediately recalculate those params and relocate the buffer view
accordingly.

For example: after enabling ruler via `set ruler on`, if the cursor is
currently at the rightmost edge of the bufpane and softwrap is disabled,
then the cursor becomes invisible (since it is now outside the view,
since the buffer view width is decreased as a result of adding the ruler
but StartCol is not updated accordingly), it only becomes visible again
after the user types a character (or performs some other action that
triggers updateDisplayInfo() + relocate). Fix it.
2025-05-11 16:20:23 +02:00
cutelisp
44d0368747 FIX: ruler drawn on top of the tab bar (#3744)
Wrap function lacked a condition to avoid drawing below 0.
2025-05-11 15:32:35 +02:00
cutelisp
895d9d2c82 Fix Scrollbar covering cursor (#3741) 2025-05-11 15:22:59 +02:00
Jöran Karl
809db4ee24 Merge pull request #3738 from JoeKar/fix/termcmd
command: Fix crash caused by `TermCmd()`
2025-05-10 20:29:20 +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
Shinsuke Nashimoto
91832d0016 Fixed a broken colorscheme (sunny-day) due to a typo (#3735) 2025-05-06 20:38:45 +02:00
Jöran Karl
06fe85c8c9 Merge pull request #3708 from Neko-Box-Coder/ChainedParentsFix
Fix unable to perform proportional resize caused by chained parents after quiting a nested VSplit inside a HSplit
2025-04-29 21:06:19 +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
cutelisp
b61c8a4e1a Deleted duplicated line (#3728) 2025-04-28 19:55:03 +02:00
Jöran Karl
333770bbd0 Merge pull request #3727 from JoeKar/fix/path2filepath
Convert leftover usages of `path` to `filepath`
2025-04-27 13:16:00 +02:00
Jöran Karl
7e583fe6ff lua: Remove duplicated export of filepath.Join() 2025-04-26 20:37:51 +02:00
Jöran Karl
1eef4bb3e0 Convert leftover usages of path to filepath 2025-04-26 20:37:49 +02:00
Neko Box Coder
8e7089993d Simplifying unsplit logic 2025-04-26 18:11:19 +01:00
Neko Box Coder
080d216ffd Fixing chained parents by flattening the tree on unsplit 2025-04-26 18:11:19 +01:00
Jöran Karl
e5c3a3edc3 Merge pull request #3719 from niten94/sbuf-switch-skipsave
Skip save on `open` or `term` command if buffer is shared
2025-04-24 13:36:16 +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
Jöran Karl
d36e7f4057 Merge pull request #3714 from niten94/terminal-20250105
Update `micro-editor/terminal` and support terminal emulator in platforms
2025-04-09 20:08:08 +02:00
niten94
2bb3c9aa73 Add Solaris and Illumos targets in cross-compile.sh 2025-04-05 17:49:57 +08: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