Skip to content

Commit 79ff917

Browse files
Merge branch 'master' into dev
2 parents 9f6de34 + 9b3f7ff commit 79ff917

37 files changed

+187
-121
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
test:
55
strategy:
66
matrix:
7-
go-version: [1.17.x, 1.23.x]
7+
go-version: [1.19.x, 1.23.x]
88
os: [ubuntu-latest, macos-latest, windows-latest]
99
runs-on: ${{ matrix.os }}
1010
steps:

LICENSE-THIRD-PARTY

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
430430

431431
github.com/gdamore/tcell/LICENSE
432432
================
433-
github.com/zyedidia/tcell/LICENSE (fork)
433+
github.com/micro-editor/tcell/LICENSE (fork)
434434
================
435435

436436

@@ -1048,7 +1048,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
10481048

10491049
github.com/flynn/json5/LICENSE
10501050
================
1051-
github.com/zyedidia/json5/LICENSE (fork)
1051+
github.com/micro-editor/json5/LICENSE (fork)
10521052
================
10531053

10541054
Decoder code based on package encoding/json from the Go language.
@@ -1108,7 +1108,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11081108

11091109
github.com/james4k/terminal/LICENSE
11101110
================
1111-
github.com/zyedidia/terminal/LICENSE (fork)
1111+
github.com/micro-editor/terminal/LICENSE (fork)
11121112
================
11131113

11141114
Copyright (C) 2013 James Gray

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Without these tools installed, micro will use an internal clipboard for copy and
191191

192192
If your operating system does not have a binary release, but does run Go, you can build from source.
193193

194-
Make sure that you have Go version 1.17 or greater and Go modules are enabled.
194+
Make sure that you have Go version 1.19 or greater and Go modules are enabled.
195195

