Compare commits

...

37 Commits

Author SHA1 Message Date
Jöran Karl
25faa84fcb Fix documentation for Loc.LessThan() and other similar functions (#4058)
* Fix documentation for Loc.LessThan() and other similar functions

* Rewrite Loc.MoveLA(n): do not call util.Abs(n) in cycle, cleaner code
2026-03-30 18:13:39 +02:00
Prasad Ramdas Hiwarkhede
4d04ad7290 syntax: add Gleam language support (#4045) 2026-03-28 20:42:12 +01: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
d976b3f170 Merge pull request #4044 from JoeKar/fix/crash-glob
Fix crash with file globbing matching micro option names
2026-03-22 15:03:11 +01: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 Karl
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 <dmitrymaluka@gmail.com>
2026-03-18 19:46:36 +01:00
Jöran Karl
6760768b9e micro: Rearrange signal creation (#4027)
Otherwise we can't properly react upon screen events or signals created
within early plugin functions.
2026-03-17 20:45:10 +01:00
Jöran Karl
42d0ddf73d Merge pull request #4025 from injust/patch-1
Fix unescaped backslashes and expand git-config filename pattern to include `*/git/config`
2026-03-09 10:01:41 +01:00
Justin Su
5ddb05b5ec Apply suggestion from @Andriamanitra
Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>
2026-03-08 20:02:59 -04:00
Justin Su
ad43a5da99 Replace [\/] with [\\/] 2026-03-08 16:32:24 -04:00
Justin Su
dc10f6d53c Convert filename regexes to single-quoted strings 2026-03-08 16:31:24 -04:00
Kenny Wottrich
518a274980 Add detection for SWAG nginx proxy confs (#4036)
* Add detection for SWAG nginx proxy confs

These nginx config files have the format "appname.subdomain.conf" or "appname.subfolder.conf"

* Excape dot in regex

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

---------

Co-authored-by: Mikko <Andriamanitra@users.noreply.github.com>
2026-03-08 20:24:49 +01:00
Justin Su
184dd259e9 Match backslash too 2026-02-26 14:27:38 -05:00
Justin Su
f1a7f0d392 Expand git-config filename pattern to include */git/config 2026-02-26 06:36:51 -05:00
usfbih8u
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
3e95779cf0 templates: Fix empty titles introduced with #3971 2026-01-21 20:55:01 +01:00
Jöran Karl
28e1b020e4 Merge pull request #3971 from JoeKar/fix/repository-url
Change `zyedidia/micro` to `micro-editor/micro`
2026-01-21 20:52:05 +01:00
Jöran Karl
0a4e15b5a7 Merge pull request #3969 from JoeKar/fix/issue-template
Restore issue template functionality
2026-01-21 20:51:40 +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
Jöran Karl
20842c0d30 templates: Deny blank issues 2026-01-21 19:23:19 +01:00
Jöran Karl
5c98734f56 templates: Add feature template 2026-01-21 19:23:17 +01:00
Jöran Karl
2e278712ef templates: Convert markdown issue template into YAML form
.github/ISSUE_TEMPLATE isn't allowed as template file name any longer,
since it is used as the default search folder for issue templates.
2026-01-21 19:23:15 +01:00
Frank
d1426b6fb2 Add syntax highlighting rules for B language (#3965) 2026-01-18 10:45:45 +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
ee09a0354a tools/cross-compile: Drop creation of Linux 64 fully static archive (#3957)
Since https://github.com/benweissmann/getmic.ro/pull/40 was merged there is no
need to create this superfluous archive any longer.
2026-01-10 20:14:37 +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
Jöran Karl
6a62575bcf metainfo: Release v2.0.15 2025-12-31 12:47:43 +01:00
Neko Box Coder
467eb88df0 Adding clarification regarding multiple characters for showchars (#3945)
Adding clarification regarding multiple characters for showchars.

Closes #3938
2025-12-18 18:16:51 +01:00
77 changed files with 592 additions and 352 deletions

View File

@@ -1,9 +0,0 @@
## Description of the problem or steps to reproduce
## Specifications
<!-- You can use `micro -version` to get the commit hash. -->
Commit hash:
OS:
Terminal:

25
.github/ISSUE_TEMPLATE/01-bug.yml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Bug Report
description: File a bug report.
title: "<title>"
labels: ["bug", "triage"]
body:
- type: textarea
attributes:
label: Description
description: Description of the problem and steps to reproduce.
validations:
required: true
- type: textarea
attributes:
label: Environment
description: |
examples:
- **Version**: 2.0.15 and/or commit hash ($ micro -version)
- **OS**: Debian
- **Terminal**: ptyxis
value: |
- Version:
- OS:
- Terminal:
validations:
required: true

11
.github/ISSUE_TEMPLATE/02-feature.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
name: Feature Request
description: File a feature request.
title: "<title>"
labels: ["feature"]
body:
- type: textarea
attributes:
label: Description
description: Description of the feature.
validations:
required: true

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1 @@
blank_issues_enabled: false

View File

@@ -6,8 +6,8 @@ HASH = $(shell git rev-parse --short HEAD)
DATE = $(shell GOOS=$(shell go env GOHOSTOS) GOARCH=$(shell go env GOHOSTARCH) \
go run tools/build-date.go)
GOBIN ?= $(shell go env GOPATH)/bin
GOVARS = -X github.com/zyedidia/micro/v2/internal/util.Version=$(VERSION) -X github.com/zyedidia/micro/v2/internal/util.CommitHash=$(HASH) -X 'github.com/zyedidia/micro/v2/internal/util.CompileDate=$(DATE)'
DEBUGVAR = -X github.com/zyedidia/micro/v2/internal/util.Debug=ON
GOVARS = -X github.com/micro-editor/micro/v2/internal/util.Version=$(VERSION) -X github.com/micro-editor/micro/v2/internal/util.CommitHash=$(HASH) -X 'github.com/micro-editor/micro/v2/internal/util.CompileDate=$(DATE)'
DEBUGVAR = -X github.com/micro-editor/micro/v2/internal/util.Debug=ON
VSCODE_TESTS_BASE_URL = 'https://raw.githubusercontent.com/microsoft/vscode/e6a45f4242ebddb7aa9a229f85555e8a3bd987e2/src/vs/editor/test/common/model/'
CGO_ENABLED := $(if $(CGO_ENABLED),$(CGO_ENABLED),0)

View File

@@ -1,9 +1,9 @@
<img alt="micro logo" src="./assets/micro-logo-drop.svg" width="500px"/>
![Test Workflow](https://github.com/zyedidia/micro/actions/workflows/test.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/zyedidia/micro/v2)](https://goreportcard.com/report/github.com/zyedidia/micro/v2)
[![Release](https://img.shields.io/github/release/zyedidia/micro.svg?label=Release)](https://github.com/zyedidia/micro/releases)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/zyedidia/micro/blob/master/LICENSE)
![Test Workflow](https://github.com/micro-editor/micro/actions/workflows/test.yaml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/micro-editor/micro/v2)](https://goreportcard.com/report/github.com/micro-editor/micro/v2)
[![Release](https://img.shields.io/github/release/micro-editor/micro.svg?label=Release)](https://github.com/micro-editor/micro/releases)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/micro-editor/micro/blob/master/LICENSE)
[![Join the chat at https://gitter.im/zyedidia/micro](https://badges.gitter.im/zyedidia/micro.svg)](https://gitter.im/zyedidia/micro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Snap Status](https://snapcraft.io/micro/badge.svg)](https://snapcraft.io/micro)
@@ -57,18 +57,18 @@ You can also check out the website for Micro at https://micro-editor.github.io.
## Installation
To install micro, you can download a [prebuilt binary](https://github.com/zyedidia/micro/releases), or you can build it from source.
To install micro, you can download a [prebuilt binary](https://github.com/micro-editor/micro/releases), or you can build it from source.
If you want more information about ways to install micro, see this [wiki page](https://github.com/zyedidia/micro/wiki/Installing-Micro).
If you want more information about ways to install micro, see this [wiki page](https://github.com/micro-editor/micro/wiki/Installing-Micro).
Use `micro -version` to get the version information after installing. It is only guaranteed that you are installing the most recent
stable version if you install from the prebuilt binaries, Homebrew, or Snap.
A desktop entry file and man page can be found in the [assets/packaging](https://github.com/zyedidia/micro/tree/master/assets/packaging) directory.
A desktop entry file and man page can be found in the [assets/packaging](https://github.com/micro-editor/micro/tree/master/assets/packaging) directory.
### Pre-built binaries
Pre-built binaries are distributed in [releases](https://github.com/zyedidia/micro/releases).
Pre-built binaries are distributed in [releases](https://github.com/micro-editor/micro/releases).
To uninstall micro, simply remove the binary, and the configuration directory at `~/.config/micro`.
@@ -85,14 +85,14 @@ The script will place the micro binary in the current directory. From there, you
With [Eget](https://github.com/zyedidia/eget) installed, you can easily get a pre-built binary:
```
eget zyedidia/micro
eget micro-editor/micro
```
Use `--tag VERSION` to download a specific tagged version.
```
eget --tag nightly zyedidia/micro # download the nightly version (compiled every day at midnight UTC)
eget --tag v2.0.8 zyedidia/micro # download version 2.0.8 rather than the latest release
eget --tag nightly micro-editor/micro # download the nightly version (compiled every day at midnight UTC)
eget --tag v2.0.8 micro-editor/micro # download version 2.0.8 rather than the latest release
```
You can install `micro` by adding `--to /usr/local/bin` to the `eget` command, or move the binary manually to a directory on your `$PATH` after the download completes.
@@ -109,7 +109,7 @@ brew install micro
**Note for Mac:** All micro keybindings use the control or alt (option) key, not the command
key. By default, macOS terminals do not forward alt key events. To fix this, please see
the section on [macOS terminals](https://github.com/zyedidia/micro#macos-terminal) further below.
the section on [macOS terminals](https://github.com/micro-editor/micro#macos-terminal) further below.
On Linux, you can install micro through [snap](https://snapcraft.io/docs/core/install)
@@ -132,7 +132,7 @@ for other operating systems. These packages are not guaranteed to be up-to-date.
* `eopkg install micro` (Solus).
* `pacstall -I micro` (Pacstall).
* `apt-get install micro` (ALT Linux)
* See [wiki](https://github.com/zyedidia/micro/wiki/Installing-Micro) for details about CRUX, Termux.
* See [wiki](https://github.com/micro-editor/micro/wiki/Installing-Micro) for details about CRUX, Termux.
* distro-agnostic package managers:
* `nix profile install nixpkgs#micro` (with [Nix](https://nixos.org/) and flakes enabled)
* `flox install micro` (with [Flox](https://flox.dev))
@@ -165,7 +165,7 @@ If your operating system does not have a binary release, but does run Go, you ca
Make sure that you have Go version 1.19 or greater and Go modules are enabled.
```
git clone https://github.com/zyedidia/micro
git clone https://github.com/micro-editor/micro
cd micro
make build
sudo mv micro /usr/local/bin # optional
@@ -176,7 +176,7 @@ anywhere you like (for example `/usr/local/bin`).
The command `make install` will install the binary to `$GOPATH/bin` or `$GOBIN`.
You can install directly with `go get` (`go get github.com/zyedidia/micro/cmd/micro`) but this isn't
You can install directly with `go get` (`go get github.com/micro-editor/micro/cmd/micro`) but this isn't
recommended because it doesn't build micro with version information (necessary for the plugin manager),
and doesn't disable debug mode.
@@ -261,14 +261,14 @@ click to enable line selection.
micro has a built-in help system which you can access by pressing <kbd>Ctrl-e</kbd> and typing `help`. Additionally, you can
view the help files here:
- [main help](https://github.com/zyedidia/micro/tree/master/runtime/help/help.md)
- [keybindings](https://github.com/zyedidia/micro/tree/master/runtime/help/keybindings.md)
- [commands](https://github.com/zyedidia/micro/tree/master/runtime/help/commands.md)
- [colors](https://github.com/zyedidia/micro/tree/master/runtime/help/colors.md)
- [options](https://github.com/zyedidia/micro/tree/master/runtime/help/options.md)
- [plugins](https://github.com/zyedidia/micro/tree/master/runtime/help/plugins.md)
- [main help](https://github.com/micro-editor/micro/tree/master/runtime/help/help.md)
- [keybindings](https://github.com/micro-editor/micro/tree/master/runtime/help/keybindings.md)
- [commands](https://github.com/micro-editor/micro/tree/master/runtime/help/commands.md)
- [colors](https://github.com/micro-editor/micro/tree/master/runtime/help/colors.md)
- [options](https://github.com/micro-editor/micro/tree/master/runtime/help/options.md)
- [plugins](https://github.com/micro-editor/micro/tree/master/runtime/help/plugins.md)
I also recommend reading the [tutorial](https://github.com/zyedidia/micro/tree/master/runtime/help/tutorial.md) for
I also recommend reading the [tutorial](https://github.com/micro-editor/micro/tree/master/runtime/help/tutorial.md) for
a brief introduction to the more powerful configuration features micro offers.
There is also an unofficial Discord, which you can join at https://discord.gg/nhWR6armnR.
@@ -277,9 +277,9 @@ There is also an unofficial Discord, which you can join at https://discord.gg/nh
If you find any bugs, please report them! I am also happy to accept pull requests from anyone.
You can use the [GitHub issue tracker](https://github.com/zyedidia/micro/issues)
You can use the [GitHub issue tracker](https://github.com/micro-editor/micro/issues)
to report bugs, ask questions, or suggest new features.
For a more informal setting to discuss the editor, you can join the [Gitter chat](https://gitter.im/zyedidia/micro) or the [Discord](https://discord.gg/nhWR6armnR). You can also use the [Discussions](https://github.com/zyedidia/micro/discussions) section on Github for a forum-like setting or for Q&A.
For a more informal setting to discuss the editor, you can join the [Gitter chat](https://gitter.im/zyedidia/micro) or the [Discord](https://discord.gg/nhWR6armnR). You can also use the [Discussions](https://github.com/micro-editor/micro/discussions) section on Github for a forum-like setting or for Q&A.
Sometimes I am unresponsive, and I apologize! If that happens, please ping me.

View File

@@ -132,9 +132,9 @@ which can be accessed from within micro. Micro tells you what key combination to
press to get help in the lower right.
.SH BUGS
A comprehensive list of bugs will not be listed in this manpage. See the Github
page at \fBhttps://github.com/zyedidia/micro/issues\fP for a list of known bugs
page at \fBhttps://github.com/micro-editor/micro/issues\fP for a list of known bugs
and to report any newly encountered bugs you may find. We strive to correct
bugs as swiftly as possible.
.SH COPYRIGHT
Copyright \(co 2020 Zachary Yedidia, et al. MIT license.
See \fBhttps://github.com/zyedidia/micro\fP for details.
See \fBhttps://github.com/micro-editor/micro\fP for details.

View File

@@ -10,9 +10,9 @@ import (
"sort"
"strings"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/util"
)
func shouldContinue() bool {

View File

@@ -4,7 +4,7 @@ import (
"log"
"os"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/util"
)
// NullWriter simply sends writes into the void

View File

@@ -7,14 +7,14 @@ import (
lua "github.com/yuin/gopher-lua"
luar "layeh.com/gopher-luar"
"github.com/zyedidia/micro/v2/internal/action"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/action"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/util"
)
func init() {

View File

@@ -18,15 +18,15 @@ import (
"github.com/go-errors/errors"
isatty "github.com/mattn/go-isatty"
"github.com/micro-editor/micro/v2/internal/action"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/clipboard"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/v2/internal/action"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/clipboard"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
)
var (
@@ -363,6 +363,12 @@ func main() {
fmt.Println("Fatal: Micro could not initialize a Screen.")
exit(1)
}
util.Sigterm = make(chan os.Signal, 1)
sighup = make(chan os.Signal, 1)
signal.Notify(util.Sigterm, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGABRT)
signal.Notify(sighup, syscall.SIGHUP)
m := clipboard.SetMethod(config.GetGlobalOption("clipboard").(string))
clipErr := clipboard.Initialize(m)
@@ -374,7 +380,7 @@ func main() {
if e, ok := err.(*lua.ApiError); ok {
fmt.Println("Lua API error:", e)
} else {
fmt.Println("Micro encountered an error:", errors.Wrap(err, 2).ErrorStack(), "\nIf you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues")
fmt.Println("Micro encountered an error:", errors.Wrap(err, 2).ErrorStack(), "\nIf you can reproduce this error, please report it at https://github.com/micro-editor/micro/issues")
}
// immediately backup all buffers with unsaved changes
for _, b := range buffer.OpenBuffers {
@@ -400,6 +406,8 @@ func main() {
action.InitBindings()
action.InitCommands()
timerChan = make(chan func())
err = config.RunPluginFn("preinit")
if err != nil {
screen.TermMessage(err)
@@ -444,13 +452,6 @@ func main() {
screen.Events = make(chan tcell.Event)
util.Sigterm = make(chan os.Signal, 1)
sighup = make(chan os.Signal, 1)
signal.Notify(util.Sigterm, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGABRT)
signal.Notify(sighup, syscall.SIGHUP)
timerChan = make(chan func())
// Here is the event loop which runs in a separate thread
go func() {
for {

View File

@@ -7,12 +7,12 @@ import (
"testing"
"github.com/go-errors/errors"
"github.com/micro-editor/micro/v2/internal/action"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/tcell/v2"
"github.com/stretchr/testify/assert"
"github.com/zyedidia/micro/v2/internal/action"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
)
var tempDir string

View File

@@ -25,6 +25,7 @@
<category>TextEditor</category>
</categories>
<releases>
<release version="2.0.15" date="2025-12-31"/>
<release version="2.0.14" date="2024-08-27"/>
<release version="2.0.13" date="2023-10-22"/>
<release version="2.0.12" date="2023-09-06"/>
@@ -38,15 +39,15 @@
<screenshots>
<screenshot type="default">
<caption>Micro Text Editor editing its source code</caption>
<image type="source">https://raw.githubusercontent.com/zyedidia/micro/master/assets/micro-solarized.png</image>
<image type="source">https://raw.githubusercontent.com/micro-editor/micro/master/assets/micro-solarized.png</image>
</screenshot>
</screenshots>
<content_rating type="oars-1.1" />
<url type="homepage">https://micro-editor.github.io</url>
<url type="bugtracker">https://github.com/zyedidia/micro/issues</url>
<url type="bugtracker">https://github.com/micro-editor/micro/issues</url>
<url type="faq">https://micro-editor.github.io/about.html</url>
<url type="help">https://micro-editor.github.io/about.html</url>
<url type="contact">https://github.com/zyedidia</url>
<url type="vcs-browser">https://github.com/zyedidia/micro</url>
<url type="contribute">https://github.com/zyedidia/micro#contributing</url>
<url type="vcs-browser">https://github.com/micro-editor/micro</url>
<url type="contribute">https://github.com/micro-editor/micro#contributing</url>
</component>

View File

@@ -1,43 +1,43 @@
{
"$comment": "https://github.com/zyedidia/micro",
"$comment": "https://github.com/micro-editor/micro",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "options",
"description": "A micro editor config schema",
"type": "object",
"properties": {
"autoindent": {
"description": "Whether to use the same indentation as a previous line\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to use the same indentation as a previous line\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"autosave": {
"description": "A delay between automatic saves\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A delay between automatic saves\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
"minimum": 0,
"default": 0
},
"autosu": {
"description": "Whether attempt to use super user privileges\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether attempt to use super user privileges\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"backup": {
"description": "Whether to backup all open buffers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to backup all open buffers\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"backupdir": {
"description": "A directory to store backups\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A directory to store backups\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": ""
},
"basename": {
"description": "Whether to show a basename instead of a full path\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to show a basename instead of a full path\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"clipboard": {
"description": "A way to access the system clipboard\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A way to access the system clipboard\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"enum": [
"external",
@@ -47,13 +47,13 @@
"default": "external"
},
"colorcolumn": {
"description": "A position to display a column\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A position to display a column\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
"minimum": 0,
"default": 0
},
"colorscheme": {
"description": "A color scheme\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A color scheme\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"enum": [
"atom-dark",
@@ -85,42 +85,42 @@
"default": "default"
},
"cursorline": {
"description": "Whether to highlight a line with a cursor with a different color\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to highlight a line with a cursor with a different color\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"diffgutter": {
"description": "Whether to display diff inticators before lines\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to display diff inticators before lines\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"divchars": {
"description": "Divider chars for vertical and horizontal splits\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Divider chars for vertical and horizontal splits\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "|-"
},
"divreverse": {
"description": "Whether to use inversed color scheme colors for splits\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to use inversed color scheme colors for splits\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"encoding": {
"description": "An encoding used to open and save files\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "An encoding used to open and save files\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "utf-8"
},
"eofnewline": {
"description": "Whether to add a missing trailing new line\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to add a missing trailing new line\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"fastdirty": {
"description": "Whether to use a fast algorithm to determine whether a file is changed\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to use a fast algorithm to determine whether a file is changed\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"fileformat": {
"description": "A line ending format\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A line ending format\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"enum": [
"unix",
@@ -129,53 +129,53 @@
"default": "unix"
},
"filetype": {
"description": "A filetype for the current buffer\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A filetype for the current buffer\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "unknown"
},
"hlsearch": {
"description": "Whether to highlight all instances of a searched text after a successful search\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to highlight all instances of a searched text after a successful search\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"incsearch": {
"description": "Whether to enable an incremental search in `Find` prompt\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to enable an incremental search in `Find` prompt\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"ignorecase": {
"description": "Whether to perform case-insensitive searches\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to perform case-insensitive searches\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"indentchar": {
"description": "An indentation character\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "An indentation character\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"maxLength": 1,
"default": " "
},
"infobar": {
"description": "Whether to enable a line at the bottom where messages are printed\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to enable a line at the bottom where messages are printed\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"keepautoindent": {
"description": "Whether add a whitespace while using autoindent\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether add a whitespace while using autoindent\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"keymenu": {
"description": "Whether to display nano-style key menu at the bottom\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to display nano-style key menu at the bottom\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"matchbrace": {
"description": "Whether to show matching braces\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to show matching braces\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"matchbracestyle": {
"description": "Whether to underline or highlight matching braces\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to underline or highlight matching braces\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"enum": [
"underline",
@@ -184,132 +184,132 @@
"default": "underline"
},
"mkparents": {
"description": "Whether to create missing directories\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to create missing directories\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"mouse": {
"description": "Whether to enable mouse support\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to enable mouse support\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"paste": {
"description": "Whether to treat characters sent from the terminal in a single chunk as a paste event\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to treat characters sent from the terminal in a single chunk as a paste event\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"parsecursor": {
"description": "Whether to extract a line number and a column to open files with from file names\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to extract a line number and a column to open files with from file names\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"permbackup": {
"description": "Whether to permanently save backups\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to permanently save backups\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"pluginchannels": {
"description": "A file with list of plugin channels\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A file with list of plugin channels\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "https://raw.githubusercontent.com/micro-editor/plugin-channel/master/channel.json"
},
"pluginrepos": {
"description": "Plugin repositories\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Plugin repositories\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "array",
"uniqueItems": true,
"items": {
"description": "A pluging repository\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A pluging repository\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string"
},
"default": []
},
"readonly": {
"description": "Whether to forbid buffer editing\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to forbid buffer editing\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"rmtrailingws": {
"description": "Whether to remove trailing whitespaces\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to remove trailing whitespaces\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"ruler": {
"description": "Whether to display line numbers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to display line numbers\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"relativeruler": {
"description": "Whether to display relative line numbers\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to display relative line numbers\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"savecursor": {
"description": "Whether to save cursor position in files\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to save cursor position in files\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"savehistory": {
"description": "Whether to save command history between closing and re-opening editor\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to save command history between closing and re-opening editor\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"saveundo": {
"description": "Whether to save undo after closing file\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to save undo after closing file\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"scrollbar": {
"description": "Whether to save undo after closing file\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to save undo after closing file\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"scrollmargin": {
"description": "A margin at which a view starts scrolling when a cursor approaches an edge of a view\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A margin at which a view starts scrolling when a cursor approaches an edge of a view\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
"default": 3
},
"scrollspeed": {
"description": "Line count to scroll for one scroll event\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Line count to scroll for one scroll event\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
"default": 2
},
"smartpaste": {
"description": "Whether to add a leading whitespace while pasting multiple lines\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to add a leading whitespace while pasting multiple lines\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"softwrap": {
"description": "Whether to wrap long lines\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to wrap long lines\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"splitbottom": {
"description": "Whether to create a new horizontal split below the current one\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to create a new horizontal split below the current one\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"splitright": {
"description": "Whether to create a new vertical split right of the current one\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to create a new vertical split right of the current one\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"statusformatl": {
"description": "Format string of left-justified part of the statusline\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Format string of left-justified part of the statusline\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "$(filename) $(modified)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)"
},
"statusformatr": {
"description": "Format string of right-justified part of the statusline\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Format string of right-justified part of the statusline\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help"
},
"statusline": {
"description": "Whether to display a status line\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to display a status line\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"sucmd": {
"description": "A super user command\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A super user command\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "string",
"default": "sudo",
"examples": [
@@ -318,47 +318,47 @@
]
},
"syntax": {
"description": "Whether to enable a syntax highlighting\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to enable a syntax highlighting\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"tabmovement": {
"description": "Whether to navigate spaces at the beginning of lines as if they are tabs\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to navigate spaces at the beginning of lines as if they are tabs\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"tabhighlight": {
"description": "Whether to invert tab character colors\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to invert tab character colors\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"tabreverse": {
"description": "Whether to reverse tab bar colors\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to reverse tab bar colors\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"tabsize": {
"description": "A tab size\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "A tab size\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "integer",
"default": 4
},
"tabstospaces": {
"description": "Whether to use spaces instead of tabs\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to use spaces instead of tabs\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"useprimary": {
"description": "Whether to use primary clipboard to copy selections in the background\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to use primary clipboard to copy selections in the background\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": true
},
"wordwrap": {
"description": "Whether to wrap long lines by words\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to wrap long lines by words\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
},
"xterm": {
"description": "Whether to assume that the current terminal is `xterm`\nhttps://github.com/zyedidia/micro/blob/master/runtime/help/options.md#options",
"description": "Whether to assume that the current terminal is `xterm`\nhttps://github.com/micro-editor/micro/blob/master/runtime/help/options.md#options",
"type": "boolean",
"default": false
}

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/zyedidia/micro/v2
module github.com/micro-editor/micro/v2
require (
github.com/blang/semver v3.5.1+incompatible

View File

@@ -11,14 +11,14 @@ import (
"time"
shellquote "github.com/kballard/go-shellquote"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/clipboard"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/clipboard"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
)
// ScrollUp is not an action

View File

@@ -5,7 +5,7 @@ package action
import (
"syscall"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/screen"
)
// Suspend sends micro to the background. This is the same as pressing CtrlZ in most unix programs.

View File

@@ -12,10 +12,10 @@ import (
"unicode"
"github.com/micro-editor/json5"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
var Binder = map[string]func(e Event, action string){

View File

@@ -6,14 +6,14 @@ import (
luar "layeh.com/gopher-luar"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
type BufAction any

View File

@@ -13,12 +13,12 @@ import (
"strings"
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/clipboard"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/clipboard"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/util"
)
// A Command contains information about how to execute a command
@@ -141,9 +141,11 @@ func (h *BufPane) TextFilterCmd(args []string) {
InfoBar.Error("usage: textfilter arguments")
return
}
for _, c := range h.Buf.GetCursors() {
sel := c.GetSelection()
if len(sel) == 0 {
fromSelection := len(sel) > 0
if !fromSelection {
c.SelectWord()
sel = c.GetSelection()
}
@@ -158,7 +160,18 @@ func (h *BufPane) TextFilterCmd(args []string) {
return
}
c.DeleteSelection()
h.Buf.Insert(c.Loc, bout.String())
insertStart := c.Loc
insertedText := bout.String()
h.Buf.Insert(c.Loc, insertedText)
if fromSelection {
// Select the pasted output if the input was selected
charCount := util.CharacterCountInString(insertedText)
insertEnd := insertStart.Move(charCount, h.Buf)
c.SetSelectionStart(insertStart)
c.SetSelectionEnd(insertEnd)
c.Loc = insertEnd
}
}
}
@@ -290,20 +303,8 @@ func (h *BufPane) PwdCmd(args []string) {
// OpenCmd opens a new buffer with a given filename
func (h *BufPane) OpenCmd(args []string) {
if len(args) > 0 {
filename := args[0]
// the filename might or might not be quoted, so unquote first then join the strings.
args, err := shellquote.Split(filename)
if err != nil {
InfoBar.Error("Error parsing args ", err)
return
}
if len(args) == 0 {
return
}
filename = strings.Join(args, " ")
open := func() {
b, err := buffer.NewBufferFromFile(filename, buffer.BTDefault)
b, err := buffer.NewBufferFromFile(args[0], buffer.BTDefault)
if err != nil {
InfoBar.Error(err)
return
@@ -447,7 +448,7 @@ func (h *BufPane) openHelp(page string, hsplit bool, forceSplit bool) error {
}
// HelpCmd tries to open the given help page according to the split type
// configured with the "helpsplit" option. It can be overriden by the optional
// configured with the "helpsplit" option. It can be overridden by the optional
// arguments "-vpslit" or "-hsplit". In case more than one help page is given
// as argument then it opens all of them with the defined split type.
func (h *BufPane) HelpCmd(args []string) {

View File

@@ -146,8 +146,8 @@ var infodefaults = map[string]string{
"Backtab": "CycleAutocompleteBack",
"Ctrl-z": "Undo",
"Ctrl-y": "Redo",
"Ctrl-c": "Copy|CopyLine",
"Ctrl-x": "Cut|CutLine",
"Ctrl-c": "Copy",
"Ctrl-x": "Cut",
"Ctrl-k": "CutLine",
"Ctrl-v": "Paste",
"Home": "StartOfTextToggle",

View File

@@ -149,8 +149,8 @@ var infodefaults = map[string]string{
"Backtab": "CycleAutocompleteBack",
"Ctrl-z": "Undo",
"Ctrl-y": "Redo",
"Ctrl-c": "Copy|CopyLine",
"Ctrl-x": "Cut|CutLine",
"Ctrl-c": "Copy",
"Ctrl-x": "Cut",
"Ctrl-k": "CutLine",
"Ctrl-v": "Paste",
"Home": "StartOfTextToggle",

View File

@@ -1,6 +1,6 @@
package action
import "github.com/zyedidia/micro/v2/internal/buffer"
import "github.com/micro-editor/micro/v2/internal/buffer"
// InfoBar is the global info bar.
var InfoBar *InfoPane

View File

@@ -5,10 +5,10 @@ import (
"sort"
"strings"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/micro/v2/pkg/highlight"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/pkg/highlight"
)
// This file is meant (for now) for autocompletion in command mode, not

View File

@@ -3,12 +3,12 @@ package action
import (
"bytes"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
"github.com/micro-editor/micro/v2/internal/info"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/info"
"github.com/zyedidia/micro/v2/internal/util"
)
type InfoKeyAction func(*InfoPane)

View File

@@ -1,7 +1,7 @@
package action
import (
"github.com/zyedidia/micro/v2/internal/display"
"github.com/micro-editor/micro/v2/internal/display"
)
// A Pane is a general interface for a window in the editor.

View File

@@ -4,9 +4,9 @@ import (
"fmt"
"reflect"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/display"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/display"
)
type RawPane struct {

View File

@@ -3,13 +3,13 @@ package action
import (
luar "layeh.com/gopher-luar"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/views"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/views"
)
// The TabList is a list of tabs and a window to display the tab bar

View File

@@ -4,7 +4,7 @@ package action
import (
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/shell"
)
// TermEmuSupported is a constant that marks if the terminal emulator is supported

View File

@@ -4,13 +4,13 @@ import (
"errors"
"runtime"
"github.com/micro-editor/micro/v2/internal/clipboard"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/display"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/tcell/v2"
"github.com/micro-editor/terminal"
"github.com/zyedidia/micro/v2/internal/clipboard"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
)
type TermKeyAction func(*TermPane)

View File

@@ -7,7 +7,7 @@ import (
"sort"
"strings"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/util"
)
// A Completer is a function that takes a buffer and returns info

View File

@@ -7,9 +7,9 @@ import (
"os"
"path/filepath"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
)
const BackupMsg = `A backup was detected for:

View File

@@ -17,12 +17,12 @@ import (
luar "layeh.com/gopher-luar"
"github.com/micro-editor/micro/v2/internal/config"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/pkg/highlight"
dmp "github.com/sergi/go-diff/diffmatchpatch"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/micro/v2/pkg/highlight"
"golang.org/x/text/encoding"
"golang.org/x/text/encoding/htmlindex"
"golang.org/x/text/encoding/unicode"

View File

@@ -5,11 +5,11 @@ import (
"strings"
"testing"
"github.com/micro-editor/micro/v2/internal/config"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/stretchr/testify/assert"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/util"
)
type operation struct {

View File

@@ -1,8 +1,8 @@
package buffer
import (
"github.com/zyedidia/micro/v2/internal/clipboard"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/clipboard"
"github.com/micro-editor/micro/v2/internal/util"
)
// InBounds returns whether the given location is a valid character position in the given buffer

View File

@@ -4,11 +4,11 @@ import (
"bytes"
"time"
"github.com/micro-editor/micro/v2/internal/config"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
dmp "github.com/sergi/go-diff/diffmatchpatch"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
luar "layeh.com/gopher-luar"
)

View File

@@ -6,8 +6,8 @@ import (
"io"
"sync"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/micro/v2/pkg/highlight"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/pkg/highlight"
)
// Finds the byte index of the nth rune in a byte slice

View File

@@ -1,7 +1,7 @@
package buffer
import (
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/util"
)
// Loc stores a location
@@ -9,7 +9,7 @@ type Loc struct {
X, Y int
}
// LessThan returns true if b is smaller
// LessThan returns true if l is smaller than b
func (l Loc) LessThan(b Loc) bool {
if l.Y < b.Y {
return true
@@ -17,7 +17,7 @@ func (l Loc) LessThan(b Loc) bool {
return l.Y == b.Y && l.X < b.X
}
// GreaterThan returns true if b is bigger
// GreaterThan returns true if l is bigger than b
func (l Loc) GreaterThan(b Loc) bool {
if l.Y > b.Y {
return true
@@ -25,7 +25,7 @@ func (l Loc) GreaterThan(b Loc) bool {
return l.Y == b.Y && l.X > b.X
}
// GreaterEqual returns true if b is greater than or equal to b
// GreaterEqual returns true if l is greater than or equal to b
func (l Loc) GreaterEqual(b Loc) bool {
if l.Y > b.Y {
return true
@@ -36,7 +36,7 @@ func (l Loc) GreaterEqual(b Loc) bool {
return l == b
}
// LessEqual returns true if b is less than or equal to b
// LessEqual returns true if l is less than or equal to b
func (l Loc) LessEqual(b Loc) bool {
if l.Y < b.Y {
return true
@@ -113,14 +113,13 @@ func (l Loc) left(buf *LineArray) Loc {
// MoveLA moves the cursor n characters to the left or right
// It moves the cursor left if n is negative
func (l Loc) MoveLA(n int, buf *LineArray) Loc {
if n > 0 {
for i := 0; i < n; i++ {
l = l.right(buf)
}
return l
for n > 0 {
l = l.right(buf)
n--
}
for i := 0; i < util.Abs(n); i++ {
for n < 0 {
l = l.left(buf)
n++
}
return l
}

View File

@@ -1,8 +1,8 @@
package buffer
import (
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/config"
)
type MsgType int

View File

@@ -14,9 +14,9 @@ import (
"time"
"unicode"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"golang.org/x/text/transform"
)

View File

@@ -4,7 +4,7 @@ import (
"regexp"
"unicode/utf8"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/util"
)
// We want "^" and "$" to match only the beginning/end of a line, not the

View File

@@ -8,8 +8,8 @@ import (
"path/filepath"
"time"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/util"
)
// The SerializedBuffer holds the types that get serialized when a buffer is saved
@@ -29,12 +29,16 @@ func (b *Buffer) Serialize() error {
return nil
}
buffer := SerializedBuffer{
Cursor: b.GetActiveCursor().Loc,
ModTime: b.ModTime,
}
if b.Settings["saveundo"].(bool) {
buffer.EventHandler = b.EventHandler
}
var buf bytes.Buffer
err := gob.NewEncoder(&buf).Encode(SerializedBuffer{
b.EventHandler,
b.GetActiveCursor().Loc,
b.ModTime,
})
err := gob.NewEncoder(&buf).Encode(buffer)
if err != nil {
return err
}
@@ -76,7 +80,7 @@ func (b *Buffer) Unserialize() error {
b.StartCursor = buffer.Cursor
}
if b.Settings["saveundo"].(bool) {
if b.Settings["saveundo"].(bool) && buffer.EventHandler != nil {
// We should only use last time's eventhandler if the file wasn't modified by someone else in the meantime
if b.ModTime == buffer.ModTime {
b.EventHandler = buffer.EventHandler

View File

@@ -4,9 +4,9 @@ import (
"crypto/md5"
"reflect"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/config"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"golang.org/x/text/encoding/htmlindex"
"golang.org/x/text/encoding/unicode"
luar "layeh.com/gopher-luar"

View File

@@ -4,8 +4,8 @@ import (
"errors"
"time"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/screen"
)
type terminalClipboard struct{}

View File

@@ -4,8 +4,8 @@ import (
"errors"
"log"
ulua "github.com/micro-editor/micro/v2/internal/lua"
lua "github.com/yuin/gopher-lua"
ulua "github.com/zyedidia/micro/v2/internal/lua"
)
// ErrNoSuchFunction is returned when Call is executed on a function that does not exist

View File

@@ -14,9 +14,9 @@ import (
"github.com/blang/semver"
"github.com/micro-editor/json5"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/util"
lua "github.com/yuin/gopher-lua"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/util"
)
var (

View File

@@ -8,7 +8,7 @@ import (
"regexp"
"strings"
rt "github.com/zyedidia/micro/v2/runtime"
rt "github.com/micro-editor/micro/v2/runtime"
)
const (

View File

@@ -12,8 +12,8 @@ import (
"strings"
"github.com/micro-editor/json5"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/zyedidia/glob"
"github.com/zyedidia/micro/v2/internal/util"
"golang.org/x/text/encoding/htmlindex"
)
@@ -115,7 +115,7 @@ var DefaultGlobalOnlySettings = map[string]any{
"colorscheme": "default",
"divchars": "|-",
"divreverse": true,
"fakecursor": false,
"fakecursor": defaultFakeCursor(),
"helpsplit": "hsplit",
"infobar": true,
"keymenu": false,
@@ -186,11 +186,19 @@ func validateParsedSettings() error {
}
}
} else {
if _, e := glob.Compile(k); e != nil {
err = errors.New("Error with glob setting " + k + ": " + e.Error())
tk := strings.TrimPrefix(k, "glob:")
if _, e := glob.Compile(tk); e != nil {
err = errors.New("Error with glob setting " + tk + ": " + e.Error())
delete(parsedSettings, k)
continue
}
if !strings.HasPrefix(k, "glob:") {
// Support non-prefixed glob settings but internally convert
// them to prefixed ones for simplicity.
delete(parsedSettings, k)
k = "glob:" + k
parsedSettings[k] = v
}
for k1, v1 := range v.(map[string]any) {
if _, ok := defaults[k1]; ok {
if e := verifySetting(k1, v1, defaults[k1]); e != nil {
@@ -256,6 +264,9 @@ func ReadSettings() error {
func ParsedSettings() map[string]any {
s := make(map[string]any)
for k, v := range parsedSettings {
if strings.HasPrefix(reflect.TypeOf(v).String(), "map") {
continue
}
s[k] = v
}
return s
@@ -309,8 +320,9 @@ func InitGlobalSettings() error {
// Must be called after ReadSettings
func UpdatePathGlobLocals(settings map[string]any, path string) {
for k, v := range parsedSettings {
if strings.HasPrefix(reflect.TypeOf(v).String(), "map") && !strings.HasPrefix(k, "ft:") {
g, _ := glob.Compile(k)
if strings.HasPrefix(reflect.TypeOf(v).String(), "map") && strings.HasPrefix(k, "glob:") {
tk := strings.TrimPrefix(k, "glob:")
g, _ := glob.Compile(tk)
if g.MatchString(path) {
for k1, v1 := range v.(map[string]any) {
settings[k1] = v1
@@ -441,6 +453,15 @@ func defaultFileFormat() string {
return "unix"
}
func defaultFakeCursor() bool {
_, wt := os.LookupEnv("WT_SESSION")
if runtime.GOOS == "windows" && !wt {
// enabled for windows consoles where the cursor is slow
return true
}
return false
}
func GetInfoBarOffset() int {
offset := 0
if GetGlobalOption("infobar").(bool) {

View File

@@ -5,11 +5,11 @@ import (
"strings"
runewidth "github.com/mattn/go-runewidth"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
// The BufWindow provides a way of displaying a certain section of a buffer.
@@ -79,7 +79,7 @@ func (w *BufWindow) GetView() *View {
return w.View
}
// GetView sets the view.
// SetView sets the view.
func (w *BufWindow) SetView(view *View) {
w.View = view
}

View File

@@ -2,12 +2,12 @@ package display
import (
runewidth "github.com/mattn/go-runewidth"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/info"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/info"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
type InfoWindow struct {

View File

@@ -2,8 +2,8 @@ package display
import (
runewidth "github.com/mattn/go-runewidth"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/util"
)
// SLoc represents a vertical scrolling location, i.e. a location of a visual line

View File

@@ -10,12 +10,12 @@ import (
luar "layeh.com/gopher-luar"
runewidth "github.com/mattn/go-runewidth"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
ulua "github.com/micro-editor/micro/v2/internal/lua"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
// StatusLine represents the information line at the bottom

View File

@@ -2,11 +2,11 @@ package display
import (
runewidth "github.com/mattn/go-runewidth"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
)
type TabWindow struct {

View File

@@ -1,13 +1,13 @@
package display
import (
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/shell"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/tcell/v2"
"github.com/micro-editor/terminal"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
)
type TermWindow struct {

View File

@@ -1,11 +1,11 @@
package display
import (
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/micro/v2/internal/views"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/views"
)
type UIWindow struct {

View File

@@ -1,7 +1,7 @@
package display
import (
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/buffer"
)
type View struct {

View File

@@ -9,9 +9,9 @@ import (
"path/filepath"
"strings"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
)
// LoadHistory attempts to load user history from configDir/buffers/history

View File

@@ -3,7 +3,7 @@ package info
import (
"fmt"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/buffer"
)
// The InfoBuf displays messages and other info at the bottom of the screen.

View File

@@ -6,9 +6,8 @@ import (
"os"
"sync"
"github.com/micro-editor/micro/v2/internal/config"
"github.com/micro-editor/tcell/v2"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
)
// Screen is the tcell screen we use to draw to the terminal
@@ -90,7 +89,7 @@ func ShowFakeCursor(x, y int) {
}
func UseFake() bool {
return util.FakeCursor || config.GetGlobalOption("fakecursor").(bool)
return config.GetGlobalOption("fakecursor").(bool)
}
// ShowFakeCursorMulti is the same as ShowFakeCursor except it does not

View File

@@ -10,8 +10,8 @@ import (
"os/signal"
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/micro/v2/internal/util"
)
// ExecCommand executes a command using exec

View File

@@ -5,9 +5,9 @@ import (
"os/exec"
"strconv"
"github.com/micro-editor/micro/v2/internal/buffer"
"github.com/micro-editor/micro/v2/internal/screen"
"github.com/micro-editor/terminal"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/screen"
)
type TermType int

View File

@@ -38,9 +38,6 @@ var (
CompileDate = "Unknown"
// Debug logging
Debug = "OFF"
// FakeCursor is used to disable the terminal cursor and have micro
// draw its own (enabled for windows consoles where the cursor is slow)
FakeCursor = false
// Stdout is a buffer that is written to stdout when micro closes
Stdout *bytes.Buffer
@@ -93,10 +90,6 @@ func init() {
fmt.Println("Invalid version: ", Version, err)
}
_, wt := os.LookupEnv("WT_SESSION")
if runtime.GOOS == "windows" && !wt {
FakeCursor = true
}
Stdout = new(bytes.Buffer)
}

View File

@@ -413,7 +413,7 @@ func (n *Node) HSplit(bottom bool) uint64 {
if !n.IsLeaf() {
return 0
}
if n.Kind == STUndef {
if n.parent == nil {
n.Kind = STVert
}
if n.Kind == STVert {
@@ -429,13 +429,13 @@ func (n *Node) VSplit(right bool) uint64 {
if !n.IsLeaf() {
return 0
}
if n.Kind == STUndef {
if n.parent == nil {
n.Kind = STHoriz
}
if n.Kind == STVert {
return n.vVSplit(right)
if n.Kind == STHoriz {
return n.hVSplit(0, right)
}
return n.hVSplit(0, right)
return n.vVSplit(right)
}
// unsplits the child of a split
@@ -483,7 +483,20 @@ func (n *Node) Unsplit() bool {
// flattens the tree by removing unnecessary intermediate parents that have only one child
// and handles the side effect of it
func (n *Node) flatten() {
if n.parent == nil || len(n.children) != 1 {
if len(n.children) != 1 {
return
}
// Special case for root node
if n.parent == nil {
*n = *n.children[0]
n.parent = nil
for _, c := range n.children {
c.parent = n
}
if len(n.children) == 0 {
n.Kind = STUndef
}
return
}
@@ -531,11 +544,19 @@ func (n *Node) flatten() {
func (n *Node) String() string {
var strf func(n *Node, ident int) string
strf = func(n *Node, ident int) string {
marker := "|"
marker := ""
if n.Kind == STHoriz {
marker = "-"
} else if n.Kind == STVert {
marker = "|"
}
str := fmt.Sprint(strings.Repeat("\t", ident), marker, n.View, n.id)
var parentId uint64 = 0
if n.parent != nil {
parentId = n.parent.id
}
str := fmt.Sprint(strings.Repeat("\t", ident), marker, n.View, n.id, parentId)
if n.IsLeaf() {
str += "🍁"
}

View File

@@ -99,7 +99,7 @@ is supported for backward compatibility).
Micro's colorschemes are also extremely simple to create. The default ones can
be found
[here](https://github.com/zyedidia/micro/tree/master/runtime/colorschemes).
[here](https://github.com/micro-editor/micro/tree/master/runtime/colorschemes).
Custom colorschemes should be placed in the `~/.config/micro/colorschemes`
directory.

View File

@@ -699,8 +699,8 @@ are given below:
"Backtab": "CycleAutocompleteBack",
"Ctrl-z": "Undo",
"Ctrl-y": "Redo",
"Ctrl-c": "Copy|CopyLine",
"Ctrl-x": "Cut|CutLine",
"Ctrl-c": "Copy",
"Ctrl-x": "Cut",
"Ctrl-k": "CutLine",
"Ctrl-v": "Paste",
"Home": "StartOfTextToggle",

View File

@@ -133,6 +133,8 @@ Here are the available options:
* `fakecursor`: forces micro to render the cursor using terminal colors rather
than the actual terminal cursor. This is useful when the terminal's cursor is
slow or otherwise unavailable/undesirable to use.
Note: This option defaults to `true` in case `micro` is used in the legacy
Windows Console.
default value: `false`
@@ -400,6 +402,10 @@ Here are the available options:
instead.
- `itab`: tab characters before the first visible character in a line.
If this is not set, `tab` will be shown instead.
Only `tab` and `itab` can display multiple characters (if possible),
otherwise only the first character will be displayed.
An example of this option value could be `tab=>,space=.,itab=|>,ispace=|`
The color of the shown character is determined by the `indent-char`
@@ -476,9 +482,9 @@ Here are the available options:
default value: `4`
* `tabstospaces`: use spaces instead of tabs. Note: This option will be
overridden by [the `ftoptions` plugin](https://github.com/zyedidia/micro/blob/master/runtime/plugins/ftoptions/ftoptions.lua)
overridden by [the `ftoptions` plugin](https://github.com/micro-editor/micro/blob/master/runtime/plugins/ftoptions/ftoptions.lua)
for certain filetypes. To disable this behavior, add `"ftoptions": false` to
your config. See [issue #2213](https://github.com/zyedidia/micro/issues/2213)
your config. See [issue #2213](https://github.com/micro-editor/micro/issues/2213)
for more details.
default value: `false`
@@ -663,6 +669,21 @@ all files except Go files, and `tabsize` 4 for all files except Ruby files:
Or similarly you can match with globs:
```json
{
"glob:*.go": {
"tabstospaces": false
},
"glob:*.rb": {
"tabsize": 2
},
"tabstospaces": true,
"tabsize": 4
}
```
You can also omit the `glob:` prefix before globs:
```json
{
"*.go": {
@@ -675,3 +696,6 @@ Or similarly you can match with globs:
"tabsize": 4
}
```
But it is generally more recommended to use the `glob:` prefix, as it avoids
potential conflicts with option names.

View File

@@ -153,10 +153,10 @@ The packages and their contents are listed below (in Go type signatures):
Relevant links:
[Time](https://pkg.go.dev/time#Duration)
[BufPane](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/action#BufPane)
[InfoPane](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/action#InfoPane)
[Tab](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/action#Tab)
[TabList](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/action#TabList)
[BufPane](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/action#BufPane)
[InfoPane](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/action#InfoPane)
[Tab](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/action#Tab)
[TabList](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/action#TabList)
* `micro/config`
- `MakeCommand(name string, action func(bp *BufPane, args[]string),
@@ -237,8 +237,8 @@ The packages and their contents are listed below (in Go type signatures):
- `ConfigDir`: the path to micro's currently active config directory.
Relevant links:
[Buffer](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/buffer#Buffer)
[buffer.Completer](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/buffer#Completer)
[Buffer](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/buffer#Buffer)
[buffer.Completer](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/buffer#Completer)
[Error](https://pkg.go.dev/builtin#error)
[filepath.Match](https://pkg.go.dev/path/filepath#Match)
@@ -304,7 +304,7 @@ The packages and their contents are listed below (in Go type signatures):
Relevant links:
[Cmd](https://pkg.go.dev/os/exec#Cmd)
[BufPane](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/action#BufPane)
[BufPane](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/action#BufPane)
[Error](https://pkg.go.dev/builtin#error)
* `micro/buffer`
@@ -345,10 +345,10 @@ The packages and their contents are listed below (in Go type signatures):
- `LogBuf() *Buffer`: returns the log buffer.
Relevant links:
[Message](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/buffer#Message)
[Loc](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/buffer#Loc)
[display.SLoc](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/display#SLoc)
[Buffer](https://pkg.go.dev/github.com/zyedidia/micro/v2/internal/buffer#Buffer)
[Message](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/buffer#Message)
[Loc](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/buffer#Loc)
[display.SLoc](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/display#SLoc)
[Buffer](https://pkg.go.dev/github.com/micro-editor/micro/v2/internal/buffer#Buffer)
[Error](https://pkg.go.dev/builtin#error)
* `micro/util`
@@ -376,7 +376,7 @@ returned by the functions have many methods. The Lua plugin may access any
public methods of an object returned by any of the functions above.
Unfortunately, it is not possible to list all the available functions on this
page. Please go to the internal documentation at
https://pkg.go.dev/github.com/zyedidia/micro/v2/internal to see the full list
https://pkg.go.dev/github.com/micro-editor/micro/v2/internal to see the full list
of available methods. Note that only methods of types that are available to
plugins via the functions above can be called from a plugin. For an even more
detailed reference, see the source code on Github.

87
runtime/syntax/b.yaml Normal file
View File

@@ -0,0 +1,87 @@
filetype: B
detect:
filename: '\.b$'
# core control words + storage classes (Thompson B-ish)
signature: '\b(if|else|while|switch|case|default|break|return|goto|extrn|auto)\b'
rules:
# -------------------------
# Comments (B: /* ... */)
# -------------------------
- comment:
start: '/\*'
end: '\*/'
rules: []
# Optional: // line comments (convenient, not “original” B)
- comment:
start: '//'
end: '$'
rules: []
# -------------------------
# Strings + escapes
# -------------------------
- constant.string:
start: '"'
end: '"'
skip: '\\\\.'
rules:
# common escapes: \n \t \e \r \0 \" \\ \( \) \*
- constant.specialChar: '\\\\([0netr"\\\\\\*\\(\\)])'
# printf-ish: %s %c %d %o and %%
- constant.specialChar: '%(%|[scdo])'
- constant.string:
start: "'"
end: "'"
skip: '\\\\.'
rules:
- constant.specialChar: '\\\\([0netr"\\\\\\*\\(\\)])'
- constant.specialChar: '%(%|[scdo])'
# -------------------------
# Numbers
# (leading 0 commonly used for octal constants)
# -------------------------
- constant.number: '\b0[0-7]+\b'
- constant.number: '\b[0-9]+\b'
# -------------------------
# Keywords / storage (keep tight + old-school)
# -------------------------
- statement: '\b(if|else|while|switch|case|default|break|return|goto)\b'
- type: '\b(extrn|auto)\b'
# -------------------------
# Common B library calls (/etc/libb.a era list)
# -------------------------
- constant.builtin: '\b(char|getchr|putchr|exit|printf|seek|setuid|stat|time|unlink|wait|lchar|chdir|chmod|chown|close|creat|execl|execv|fork|fstat|getuid|intr|link|makdir|open|read|write|ctime)\b'
# -------------------------
# Labels and function-ish identifiers
# -------------------------
# label (often at bol)
- identifier: '^\s*[_A-Za-z][_A-Za-z0-9]*\s*:'
# function call/def name before '('
- identifier: '\b[_A-Za-z][_A-Za-z0-9]*\s*\('
# -------------------------
# Operators (order matters: longer first)
# Thompson-ish assignment operators in B are =+, =-, =*, =/, =%, =<<, =>>, =& , =|
# -------------------------
- symbol.operator: '(=<<|=>>|=\+|=-|=\*|=/|=%|=&|=\|)'
- symbol.operator: '(==|!=|<=|>=|<<|>>)'
- symbol.operator: '(\+\+|--|\*\*)'
- symbol.operator: '[-+*/%&|^~!=<>?:=]'
# -------------------------
# Brackets
# -------------------------
- symbol.brackets: '[(){}\[\]]'
# -------------------------
# Identifiers / variables (last so keywords win)
# -------------------------
- identifier: '\b[_A-Za-z][_A-Za-z0-9]*\b'

View File

@@ -1,7 +1,7 @@
filetype: git-commit
detect:
filename: "^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG|MERGE_MSG)$"
filename: '^(.*[\\/])?(COMMIT_EDITMSG|TAG_EDITMSG|MERGE_MSG)$'
rules:
# File changes

View File

@@ -1,7 +1,7 @@
filetype: git-config
detect:
filename: "git(config|modules)$|\\.git/config$"
filename: 'git(config|modules)$|^(.*[\\/])?\.?git[\\/]config$'
rules:
- constant: "\\<(true|false)\\>"

View File

@@ -1,7 +1,7 @@
filetype: git-rebase-todo
detect:
filename: "^(.*[\\/])?git\\-rebase\\-todo$"
filename: '^(.*[\\/])?git\-rebase\-todo$'
rules:
# Rebase commands

69
runtime/syntax/gleam.yaml Normal file
View File

@@ -0,0 +1,69 @@
filetype: gleam
detect:
filename: "\\.gleam$"
rules:
- identifier: "\\b[a-z][a-z0-9_]*\\b"
- statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b"
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
- constant: "\\b(True|False|Nil)\\b"
- preproc: "@[a-z][a-z_]*"
- statement: "(\\|>|->|<-)"
- statement: "(\\.\\.|<>)"
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
- statement: "(&&|\\|\\|)"
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
- statement: "(=|<|>|!|<<|>>)"
- constant.number: "\\b0b[01](_?[01])*\\b"
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
- default:
start: "#\\("
end: "\\)"
limit-group: special
rules:
- identifier: "\\b[a-z][a-z0-9_]*\\b"
- statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b"
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
- constant: "\\b(True|False|Nil)\\b"
- statement: "(\\|>|->|<-)"
- statement: "(\\.\\.|<>)"
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
- statement: "(&&|\\|\\|)"
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
- statement: "(=|<|>|!|<<|>>)"
- constant.number: "\\b0b[01](_?[01])*\\b"
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
- constant.string:
start: '"'
end: '"'
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: '"'
end: '"'
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|FIXME|XXX):?"

View File

@@ -1,7 +1,7 @@
filetype: nginx
detect:
filename: "nginx.*\\.conf$|\\.nginx$"
filename: "nginx.*\\.conf$|\\.nginx$|\\.sub(domain|folder)\\.conf$"
header: "^(server|upstream)[a-z ]*\\{$"
rules:

View File

@@ -1,5 +1,5 @@
# References
# https://github.com/zyedidia/micro/blob/master/runtime/syntax/go.yaml
# https://github.com/micro-editor/micro/blob/master/runtime/syntax/go.yaml
# https://github.com/vim-scripts/octave.vim--/blob/master/syntax/octave.vim
#
# TODO

View File

@@ -1,7 +1,7 @@
filetype: ruby
detect:
filename: "\\.(rb|rake|gemspec)$|^(.*[\\/])?(Gemfile|config.ru|Rakefile|Capfile|Vagrantfile|Guardfile|Appfile|Fastfile|Pluginfile|Podfile|\\.?[Bb]rewfile)$"
filename: '\.(rb|rake|gemspec)$|^(.*[\\/])?(Gemfile|config\.ru|Rakefile|Capfile|Vagrantfile|Guardfile|Appfile|Fastfile|Pluginfile|Podfile|\.?[Bb]rewfile)$'
header: "^#!.*/(env +)?ruby( |$)"
rules:

View File

@@ -54,14 +54,6 @@ if ./tools/package-deb.sh $VERSION; then
fi
create_artefact_generic "linux64"
echo "Linux 64 fully static (same as linux64)"
# It is kept for the next release only to support...
# https://github.com/benweissmann/getmic.ro/blob/f90870e948afab8be9ec40884050044b59ed5b7c/index.sh#L197-L204
# ...and allow a fluent switch via:
# https://github.com/benweissmann/getmic.ro/pull/40
GOOS=linux GOARCH=amd64 make build
create_artefact_generic "linux64-static"
echo "Linux 32"
GOOS=linux GOARCH=386 make build
create_artefact_generic "linux32"

View File

@@ -13,7 +13,7 @@ import (
)
func main() {
resp, err := http.Get("https://api.github.com/repos/zyedidia/micro/releases")
resp, err := http.Get("https://api.github.com/repos/micro-editor/micro/releases")
if err != nil {
fmt.Println(err.Error())
return