Commit graph

3231 commits

Author SHA1 Message Date
Owen McGrath
c8eeb788cb
Update java.yaml (#3526) 2024-10-31 23:01:56 +01:00
Jöran Karl
aeabd5a7ba
Merge pull request #3518 from nimishjha/nano-like-pageup-pagedown
implement nano-like page up/page down functionality
2024-10-29 21:23:05 +01:00
Nimish Jha
b2dbcb3eab implement nano-like page up/page down functionality 2024-10-29 10:22:35 +11:00
Nimish Jha
eb880d8841 simplify code 2024-10-27 16:22:53 +11:00
Dmytro Maluka
1ead9ce4fd
Fix regression in CopyLine, CutLine, DeleteLine for last line (#3519)
Fix regression introduced in commit fdacb28962 ("CopyLine, CutLine,
DeleteLine: respect selection"): when CopyLine, CutLine or DeleteLine is
done in the last line of the buffer and this line is not empty, this
line gets selected but does not get copied/cut/deleted (and worse, it
remains selected).
2024-10-24 18:01:45 +02:00
Nimish Jha
b3227d6049
add actions: CursorToViewTop, CursorToViewCenter, CursorToViewBottom (#3506) 2024-10-23 07:25:33 +02:00
niten94
2c6dc32f5d
Set version as release when there are no commits ahead (#3515)
Print release version tag in tools/build-version.go even if the commit
being checked has a tag that is not a version number if there are no
commits ahead.
2024-10-22 22:07:30 +02:00
Creeper Lv
3cb8069e4a
Add target for Windows ARM64 in cross-compile.sh (#3512) 2024-10-21 19:33:14 +02:00
Dmytro Maluka
8c0e0fa2ed
Make textfilter work with multicursors (#3511)
As requested in [1] and [2], change the `textfilter` command behavior to
apply the filter to the selections of all cursors, not just the 1st one.

[1] https://github.com/zyedidia/micro/discussions/3505
[2] https://github.com/zyedidia/micro/discussions/3510
2024-10-20 21:27:19 +02:00
Dmytro Maluka
f293f983bd
Merge pull request #3503 from dmaluka/spawcursorup-logical-lines
Revert `SpawnMultiCursor{Up,Down}` honoring softwrap + overhaul `LastVisualX` usage
2024-10-20 21:26:59 +02:00
Jöran Karl
07f8cfbef1
Merge pull request #3502 from JoeKar/feature/help-split
action/command: Allow `-vsplit` & `-hsplit` as optional argument for `help`

Additionally the help, vsplit and hsplit command can now open multiple files like the tab command.
2024-10-20 20:17:53 +02:00
Jöran Karl
39b2b2639a action/command: Precise HelpCmd() documentation 2024-10-20 14:26:42 +02:00
Jöran Karl
47b84f75e1 config/settings: Add option helpsplit for permanent help split type
For downward compatibility the default split type for the `help` command
is set to be `hsplit`.
2024-10-20 14:26:42 +02:00
Jöran Karl
ff4c5c83f2 runtime/help: Align tab's documentation to vsplit 2024-10-20 14:26:42 +02:00
Jöran Karl
acabf2b492 action/command: Align vsplit & hsplit to tab's multiopen handling 2024-10-20 14:26:40 +02:00
Dmytro Maluka
1023c8d1be Document a few more undocumented colorscheme groups 2024-10-19 01:48:27 +02:00
Jöran Karl
2c62d4b70c action/command: Allow multiple help pages to be opened 2024-10-15 23:35:05 +02:00
Jöran Karl
26f0806915 action/command: Add optional flag -hsplit & -vsplit to help 2024-10-15 23:35:03 +02:00
Dmytro Maluka
e6ed161ca4 SpawnMultiCursorUp/Down: revert honoring softwrap
Commit 9fdea82542 ("Fix various issues with
`SpawnMultiCursor{Up,Down}`") changed SpawnMultiCursorUp/Down actions to
honor softwrap, i.e. spawn cursor in the next visual line within a
wrapped line, which may not be the next logical line in a buffer. That
was done for "consistency" with cursor movement actions CursorUp/Down
etc. But it seems there are no actual use cases for that, whereas at
least some users prefer spawning multicursor in the next logical line
regardless of the softwrap setting. So restore the old behavior.

Fixes #3499
2024-10-14 01:42:04 +02:00
Dmytro Maluka
134cd999c6 Reset LastVisualX on undo/redo
In cursor's Goto(), which is currently only used by undo and redo, we
restore remembered LastVisualX and LastWrappedVisualX values. But if
the window had been resized in the meantime, the LastWrappedVisualX
may not be valid anymore. So it may cause the cursor moving to
unexpected locations.

So for simplicity just reset these values on undo or redo, instead of
using remembered ones.
2024-10-14 01:42:04 +02:00
Dmytro Maluka
6214abba9a Overhaul LastVisualX and GetVisualX() usage
Restore the original meaning of LastVisualX before commit 6d13710d93
("Implement moving cursor up/down within a wrapped line"): last visual x
location of the cursor in a logical line in the buffer, not in a visual
line on the screen (in other words, taking tabs and wide characters into
account, but not taking softwrap into account). And add a separate
LastWrappedVisualX field, similar to LastVisualX but taking softwrap
into account as well.

This allows tracking last x position at the same time for both cases
when we care about softwrap and when we don't care about it. This can be
useful, for example, for implementing cursor up/down movement actions
that always move by logical lines, not by visual lines, even if softwrap
is enabled (in addition to our default CursorUp and CursorDown actions
that move by visual lines).

Also this fixes a minor bug: in InsertTab(), when `tabstospaces` is
enabled and we insert a tab, the amount of inserted spaces depends on
the visual line wrapping (i.e. on the window width), which is probably
not a good idea.
2024-10-14 01:41:35 +02:00
Dmytro Maluka
85afb6eb87 Use StoreVisualX() all over the code
Since we already have the StoreVisualX() helper, use it all over the
place instead of setting LastVisualX directly.

This will allow us to add more logic to StoreVisualX() add let this
extra logic apply everywhere automatically.
2024-10-13 17:46:34 +02:00
Jöran Karl
d60413f03c
Merge pull request #3495 from dmaluka/sudo-sigint-fix
Fix SIGINT killing micro when saving with sudo
2024-10-12 14:02:09 +02:00
Dmytro Maluka
af88b4d2a8 Fix error reporting when saving with sudo failed
When saving a file with sudo fails (e.g. if we set `sucmd` to a
non-existent binary, e.g. `set sucmd aaa`), we erroneously return
success instead of the error, as a result we report to the user that
that the file has been successfully saved. Fix it.
2024-10-06 17:08:25 +02:00
Dmytro Maluka
4baac3d3fb Fix SIGINT killing micro when saving with sudo
When we are saving a file with sudo, if we interrupt sudo via Ctrl-c,
it doesn't just kill sudo, it kills micro itself.

The cause is the same as in the issue #2612 for RunInteractiveShell()
which was fixed by #3357. So fix it the same way as in #3357.
2024-10-06 17:08:25 +02:00
theredcmdcraft
ac73f18191
Create nftables.yaml (#3325)
Created nftables syntax highlighting
2024-10-06 13:04:32 +02:00
Neko Box Coder
3b3fe63f19
Exposing replacement functions for deprecated IOUtil functions (#3393) 2024-09-22 22:08:32 +02:00
Oleksandr Redko
9cd1ce968d
tool/info-plist: decrease indentation and simplify (#3479) 2024-09-22 20:38:15 +02:00
Jöran Karl
71da59fd1c
Merge pull request #3466 from JoeKar/fix/linux-dynamic2static
Makefile: Make all builds explicitly fully static (disable CGO)
2024-09-19 17:27:16 +02:00
Jöran Karl
3f1e5ea6df README: Remove superflous whitespace 2024-09-18 19:10:46 +02:00
Jöran Karl
fcc7421bca Makefile: Fix native darwin/macOS builds with forced CGO 2024-09-18 19:08:50 +02:00
Jöran Karl
6722cc81de tools/cross-compile: Mark "Linux 64 fully static" to be same as "Linux 64"
It is kept for the next release only to support...
f90870e948/index.sh (L197-L204)
...and allow a fluent switch via:
https://github.com/benweissmann/getmic.ro/pull/40
2024-09-16 22:43:12 +02:00
Jöran Karl
90525a6a1d Makefile: Make all builds explicitly fully static by default (disable CGO) 2024-09-16 22:43:12 +02:00
Jöran Karl
6e46ae3090 Makefile: Remove "-s -w" from build-dbg target
This will keep the symbol table and the DWARF information.
2024-09-16 22:43:12 +02:00
Jöran Karl
4d2ddc7940 Makefile: Simplify build-tags build target 2024-09-16 22:43:12 +02:00
Massimo Mund
4f4a13a9a1
Implemented SkipMultiCursorBack as a counterpart to SkipMultiCursor (#3404) 2024-09-16 22:20:12 +02:00
Dmytro Maluka
9eaeb193d4
Merge pull request #3403 from masmu/refactor/tab-actions
Implemented new actions `FirstTab`, `LastTab`, `FirstSplit` and `LastSplit`
2024-09-16 22:19:36 +02:00
Dmytro Maluka
ca6012086b
Merge pull request #3335 from dmaluka/line-actions-cleanup
Improve and unify `CopyLine`, `CutLine`, `DeleteLine`, `DuplicateLine` actions
2024-09-16 22:19:05 +02:00
Oleksandr Redko
1539da7fdc
test: simplify cmd/micro tests (#3470) 2024-09-16 19:33:59 +02:00
Oleksandr Redko
a3211dce57
Build: set 1.17 as minimum supported Go version (#3461) 2024-09-16 19:21:43 +02:00
Massimo Mund
5f83661fee Fixes a bug where new BufPanes are not being inserted into the right array index.
When adding a new `BufPane` it is always being inserted last into `MainTab().Panes`.
This leads to a confusion when using the actions `PreviousSplit`, `NextSplit` as the previous/next split may not be the expected one.

How to reproduce:
- Launch micro and insert char "1"
- Open a new vsplit via the command `vsplit` and insert "2"
- Switch back to the left split (1) by using `PreviousSplit`
- Again open a new vsplit via command: `vsplit` and type char "3"
- Now switch between the 3 splits using `PreviousSplit`, `NextSplit`

Switching from most left split to the most right, the expected order would be 1, 3, 2 but actually is 1, 2, 3.
2024-09-15 16:36:00 +02:00
Massimo Mund
2e44db1ee9 Implemented new actions FirstTab, LastTab, FirstSplit and LastSplit and changed the default behavior of NextTab, PreviousTab, NextSplit, PreviousSplit to not walk in circles anymore 2024-09-15 16:35:22 +02:00
Oleksandr Redko
e6d4e37922
README: remove TOC in favor to GitHub's TOC (#3467) 2024-09-12 21:00:00 +02:00
Dmytro Maluka
d6d0b26041
Fix non-working raw escape bindings after restarting the screen (#3468)
When we temporarily disable the screen (e.g. during RunInteractiveShell)
and then enable it again, we reinitialize tcell.Screen from scratch, so
we need to register all previously registered raw escape sequences once
again. Otherwise raw escape bindings stop working, since the list of
raw escape sequences of this newly create tcell.Screen is empty.

Fixes #3392
2024-09-12 20:39:14 +02:00
Jonathan Berkeley
f22252e5ae
Mark quick install script as third-party (#3469)
Minor update to README that highlights the pipe install script is provided by a third-party.
2024-09-12 20:30:04 +02:00
Jöran Karl
8c52d2426d
Merge pull request #3458 from JoeKar/feature/empty-rules
Remove empty rules in regions
2024-09-09 18:48:21 +02:00
Jöran Karl
596da97626 syntax/syntax_converter: Remove empty rules in regions 2024-09-09 18:32:30 +02:00
Jöran Karl
f391b59be6 plugins/literate: Remove empty rules in regions 2024-09-09 18:32:30 +02:00
Jöran Karl
debef6e51b help/colors: Remove empty rules in regions 2024-09-09 18:32:30 +02:00
Jöran Karl
a9b513a28a syntax: Remove empty rules in regions 2024-09-09 18:32:30 +02:00