196196
```
197197
git clone https://github.com/zyedidia/micro

cmd/micro/micro.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
"github.com/zyedidia/micro/v2/internal/screen"
2727
"github.com/zyedidia/micro/v2/internal/shell"
2828
"github.com/zyedidia/micro/v2/internal/util"
29-
"github.com/zyedidia/tcell/v2"
29+
"github.com/micro-editor/tcell/v2"
3030
)
3131

3232
var (

cmd/micro/micro_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/zyedidia/micro/v2/internal/buffer"
1313
"github.com/zyedidia/micro/v2/internal/config"
1414
"github.com/zyedidia/micro/v2/internal/screen"
15-
"github.com/zyedidia/tcell/v2"
15+
"github.com/micro-editor/tcell/v2"
1616
)
1717

1818
var tempDir string

go.mod

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ require (
55
github.com/dustin/go-humanize v1.0.0
66
github.com/go-errors/errors v1.0.1
77
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
8-
github.com/mattn/go-isatty v0.0.11
9-
github.com/mattn/go-runewidth v0.0.7
8+
github.com/mattn/go-isatty v0.0.20
9+
github.com/mattn/go-runewidth v0.0.16
10+
github.com/micro-editor/json5 v1.0.1-micro
11+
github.com/micro-editor/tcell/v2 v2.0.11
12+
github.com/micro-editor/terminal v0.0.0-20250105114944-ffd0fc59e777
1013
github.com/mitchellh/go-homedir v1.1.0
1114
github.com/sergi/go-diff v1.1.0
1215
github.com/stretchr/testify v1.4.0
13-
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb
16+
github.com/yuin/gopher-lua v1.1.1
1417
github.com/zyedidia/clipper v0.1.1
1518
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3
16-
github.com/zyedidia/json5 v0.0.0-20200102012142-2da050b1a98d
17-
github.com/zyedidia/tcell/v2 v2.0.10
18-
github.com/zyedidia/terminal v0.0.0-20230315200948-4b3bcf6dddef
19-
golang.org/x/text v0.3.8
19+
golang.org/x/text v0.4.0
2020
gopkg.in/yaml.v2 v2.2.8
21-
layeh.com/gopher-luar v1.0.7
21+
layeh.com/gopher-luar v1.0.11
2222
)
2323

2424
require (
@@ -27,16 +27,13 @@ require (
2727
github.com/gdamore/encoding v1.0.0 // indirect
2828
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
2929
github.com/pmezard/go-difflib v1.0.0 // indirect
30-
github.com/rivo/uniseg v0.1.0 // indirect
31-
github.com/xo/terminfo v0.0.0-20200218205459-454e5b68f9e8 // indirect
30+
github.com/rivo/uniseg v0.2.0 // indirect
3231
github.com/zyedidia/poller v1.0.1 // indirect
33-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
32+
golang.org/x/sys v0.6.0 // indirect
3433
)
3534

36-
replace github.com/kballard/go-shellquote => github.com/zyedidia/go-shellquote v0.0.0-20200613203517-eccd813c0655
35+
replace github.com/kballard/go-shellquote => github.com/micro-editor/go-shellquote v0.0.0-20250101105543-feb6c39314f5
3736

38-
replace github.com/mattn/go-runewidth => github.com/zyedidia/go-runewidth v0.0.12
37+
replace layeh.com/gopher-luar v1.0.11 => github.com/layeh/gopher-luar v1.0.11
3938

40-
replace layeh.com/gopher-luar => github.com/layeh/gopher-luar v1.0.7
41-
42-
go 1.17
39+
go 1.19

go.sum

Lines changed: 26 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,76 +19,57 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
1919
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
2020
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
2121
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
22-
github.com/layeh/gopher-luar v1.0.7 h1:wnfZhYiJM748y1A4qYBfcFeMY9HWbdERny+ZL0f/jWc=
23-
github.com/layeh/gopher-luar v1.0.7/go.mod h1:TPnIVCZ2RJBndm7ohXyaqfhzjlZ+OA2SZR/YwL8tECk=
22+
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
23+
github.com/layeh/gopher-luar v1.0.11 h1:ss6t9OtykOiETBScJylSMPhuYAtOmpH5rSX10/wCcis=
24+
github.com/layeh/gopher-luar v1.0.11/go.mod h1:TPnIVCZ2RJBndm7ohXyaqfhzjlZ+OA2SZR/YwL8tECk=
2425
github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac=
2526
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
26-
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
27-
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
27+
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
28+
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
29+
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
30+
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
31+
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
32+
github.com/micro-editor/go-shellquote v0.0.0-20250101105543-feb6c39314f5 h1:D7BPnsedXiKo/e8RTFX419/52ICNhU8UKPQGZ/0yiLc=
33+
github.com/micro-editor/go-shellquote v0.0.0-20250101105543-feb6c39314f5/go.mod h1:zaPgW/fDiW4MUfEwxpC+GB/bhvX44NJaNHmRAC9auHQ=
34+
github.com/micro-editor/json5 v1.0.1-micro h1:5Y4MuzhkmW0sQQNPvrIVevIOKi557qsznwjRr4iq1AI=
35+
github.com/micro-editor/json5 v1.0.1-micro/go.mod h1:cmlPHZ1JKOXNse0/3zwwKj/GUpzAVkzx4lZDkpHl4q0=
36+
github.com/micro-editor/tcell/v2 v2.0.11 h1:USjdpBSmbocx2yPARbY19KcUSj+ZerScrdmBqGjzoX4=
37+
github.com/micro-editor/tcell/v2 v2.0.11/go.mod h1:kVYk6NOwYJrboL/7IA7cCupk4o2NzyF/0UMLjeEJN/s=
38+
github.com/micro-editor/terminal v0.0.0-20250105114944-ffd0fc59e777 h1:ddEDJwVqnxd8Yxtr6ZlUBBH3Kyf90jLHMJAbmU1bjuA=
39+
github.com/micro-editor/terminal v0.0.0-20250105114944-ffd0fc59e777/go.mod h1:soCc8JsxxfCZd3y08pX67F16Bni5L/xtcAnqEswzs44=
2840
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
2941
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
3042
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3143
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
32-
github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
33-
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
44+
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
45+
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
46+
github.com/robertkrimen/otto v0.2.1 h1:FVP0PJ0AHIjC+N4pKCG9yCDz6LHNPCwi/GKID5pGGF0=
3447
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
3548
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
3649
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
3750
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
3851
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
39-
github.com/xo/terminfo v0.0.0-20200218205459-454e5b68f9e8 h1:woqigIZtZUZxws1zZA99nAvuz2mQrxtWsuZSR9c8I/A=
4052
github.com/xo/terminfo v0.0.0-20200218205459-454e5b68f9e8/go.mod h1:6Yhx5ZJl5942QrNRWLwITArVT9okUXc5c3brgWJMoDc=
41-
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
4253
github.com/yuin/gopher-lua v0.0.0-20190206043414-8bfc7677f583/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
43-
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
44-
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
54+
github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
55+
github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
4556
github.com/zyedidia/clipper v0.1.1 h1:HBgguFNDq/QmSQKBnhy4sMKzILINr139VEgAhftOUTw=
4657
github.com/zyedidia/clipper v0.1.1/go.mod h1:7YApPNiiTZTXdKKZG92G50qj6mnWEX975Sdu65J7YpQ=
4758
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3 h1:oMHjjTLfGXVuyOQBYj5/td9WC0mw4g1xDBPovIqmHew=
4859
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3/go.mod h1:YKbIYP//Eln8eDgAJGI3IDvR3s4Tv9Z9TGIOumiyQ5c=
49-
github.com/zyedidia/go-runewidth v0.0.12 h1:aHWj8qL3aH7caRzoPBJXe1pEaZBXHpKtfTuiBo5p74Q=
50-
github.com/zyedidia/go-runewidth v0.0.12/go.mod h1:vF8djYdLmG8BJaUZ4CznFYCJ3pFR8m4B4VinTvTTarU=
51-
github.com/zyedidia/go-shellquote v0.0.0-20200613203517-eccd813c0655 h1:Z3RhH6hvcSx7eX6Q/pP6YVsgea/1eMDG99vtWwi3nK4=
52-
github.com/zyedidia/go-shellquote v0.0.0-20200613203517-eccd813c0655/go.mod h1:1sTqqO+kcYzZp43M5VsJe1tns9IzlSeC9jB6c2+o/5Y=
53-
github.com/zyedidia/json5 v0.0.0-20200102012142-2da050b1a98d h1:zmDMkh22zXOB7gz8jFaI4GpI7llsPgzm38/jG0UgxjE=
54-
github.com/zyedidia/json5 v0.0.0-20200102012142-2da050b1a98d/go.mod h1:NDJSTTYWivnza6zkRapeX2/LwhKPEMQ7bJxqgDVT78I=
5560
github.com/zyedidia/poller v1.0.1 h1:Tt9S3AxAjXwWGNiC2TUdRJkQDZSzCBNVQ4xXiQ7440s=
5661
github.com/zyedidia/poller v1.0.1/go.mod h1:vZXJOHGDcuK08GXhF6IAY0ZFd2WcgOR5DOTp84Uk5eE=
57-
github.com/zyedidia/tcell/v2 v2.0.10 h1:6fbbYAx/DYc9A//4jU1OeBrxtc9qJxYCZXCtGQbtTWU=
58-
github.com/zyedidia/tcell/v2 v2.0.10/go.mod h1:i4NNlquIQXFeNecrOgxDQQJdu+7LmTi3g62asvmwUws=
59-
github.com/zyedidia/terminal v0.0.0-20230315200948-4b3bcf6dddef h1:LeB4Qs0Tss4r/Qh8pfsTTqagDYHysfKJLYzAH3MVfu0=
60-
github.com/zyedidia/terminal v0.0.0-20230315200948-4b3bcf6dddef/go.mod h1:zeb8MJdcCObFKVvur3n2B4BANIPuo2Q8r4iiNs9Enx0=
61-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
62-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
63-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
64-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
65-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
66-
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
67-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
68-
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6962
golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
70-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
7163
golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
72-
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
73-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
74-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
75-
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
76-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
77-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
78-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
79-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
64+
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
65+
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8066
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
81-
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
82-
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
83-
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
84-
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
85-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
86-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
87-
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
88-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
67+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
68+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
8969
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
9070
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
9171
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
72+
gopkg.in/sourcemap.v1 v1.0.5 h1:inv58fC9f9J3TK2Y2R1NPntXEn3/wjWHkonhIUODNTI=
9273
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
9374
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
9475
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=

internal/action/actions.go

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/zyedidia/micro/v2/internal/screen"
1919
"github.com/zyedidia/micro/v2/internal/shell"
2020
"github.com/zyedidia/micro/v2/internal/util"
21-
"github.com/zyedidia/tcell/v2"
21+
"github.com/micro-editor/tcell/v2"
2222
)
2323

2424
// ScrollUp is not an action
@@ -46,6 +46,14 @@ func (h *BufPane) ScrollAdjust() {
4646
h.SetView(v)
4747
}
4848

49+
// ScrollReachedEnd returns true if the view is at the end of the buffer,
50+
// i.e. the last line of the buffer is in the view.
51+
func (h *BufPane) ScrollReachedEnd() bool {
52+
v := h.GetView()
53+
end := h.SLocFromLoc(h.Buf.End())
54+
return h.Diff(v.StartLine, end) < h.BufView().Height
55+
}
56+
4957
// MousePress is the event that should happen when a normal click happens
5058
// This is almost always bound to left click
5159
func (h *BufPane) MousePress(e *tcell.EventMouse) bool {
@@ -254,8 +262,13 @@ func (h *BufPane) CursorUp() bool {
254262

255263
// CursorDown moves the cursor down
256264
func (h *BufPane) CursorDown() bool {
265+
selectionEndNewline := h.Cursor.HasSelection() && h.Cursor.CurSelection[1].X == 0
257266
h.Cursor.Deselect(false)
258-
h.MoveCursorDown(1)
267+
if selectionEndNewline {
268+
h.Cursor.Start()
269+
} else {
270+
h.MoveCursorDown(1)
271+
}
259272
h.Relocate()
260273
return true
261274
}
@@ -289,7 +302,6 @@ func (h *BufPane) CursorLeft() bool {
289302
func (h *BufPane) CursorRight() bool {
290303
if h.Cursor.HasSelection() {
291304
h.Cursor.Deselect(false)
292-
h.Cursor.Right()
293305
} else {
294306
tabstospaces := h.Buf.Settings["tabstospaces"].(bool)
295307
tabmovement := h.Buf.Settings["tabmovement"].(bool)
@@ -1198,6 +1210,14 @@ func (h *BufPane) FindNext() bool {
11981210
match, found, err := h.Buf.FindNext(h.Buf.LastSearch, h.Buf.Start(), h.Buf.End(), searchLoc, true, h.Buf.LastSearchRegex)
11991211
if err != nil {
12001212
InfoBar.Error(err)
1213+
} else if found && searchLoc == match[0] && match[0] == match[1] {
1214+
// skip empty match at present cursor location
1215+
if searchLoc == h.Buf.End() {
1216+
searchLoc = h.Buf.Start()
1217+
} else {
1218+
searchLoc = searchLoc.Move(1, h.Buf)
1219+
}
1220+
match, found, _ = h.Buf.FindNext(h.Buf.LastSearch, h.Buf.Start(), h.Buf.End(), searchLoc, true, h.Buf.LastSearchRegex)
12011221
}
12021222
if found {
12031223
h.Cursor.SetSelectionStart(match[0])
@@ -1227,6 +1247,14 @@ func (h *BufPane) FindPrevious() bool {
12271247
match, found, err := h.Buf.FindNext(h.Buf.LastSearch, h.Buf.Start(), h.Buf.End(), searchLoc, false, h.Buf.LastSearchRegex)
12281248
if err != nil {
12291249
InfoBar.Error(err)
1250+
} else if found && searchLoc == match[0] && match[0] == match[1] {
1251+
// skip empty match at present cursor location
1252+
if searchLoc == h.Buf.Start() {
1253+
searchLoc = h.Buf.End()
1254+
} else {
1255+
searchLoc = searchLoc.Move(-1, h.Buf)
1256+
}
1257+
match, found, _ = h.Buf.FindNext(h.Buf.LastSearch, h.Buf.Start(), h.Buf.End(), searchLoc, false, h.Buf.LastSearchRegex)
12301258
}
12311259
if found {
12321260
h.Cursor.SetSelectionStart(match[0])
@@ -1728,7 +1756,7 @@ func (h *BufPane) SelectPageDown() bool {
17281756
}
17291757
h.MoveCursorDown(scrollAmount)
17301758
h.Cursor.SelectTo(h.Cursor.Loc)
1731-
if h.Cursor.Num == 0 {
1759+
if h.Cursor.Num == 0 && !h.ScrollReachedEnd() {
17321760
h.ScrollDown(scrollAmount)
17331761
h.ScrollAdjust()
17341762
}
@@ -1753,14 +1781,21 @@ func (h *BufPane) CursorPageUp() bool {
17531781
// CursorPageDown places the cursor a page down,
17541782
// moving the view to keep cursor at the same relative position in the view
17551783
func (h *BufPane) CursorPageDown() bool {
1784+
selectionEndNewline := h.Cursor.HasSelection() && h.Cursor.CurSelection[1].X == 0
17561785
h.Cursor.Deselect(false)
17571786
pageOverlap := int(h.Buf.Settings["pageoverlap"].(float64))
17581787
scrollAmount := h.BufView().Height - pageOverlap
1788+
if selectionEndNewline {
1789+
scrollAmount--
1790+
}
17591791
h.MoveCursorDown(scrollAmount)
1760-
if h.Cursor.Num == 0 {
1792+
if h.Cursor.Num == 0 && !h.ScrollReachedEnd() {
17611793
h.ScrollDown(scrollAmount)
17621794
h.ScrollAdjust()
17631795
}
1796+
if selectionEndNewline {
1797+
h.Cursor.Start()
1798+
}
17641799
h.Relocate()
17651800
return true
17661801
}
@@ -1896,6 +1931,13 @@ func (h *BufPane) ForceQuit() bool {
18961931
// Quit this will close the current tab or view that is open
18971932
func (h *BufPane) Quit() bool {
18981933
if h.Buf.Modified() {
1934+
for _, b := range buffer.OpenBuffers {
1935+
if b != h.Buf && b.SharedBuffer == h.Buf.SharedBuffer {
1936+
h.ForceQuit()
1937+
return true
1938+
}
1939+
}
1940+
18991941
if config.GlobalSettings["autosave"].(float64) > 0 {
19001942
// autosave on means we automatically save when quitting
19011943
h.SaveCB("Quit", func() {

internal/action/bindings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"strings"
1212
"unicode"
1313

14-
"github.com/zyedidia/json5"
14+
"github.com/micro-editor/json5"
1515
"github.com/zyedidia/micro/v2/internal/config"
1616
"github.com/zyedidia/micro/v2/internal/screen"
17-
"github.com/zyedidia/tcell/v2"
17+
"github.com/micro-editor/tcell/v2"
1818
)
1919

2020
var Binder = map[string]func(e Event, action string){

internal/action/bufpane.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
ulua "github.com/zyedidia/micro/v2/internal/lua"
1414
"github.com/zyedidia/micro/v2/internal/screen"
1515
"github.com/zyedidia/micro/v2/internal/util"
16-
"github.com/zyedidia/tcell/v2"
16+
"github.com/micro-editor/tcell/v2"
1717
)
1818

1919
type BufAction interface{}

0 commit comments

Comments
 (0)