In JumpToMatchingBrace, the loop should stop immediately after finding the matching bracket.
It causes multiple jumps in certain situations:
`(I [ ]{ }) => ( I[ ]{ })`
Fix the regression after 3b34a02: setting readonly option to true
in onBufferOpen lua callback doesn't work, since it is automatically
reset to false if write permission is not denied.
Added tabbar.active color group for displaying the name of the active
tab in the tabbar with different colors.
If tabbar.active is not defined in the colorscheme, the active tab name
is displayed with the same colors as inactive ones.
Ref #1646
Fix the following bugs:
- If a split pane is not at the left edge of the screen, the statusline
with suggestions for it is displayed at wrong place.
- When keymenu is enabled, the statusline with suggestions is not
displayed at all.
Add InfoBuf's method AddToHistory function which adds a new item
to the history for the prompt type `ptype`.
This function is not used by micro itself. It is useful for plugins
which add their own items to the history, bypassing the infobar
command line.
This commit exposes the separate infopane bindings to configuration
from the user. This also adds support for separate bindings in the
terminal emulator view. Default bindings are provided, but can also
be rebound in bindings.json.
This commit separates actions in the command bar from actions in
a normal buffer, and implements what is needed to allow rebinding,
although an interface for command bar keybindings is not yet exposed
to the user.
This commit adds support for binding key sequences such as
"<Ctrl-x><Ctrl-c>". This commit does not solve the problem
of global bindings yet, and therefore the command bar doesn't
work properly in this commit.
Fix the 2nd part of #1773: resize via mouse drag doesn't work if the
split on the left contains other splits, i.e. is not a leaf node.
The problem is that only leaf nodes have unique id. For non-leaf nodes
ID() returns 0. So we shouldn't search the node by id.
So replace GetMouseSplitID() with GetMouseSplitNode().
Fix the 1st part of #1773: the dividing line between vertical splits
is not displayed if the split on the left contains other splits, i.e.
is not a leaf node.
When commenting a selection, the plugin won't just toggle each
line individually but will only uncomment the block if it is all
comments.
The comment plugin also now takes into account any number of spaces
between the comment character and the text. For example '//comment' will
be uncommented properly, as well as '// comment'.
Fixes#1758
Windows does not allow ':' in a path, but for some reason previous
versions still worked, except the file for storing buffer info
(which had a ':' in the name) was not viewable except by opening
it with micro.
Ref #1736
In effect, pasting text with \r\n will remove the \r character and
delegate whether or not the file will be saved with CRLF or LF line
endings to the `fileformat` option.
Ref #1742
This commit introduces several improvements to the backup system.
* Backups are made every 8 seconds for buffers that have been modified
since the last backup.
* The `permbackup` option allows users to specify that backups should
be kept permanently.
* `The backupdir` option allows users to store backups in a custom
directory.
Fixes#1641Fixes#1536
Ref #1539 (removes possibility of race condition for backups)
The old notation (for example `CtrlG`) causes confusion when combined
with new notation needed for alt (`Alt-g`) due to Alt being case
sensitive. Previously both formats were supported, but the documentation
and defaults used a combination. This commit only uses the new notation
for consistency.
Ref #1470
With these changes, settings.json should only contain options that
have been modified from their default values. Micro will actively
options that are set to default values from the settings.json file.
To see a full list of settings and their defaults, see the "options"
documentation, as well as `micro -options`.
This option is disabled by default, and when enabled causes micro
to parse `:line:col` as a location for the cursor rather than
as part of the filename.
Closes#1650Closes#1685
* Added hybrid line numbers
* Changed rulerhybrid to relativeruler, modified documentation accordingly.
* Reverted go.mod and go.sum
I don't know how they got changed but they are good now.
Co-authored-by: Colin Hughes <semilin@pop-os.localdomain>
If screen.Redraw() is called very quickly after a key or mouse event,
it may send the redraw event while micro is not waiting for it but
still processing the key or mouse event. Since drawChan is non-buffered
and at the same time non-blocking, this redraw event will be simply lost,
so the screen content will not be up-to-date.
There is a bit of mess in the usage of HighlightMatches: in some places
we assume that it updates lines from startline to endline inclusive,
in other places we assume it's non-inclusive.
This fix makes it always inclusive.
In particular, it fixes a bug: when we open a file which has no
newline at the end, the last line isn't highlighted.
* Adds command "tabmove ±n", for better tab management
* Added tabmove to help:commands
* Replace uses of util.Min, util.Max with util.Clamp
Browsing code and discovered `util.Clamp`, ideal for this section of my code
* oops, missed an arg
* Typo, again
Fix problem with non-working unbind of a rune key.
E.g. after the following commands:
bind "n" "FindNext"
unbind "n"
Observed result: "n" key still triggers FindNext action
Expected result: "n" key inserts "n" rune
These actions reintroduce the behavior of micro where the Home key
toggles between the start of text (first) and the start of the line.
The same applies for the variant with selection. This commit also
sets these bindings as the defaults.