Compare commits

..

12 Commits

Author SHA1 Message Date
Zachary Yedidia
eff89a98a7 Fix v2 import path for go mod 2020-05-04 10:16:15 -04:00
Zachary Yedidia
221d8f462a Merge branch 'jwarner112-jwarner112-copyline' 2020-04-30 00:54:11 -04:00
Zachary Yedidia
7a23878250 gofmt 2020-04-30 00:54:02 -04:00
Jeff Warner
5d3e4fc3d9 Adds CopyLine action, the new default action for CtrlC if cursor has no selection 2020-04-29 21:06:54 -07:00
Indiana Kernick
f52fbfa1f0 Add .inl as a C++ file extension (#1630) 2020-04-29 20:01:59 -04:00
Zachary Yedidia
d60626c64b Merge 2020-04-25 17:01:20 -04:00
Zachary Yedidia
aaac0b1e6f Better actions error message 2020-04-25 17:01:16 -04:00
Some person
0f984131fb Update coffeescript.yaml (#1571)
* Update coffeescript.yaml

We need much much more modern coffeescript standards, the current one has broken `0x123456` (hex) and single quotes, and doesn't support multiline comments. This PR aims to fix that. I'm no regexp expert, I just based this off JS', so tell me if I did anything wrong.

* Update coffeescript.yaml
2020-04-22 23:12:56 -04:00
Zachary Yedidia
eb7189dcdb Make cursor follow selections
Fixes #1624
2020-04-21 09:33:21 -04:00
Zachary Yedidia
74523d28c5 Merge 2020-04-20 23:13:10 -04:00
Zachary Yedidia
f894f0a26e Update clipboard version 2020-04-20 23:13:01 -04:00
2pac
a067ce1f41 implemented circular tab movement (#1619)
Co-authored-by: 2pac <tarasyarema@pm.me>
2020-04-17 13:42:48 -04:00
53 changed files with 372 additions and 333 deletions

View File

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

View File

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

View File

@@ -6,14 +6,14 @@ import (
lua "github.com/yuin/gopher-lua"
luar "layeh.com/gopher-luar"
"github.com/zyedidia/micro/internal/action"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/display"
ulua "github.com/zyedidia/micro/internal/lua"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"github.com/zyedidia/micro/internal/util"
"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"
)
func init() {

View File

@@ -13,12 +13,12 @@ import (
"github.com/go-errors/errors"
isatty "github.com/mattn/go-isatty"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/internal/action"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"github.com/zyedidia/micro/internal/util"
"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"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/tcell"
)

4
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/zyedidia/micro
module github.com/zyedidia/micro/v2
require (
github.com/blang/semver v3.5.1+incompatible
@@ -12,7 +12,7 @@ require (
github.com/sergi/go-diff v1.1.0
github.com/stretchr/testify v1.4.0
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb
github.com/zyedidia/clipboard v0.0.0-20190823154308-241f98e9b197
github.com/zyedidia/clipboard v0.0.0-20200421031010-7c45b8673834
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3
github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5
github.com/zyedidia/json5 v0.0.0-20200102012142-2da050b1a98d

2
go.sum
View File

@@ -42,6 +42,8 @@ github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox
github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb/go.mod h1:gqRgreBUhTSL0GeU64rtZ3Uq3wtjOa/TB2YfrtkCbVQ=
github.com/zyedidia/clipboard v0.0.0-20190823154308-241f98e9b197 h1:gYTNnAW6azuB3BbA6QYWO/H4F2ABSOjjw3Z03tlXd2c=
github.com/zyedidia/clipboard v0.0.0-20190823154308-241f98e9b197/go.mod h1:WDk3p8GiZV9+xFWlSo8qreeoLhW6Ik692rqXk+cNeRY=
github.com/zyedidia/clipboard v0.0.0-20200421031010-7c45b8673834 h1:0nOfq3JwYRiY3+nwfWVQYEaXDmGCQgj3RKoqTifLzP4=
github.com/zyedidia/clipboard v0.0.0-20200421031010-7c45b8673834/go.mod h1:zykFnZUXX0ErxqvYLUFEq7QDJKId8rmh2FgD0/Y8cjA=
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3 h1:oMHjjTLfGXVuyOQBYj5/td9WC0mw4g1xDBPovIqmHew=
github.com/zyedidia/glob v0.0.0-20170209203856-dd4023a66dc3/go.mod h1:YKbIYP//Eln8eDgAJGI3IDvR3s4Tv9Z9TGIOumiyQ5c=
github.com/zyedidia/highlight v0.0.0-20170330143449-201131ce5cf5 h1:Zs6mpwXvlqpF9zHl5XaN0p5V4J9XvP+WBuiuXyIgqvc=

View File

@@ -9,11 +9,11 @@ import (
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/clipboard"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"github.com/zyedidia/micro/internal/util"
"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"
"github.com/zyedidia/tcell"
)
@@ -354,7 +354,6 @@ func (h *BufPane) SelectToStartOfTextToggle() bool {
return true
}
// SelectToStartOfLine selects to the start of the current line
func (h *BufPane) SelectToStartOfLine() bool {
if !h.Cursor.HasSelection() {
@@ -930,6 +929,25 @@ func (h *BufPane) Copy() bool {
return true
}
// Copy the current line to the clipboard
func (h *BufPane) CopyLine() bool {
if h.Cursor.HasSelection() {
return false
} else {
h.Cursor.SelectLine()
h.Cursor.CopySelection("clipboard")
h.freshClip = true
if clipboard.Unsupported {
InfoBar.Message("Copied line (install xclip for external clipboard)")
} else {
InfoBar.Message("Copied line")
}
}
h.Cursor.Deselect(true)
h.Relocate()
return true
}
// CutLine cuts the current line to the clipboard
func (h *BufPane) CutLine() bool {
h.Cursor.SelectLine()
@@ -1447,8 +1465,9 @@ func (h *BufPane) AddTab() bool {
// PreviousTab switches to the previous tab in the tab list
func (h *BufPane) PreviousTab() bool {
a := Tabs.Active()
Tabs.SetActive(util.Clamp(a-1, 0, len(Tabs.List)-1))
tabsLen := len(Tabs.List)
a := Tabs.Active() + tabsLen
Tabs.SetActive((a - 1) % tabsLen)
return true
}
@@ -1456,7 +1475,8 @@ func (h *BufPane) PreviousTab() bool {
// NextTab switches to the next tab in the tab list
func (h *BufPane) NextTab() bool {
a := Tabs.Active()
Tabs.SetActive(util.Clamp(a+1, 0, len(Tabs.List)-1))
Tabs.SetActive((a + 1) % len(Tabs.List))
return true
}

View File

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

View File

@@ -10,8 +10,8 @@ import (
"unicode"
"github.com/zyedidia/json5"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/tcell"
)

View File

@@ -7,11 +7,11 @@ import (
luar "layeh.com/gopher-luar"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/display"
ulua "github.com/zyedidia/micro/internal/lua"
"github.com/zyedidia/micro/internal/screen"
"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/tcell"
)
@@ -103,7 +103,7 @@ func BufMapKey(k Event, action string) {
afn = f
names = append(names, a)
} else {
screen.TermMessage("Error:", a, "does not exist")
screen.TermMessage("Error in bindings: action", a, "does not exist")
continue
}
actionfns = append(actionfns, afn)
@@ -517,112 +517,113 @@ func (h *BufPane) SetActive(b bool) {
// BufKeyActions contains the list of all possible key actions the bufhandler could execute
var BufKeyActions = map[string]BufKeyAction{
"CursorUp": (*BufPane).CursorUp,
"CursorDown": (*BufPane).CursorDown,
"CursorPageUp": (*BufPane).CursorPageUp,
"CursorPageDown": (*BufPane).CursorPageDown,
"CursorLeft": (*BufPane).CursorLeft,
"CursorRight": (*BufPane).CursorRight,
"CursorStart": (*BufPane).CursorStart,
"CursorEnd": (*BufPane).CursorEnd,
"SelectToStart": (*BufPane).SelectToStart,
"SelectToEnd": (*BufPane).SelectToEnd,
"SelectUp": (*BufPane).SelectUp,
"SelectDown": (*BufPane).SelectDown,
"SelectLeft": (*BufPane).SelectLeft,
"SelectRight": (*BufPane).SelectRight,
"WordRight": (*BufPane).WordRight,
"WordLeft": (*BufPane).WordLeft,
"SelectWordRight": (*BufPane).SelectWordRight,
"SelectWordLeft": (*BufPane).SelectWordLeft,
"DeleteWordRight": (*BufPane).DeleteWordRight,
"DeleteWordLeft": (*BufPane).DeleteWordLeft,
"SelectLine": (*BufPane).SelectLine,
"SelectToStartOfLine": (*BufPane).SelectToStartOfLine,
"SelectToStartOfText": (*BufPane).SelectToStartOfText,
"SelectToStartOfTextToggle":(*BufPane).SelectToStartOfTextToggle,
"SelectToEndOfLine": (*BufPane).SelectToEndOfLine,
"ParagraphPrevious": (*BufPane).ParagraphPrevious,
"ParagraphNext": (*BufPane).ParagraphNext,
"InsertNewline": (*BufPane).InsertNewline,
"Backspace": (*BufPane).Backspace,
"Delete": (*BufPane).Delete,
"InsertTab": (*BufPane).InsertTab,
"Save": (*BufPane).Save,
"SaveAll": (*BufPane).SaveAll,
"SaveAs": (*BufPane).SaveAs,
"Find": (*BufPane).Find,
"FindNext": (*BufPane).FindNext,
"FindPrevious": (*BufPane).FindPrevious,
"Center": (*BufPane).Center,
"Undo": (*BufPane).Undo,
"Redo": (*BufPane).Redo,
"Copy": (*BufPane).Copy,
"Cut": (*BufPane).Cut,
"CutLine": (*BufPane).CutLine,
"DuplicateLine": (*BufPane).DuplicateLine,
"DeleteLine": (*BufPane).DeleteLine,
"MoveLinesUp": (*BufPane).MoveLinesUp,
"MoveLinesDown": (*BufPane).MoveLinesDown,
"IndentSelection": (*BufPane).IndentSelection,
"OutdentSelection": (*BufPane).OutdentSelection,
"Autocomplete": (*BufPane).Autocomplete,
"CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack,
"OutdentLine": (*BufPane).OutdentLine,
"IndentLine": (*BufPane).IndentLine,
"Paste": (*BufPane).Paste,
"PastePrimary": (*BufPane).PastePrimary,
"SelectAll": (*BufPane).SelectAll,
"OpenFile": (*BufPane).OpenFile,
"Start": (*BufPane).Start,
"End": (*BufPane).End,
"PageUp": (*BufPane).PageUp,
"PageDown": (*BufPane).PageDown,
"SelectPageUp": (*BufPane).SelectPageUp,
"SelectPageDown": (*BufPane).SelectPageDown,
"HalfPageUp": (*BufPane).HalfPageUp,
"HalfPageDown": (*BufPane).HalfPageDown,
"StartOfText": (*BufPane).StartOfText,
"StartOfTextToggle": (*BufPane).StartOfTextToggle,
"StartOfLine": (*BufPane).StartOfLine,
"EndOfLine": (*BufPane).EndOfLine,
"ToggleHelp": (*BufPane).ToggleHelp,
"ToggleKeyMenu": (*BufPane).ToggleKeyMenu,
"ToggleDiffGutter": (*BufPane).ToggleDiffGutter,
"ToggleRuler": (*BufPane).ToggleRuler,
"ClearStatus": (*BufPane).ClearStatus,
"ShellMode": (*BufPane).ShellMode,
"CommandMode": (*BufPane).CommandMode,
"ToggleOverwriteMode": (*BufPane).ToggleOverwriteMode,
"Escape": (*BufPane).Escape,
"Quit": (*BufPane).Quit,
"QuitAll": (*BufPane).QuitAll,
"AddTab": (*BufPane).AddTab,
"PreviousTab": (*BufPane).PreviousTab,
"NextTab": (*BufPane).NextTab,
"NextSplit": (*BufPane).NextSplit,
"PreviousSplit": (*BufPane).PreviousSplit,
"Unsplit": (*BufPane).Unsplit,
"VSplit": (*BufPane).VSplitAction,
"HSplit": (*BufPane).HSplitAction,
"ToggleMacro": (*BufPane).ToggleMacro,
"PlayMacro": (*BufPane).PlayMacro,
"Suspend": (*BufPane).Suspend,
"ScrollUp": (*BufPane).ScrollUpAction,
"ScrollDown": (*BufPane).ScrollDownAction,
"SpawnMultiCursor": (*BufPane).SpawnMultiCursor,
"SpawnMultiCursorUp": (*BufPane).SpawnMultiCursorUp,
"SpawnMultiCursorDown": (*BufPane).SpawnMultiCursorDown,
"SpawnMultiCursorSelect": (*BufPane).SpawnMultiCursorSelect,
"RemoveMultiCursor": (*BufPane).RemoveMultiCursor,
"RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors,
"SkipMultiCursor": (*BufPane).SkipMultiCursor,
"JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace,
"JumpLine": (*BufPane).JumpLine,
"None": (*BufPane).None,
"CursorUp": (*BufPane).CursorUp,
"CursorDown": (*BufPane).CursorDown,
"CursorPageUp": (*BufPane).CursorPageUp,
"CursorPageDown": (*BufPane).CursorPageDown,
"CursorLeft": (*BufPane).CursorLeft,
"CursorRight": (*BufPane).CursorRight,
"CursorStart": (*BufPane).CursorStart,
"CursorEnd": (*BufPane).CursorEnd,
"SelectToStart": (*BufPane).SelectToStart,
"SelectToEnd": (*BufPane).SelectToEnd,
"SelectUp": (*BufPane).SelectUp,
"SelectDown": (*BufPane).SelectDown,
"SelectLeft": (*BufPane).SelectLeft,
"SelectRight": (*BufPane).SelectRight,
"WordRight": (*BufPane).WordRight,
"WordLeft": (*BufPane).WordLeft,
"SelectWordRight": (*BufPane).SelectWordRight,
"SelectWordLeft": (*BufPane).SelectWordLeft,
"DeleteWordRight": (*BufPane).DeleteWordRight,
"DeleteWordLeft": (*BufPane).DeleteWordLeft,
"SelectLine": (*BufPane).SelectLine,
"SelectToStartOfLine": (*BufPane).SelectToStartOfLine,
"SelectToStartOfText": (*BufPane).SelectToStartOfText,
"SelectToStartOfTextToggle": (*BufPane).SelectToStartOfTextToggle,
"SelectToEndOfLine": (*BufPane).SelectToEndOfLine,
"ParagraphPrevious": (*BufPane).ParagraphPrevious,
"ParagraphNext": (*BufPane).ParagraphNext,
"InsertNewline": (*BufPane).InsertNewline,
"Backspace": (*BufPane).Backspace,
"Delete": (*BufPane).Delete,
"InsertTab": (*BufPane).InsertTab,
"Save": (*BufPane).Save,
"SaveAll": (*BufPane).SaveAll,
"SaveAs": (*BufPane).SaveAs,
"Find": (*BufPane).Find,
"FindNext": (*BufPane).FindNext,
"FindPrevious": (*BufPane).FindPrevious,
"Center": (*BufPane).Center,
"Undo": (*BufPane).Undo,
"Redo": (*BufPane).Redo,
"Copy": (*BufPane).Copy,
"CopyLine": (*BufPane).CopyLine,
"Cut": (*BufPane).Cut,
"CutLine": (*BufPane).CutLine,
"DuplicateLine": (*BufPane).DuplicateLine,
"DeleteLine": (*BufPane).DeleteLine,
"MoveLinesUp": (*BufPane).MoveLinesUp,
"MoveLinesDown": (*BufPane).MoveLinesDown,
"IndentSelection": (*BufPane).IndentSelection,
"OutdentSelection": (*BufPane).OutdentSelection,
"Autocomplete": (*BufPane).Autocomplete,
"CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack,
"OutdentLine": (*BufPane).OutdentLine,
"IndentLine": (*BufPane).IndentLine,
"Paste": (*BufPane).Paste,
"PastePrimary": (*BufPane).PastePrimary,
"SelectAll": (*BufPane).SelectAll,
"OpenFile": (*BufPane).OpenFile,
"Start": (*BufPane).Start,
"End": (*BufPane).End,
"PageUp": (*BufPane).PageUp,
"PageDown": (*BufPane).PageDown,
"SelectPageUp": (*BufPane).SelectPageUp,
"SelectPageDown": (*BufPane).SelectPageDown,
"HalfPageUp": (*BufPane).HalfPageUp,
"HalfPageDown": (*BufPane).HalfPageDown,
"StartOfText": (*BufPane).StartOfText,
"StartOfTextToggle": (*BufPane).StartOfTextToggle,
"StartOfLine": (*BufPane).StartOfLine,
"EndOfLine": (*BufPane).EndOfLine,
"ToggleHelp": (*BufPane).ToggleHelp,
"ToggleKeyMenu": (*BufPane).ToggleKeyMenu,
"ToggleDiffGutter": (*BufPane).ToggleDiffGutter,
"ToggleRuler": (*BufPane).ToggleRuler,
"ClearStatus": (*BufPane).ClearStatus,
"ShellMode": (*BufPane).ShellMode,
"CommandMode": (*BufPane).CommandMode,
"ToggleOverwriteMode": (*BufPane).ToggleOverwriteMode,
"Escape": (*BufPane).Escape,
"Quit": (*BufPane).Quit,
"QuitAll": (*BufPane).QuitAll,
"AddTab": (*BufPane).AddTab,
"PreviousTab": (*BufPane).PreviousTab,
"NextTab": (*BufPane).NextTab,
"NextSplit": (*BufPane).NextSplit,
"PreviousSplit": (*BufPane).PreviousSplit,
"Unsplit": (*BufPane).Unsplit,
"VSplit": (*BufPane).VSplitAction,
"HSplit": (*BufPane).HSplitAction,
"ToggleMacro": (*BufPane).ToggleMacro,
"PlayMacro": (*BufPane).PlayMacro,
"Suspend": (*BufPane).Suspend,
"ScrollUp": (*BufPane).ScrollUpAction,
"ScrollDown": (*BufPane).ScrollDownAction,
"SpawnMultiCursor": (*BufPane).SpawnMultiCursor,
"SpawnMultiCursorUp": (*BufPane).SpawnMultiCursorUp,
"SpawnMultiCursorDown": (*BufPane).SpawnMultiCursorDown,
"SpawnMultiCursorSelect": (*BufPane).SpawnMultiCursorSelect,
"RemoveMultiCursor": (*BufPane).RemoveMultiCursor,
"RemoveAllMultiCursors": (*BufPane).RemoveAllMultiCursors,
"SkipMultiCursor": (*BufPane).SkipMultiCursor,
"JumpToMatchingBrace": (*BufPane).JumpToMatchingBrace,
"JumpLine": (*BufPane).JumpLine,
"None": (*BufPane).None,
// This was changed to InsertNewline but I don't want to break backwards compatibility
"InsertEnter": (*BufPane).InsertNewline,
"InsertEnter": (*BufPane).InsertNewline,
}
// BufMouseActions contains the list of all possible mouse actions the bufhandler could execute
@@ -669,6 +670,7 @@ var MultiActions = map[string]bool{
"InsertTab": true,
"FindNext": true,
"FindPrevious": true,
"CopyLine": true,
"Cut": true,
"CutLine": true,
"DuplicateLine": true,

View File

@@ -13,11 +13,11 @@ import (
"unicode/utf8"
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"github.com/zyedidia/micro/internal/util"
"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"
)
// A Command contains information about how to execute a command
@@ -761,6 +761,7 @@ func (h *BufPane) ReplaceCmd(args []string) {
h.Cursor.SetSelectionStart(locs[0])
h.Cursor.SetSelectionEnd(locs[1])
h.Cursor.GotoLoc(locs[0])
h.Relocate()

View File

@@ -43,7 +43,7 @@ func DefaultBindings() map[string]string {
"CtrlP": "FindPrevious",
"CtrlZ": "Undo",
"CtrlY": "Redo",
"CtrlC": "Copy",
"CtrlC": "CopyLine|Copy",
"CtrlX": "Cut",
"CtrlK": "CutLine",
"CtrlD": "DuplicateLine",

View File

@@ -45,7 +45,7 @@ func DefaultBindings() map[string]string {
"CtrlP": "FindPrevious",
"CtrlZ": "Undo",
"CtrlY": "Redo",
"CtrlC": "Copy",
"CtrlC": "CopyLine|Copy",
"CtrlX": "Cut",
"CtrlK": "CutLine",
"CtrlD": "DuplicateLine",

View File

@@ -1,6 +1,6 @@
package action
import "github.com/zyedidia/micro/internal/buffer"
import "github.com/zyedidia/micro/v2/internal/buffer"
var InfoBar *InfoPane
var LogBufPane *BufPane

View File

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

View File

@@ -4,10 +4,10 @@ import (
"bytes"
"strings"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/display"
"github.com/zyedidia/micro/internal/info"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/info"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/tcell"
)

View File

@@ -1,7 +1,7 @@
package action
import (
"github.com/zyedidia/micro/internal/display"
"github.com/zyedidia/micro/v2/internal/display"
)
type Pane interface {

View File

@@ -4,8 +4,8 @@ import (
"fmt"
"reflect"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/display"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/tcell"
)

View File

@@ -1,11 +1,11 @@
package action
import (
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/display"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/views"
"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/screen"
"github.com/zyedidia/micro/v2/internal/views"
"github.com/zyedidia/tcell"
)

View File

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

View File

@@ -5,9 +5,9 @@ import (
"runtime"
"github.com/zyedidia/clipboard"
"github.com/zyedidia/micro/internal/display"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"github.com/zyedidia/micro/v2/internal/display"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/shell"
"github.com/zyedidia/tcell"
"github.com/zyedidia/terminal"
)

View File

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

View File

@@ -7,9 +7,9 @@ import (
"path/filepath"
"time"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"golang.org/x/text/encoding"
)

View File

@@ -20,11 +20,11 @@ import (
luar "layeh.com/gopher-luar"
dmp "github.com/sergi/go-diff/diffmatchpatch"
"github.com/zyedidia/micro/internal/config"
ulua "github.com/zyedidia/micro/internal/lua"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/pkg/highlight"
"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/htmlindex"
"golang.org/x/text/encoding/unicode"
"golang.org/x/text/transform"

View File

@@ -16,7 +16,7 @@ func TestAuto1(t *testing.T) {
"",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{1, 0},
text: []string{
@@ -25,7 +25,7 @@ func TestAuto1(t *testing.T) {
"fq",
},
},
operation{
{
start: Loc{3, 0},
end: Loc{0, 1},
text: []string{
@@ -58,7 +58,7 @@ func TestAuto2(t *testing.T) {
"gmm",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{1, 0},
text: []string{
@@ -66,7 +66,7 @@ func TestAuto2(t *testing.T) {
"o",
},
},
operation{
{
start: Loc{3, 1},
end: Loc{3, 1},
text: []string{
@@ -74,7 +74,7 @@ func TestAuto2(t *testing.T) {
"avb",
},
},
operation{
{
start: Loc{4, 1},
end: Loc{1, 5},
text: []string{
@@ -111,7 +111,7 @@ func TestAuto3(t *testing.T) {
"xuccnb",
},
[]operation{
operation{
{
start: Loc{2, 3},
end: Loc{2, 3},
text: []string{
@@ -145,14 +145,14 @@ func TestAuto4(t *testing.T) {
"lnqdgorosf",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{4, 0},
text: []string{
"hp",
},
},
operation{
{
start: Loc{6, 0},
end: Loc{0, 1},
text: []string{
@@ -161,7 +161,7 @@ func TestAuto4(t *testing.T) {
"mpx",
},
},
operation{
{
start: Loc{1, 1},
end: Loc{1, 1},
text: []string{
@@ -170,7 +170,7 @@ func TestAuto4(t *testing.T) {
"",
},
},
operation{
{
start: Loc{1, 1},
end: Loc{1, 1},
text: []string{
@@ -178,7 +178,7 @@ func TestAuto4(t *testing.T) {
"mo",
},
},
operation{
{
start: Loc{1, 3},
end: Loc{2, 4},
text: []string{
@@ -210,14 +210,14 @@ func TestBug19872UndoIsFunky(t *testing.T) {
"something else",
},
[]operation{
operation{
{
start: Loc{0, 1},
end: Loc{1, 1},
text: []string{
"",
},
},
operation{
{
start: Loc{0, 2},
end: Loc{1, 3},
text: []string{
@@ -244,14 +244,14 @@ func TestBug19872UndoIsFunky_2(t *testing.T) {
"something else",
},
[]operation{
operation{
{
start: Loc{0, 1},
end: Loc{0, 1},
text: []string{
" ",
},
},
operation{
{
start: Loc{0, 2},
end: Loc{0, 2},
text: []string{
@@ -281,7 +281,7 @@ func TestInsertEmptyText(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -310,14 +310,14 @@ func TestLastOpIsNoOp(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
"",
},
},
operation{
{
start: Loc{0, 3},
end: Loc{0, 3},
text: []string{
@@ -346,7 +346,7 @@ func TestInsertTextWithoutNewline1(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -375,7 +375,7 @@ func TestInsertTextWithoutNewline2(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -404,7 +404,7 @@ func TestInsertOneNewline(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{3, 0},
end: Loc{3, 0},
text: []string{
@@ -435,7 +435,7 @@ func TestInsertTextWithOneNewline(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -466,7 +466,7 @@ func TestInsertTextWithTwoNewlines(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -499,7 +499,7 @@ func TestInsertTextWithManyNewlines(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -536,7 +536,7 @@ func TestInsertMultipleNewlines(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -547,7 +547,7 @@ func TestInsertMultipleNewlines(t *testing.T) {
"",
},
},
operation{
{
start: Loc{14, 2},
end: Loc{14, 2},
text: []string{
@@ -582,7 +582,7 @@ func TestDeleteEmptyText(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -611,7 +611,7 @@ func TestDeleteTextFromOneLine(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
@@ -640,7 +640,7 @@ func TestDeleteTextFromOneLine2(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{2, 0},
text: []string{
@@ -669,7 +669,7 @@ func TestDeleteAllTextFromALine(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{13, 0},
text: []string{
@@ -698,7 +698,7 @@ func TestDeleteTextFromTwoLines(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{3, 0},
end: Loc{5, 1},
text: []string{
@@ -726,7 +726,7 @@ func TestDeleteTextFromManyLines(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{3, 0},
end: Loc{4, 2},
text: []string{
@@ -753,7 +753,7 @@ func TestDeleteEverything(t *testing.T) {
"1",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 4},
text: []string{
@@ -778,14 +778,14 @@ func TestTwoUnrelatedEdits(t *testing.T) {
"123",
},
[]operation{
operation{
{
start: Loc{0, 1},
end: Loc{2, 1},
text: []string{
"\t",
},
},
operation{
{
start: Loc{0, 2},
end: Loc{4, 2},
text: []string{
@@ -814,14 +814,14 @@ func TestTwoEditsOnOneLine(t *testing.T) {
"\t\t<!@#fifth#@!>\t\t",
},
[]operation{
operation{
{
start: Loc{2, 4},
end: Loc{6, 4},
text: []string{
"",
},
},
operation{
{
start: Loc{11, 4},
end: Loc{15, 4},
text: []string{
@@ -846,21 +846,21 @@ func TestManyEdits(t *testing.T) {
"{\"x\" : 1}",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{1, 0},
text: []string{
"\n ",
},
},
operation{
{
start: Loc{4, 0},
end: Loc{5, 0},
text: []string{
"",
},
},
operation{
{
start: Loc{8, 0},
end: Loc{8, 0},
text: []string{
@@ -885,21 +885,21 @@ func TestManyEditsReversed(t *testing.T) {
"}",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{2, 1},
text: []string{
"",
},
},
operation{
{
start: Loc{5, 1},
end: Loc{5, 1},
text: []string{
" ",
},
},
operation{
{
start: Loc{8, 1},
end: Loc{0, 2},
text: []string{
@@ -924,7 +924,7 @@ func TestReplacingNewlines1(t *testing.T) {
"}",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{0, 1},
text: []string{
@@ -932,7 +932,7 @@ func TestReplacingNewlines1(t *testing.T) {
"\t",
},
},
operation{
{
start: Loc{10, 1},
end: Loc{0, 3},
text: []string{
@@ -962,7 +962,7 @@ func TestReplacingNewlines2(t *testing.T) {
"and the last line",
},
[]operation{
operation{
{
start: Loc{4, 0},
end: Loc{0, 2},
text: []string{
@@ -971,7 +971,7 @@ func TestReplacingNewlines2(t *testing.T) {
"some more text",
},
},
operation{
{
start: Loc{1, 2},
end: Loc{0, 3},
text: []string{
@@ -981,14 +981,14 @@ func TestReplacingNewlines2(t *testing.T) {
"asd",
},
},
operation{
{
start: Loc{0, 4},
end: Loc{5, 4},
text: []string{
"zzzzzzzz",
},
},
operation{
{
start: Loc{10, 4},
end: Loc{15, 5},
text: []string{
@@ -1024,14 +1024,14 @@ func TestAdvanced1(t *testing.T) {
" ,\"e\": /*comment*/ [null] }",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
"",
},
},
operation{
{
start: Loc{2, 0},
end: Loc{9, 0},
text: []string{
@@ -1039,7 +1039,7 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{15, 0},
end: Loc{13, 1},
text: []string{
@@ -1047,7 +1047,7 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{17, 1},
end: Loc{8, 2},
text: []string{
@@ -1055,14 +1055,14 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{21, 2},
end: Loc{8, 3},
text: []string{
"",
},
},
operation{
{
start: Loc{9, 3},
end: Loc{9, 3},
text: []string{
@@ -1070,7 +1070,7 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{27, 3},
end: Loc{27, 3},
text: []string{
@@ -1078,7 +1078,7 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{31, 3},
end: Loc{31, 3},
text: []string{
@@ -1086,7 +1086,7 @@ func TestAdvanced1(t *testing.T) {
" ",
},
},
operation{
{
start: Loc{32, 3},
end: Loc{33, 3},
text: []string{
@@ -1116,21 +1116,21 @@ func TestAdvancedSimplified(t *testing.T) {
" ,def",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{3, 0},
text: []string{
"",
},
},
operation{
{
start: Loc{6, 0},
end: Loc{1, 1},
text: []string{
"",
},
},
operation{
{
start: Loc{2, 1},
end: Loc{2, 1},
text: []string{
@@ -1158,7 +1158,7 @@ func TestIssue144(t *testing.T) {
"",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 5},
text: []string{
@@ -1194,7 +1194,7 @@ func TestIssue2586ReplacingSelectedEndOfLineWithNewlineLocksUpTheDocument(t *tes
"interesting",
},
[]operation{
operation{
{
start: Loc{9, 0},
end: Loc{0, 1},
text: []string{
@@ -1222,7 +1222,7 @@ func TestIssue3980(t *testing.T) {
"}",
},
[]operation{
operation{
{
start: Loc{7, 0},
end: Loc{8, 0},
text: []string{
@@ -1230,7 +1230,7 @@ func TestIssue3980(t *testing.T) {
"",
},
},
operation{
{
start: Loc{16, 2},
end: Loc{17, 2},
text: []string{
@@ -1238,14 +1238,14 @@ func TestIssue3980(t *testing.T) {
"",
},
},
operation{
{
start: Loc{17, 2},
end: Loc{17, 2},
text: []string{
" ",
},
},
operation{
{
start: Loc{4, 3},
end: Loc{4, 3},
text: []string{
@@ -1273,14 +1273,14 @@ func TestTouchingEditsTwoInsertsAtTheSamePosition(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
"a",
},
},
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -1301,14 +1301,14 @@ func TestTouchingEditsInsertAndReplaceTouching(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
"b",
},
},
operation{
{
start: Loc{0, 0},
end: Loc{2, 0},
text: []string{
@@ -1329,14 +1329,14 @@ func TestTouchingEditsTwoTouchingReplaces(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
"H",
},
},
operation{
{
start: Loc{1, 0},
end: Loc{2, 0},
text: []string{
@@ -1357,14 +1357,14 @@ func TestTouchingEditsTwoTouchingDeletes(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
"",
},
},
operation{
{
start: Loc{1, 0},
end: Loc{2, 0},
text: []string{
@@ -1385,14 +1385,14 @@ func TestTouchingEditsInsertAndReplace(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
"H",
},
},
operation{
{
start: Loc{0, 0},
end: Loc{2, 0},
text: []string{
@@ -1413,14 +1413,14 @@ func TestTouchingEditsReplaceAndInsert(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{2, 0},
text: []string{
"H",
},
},
operation{
{
start: Loc{2, 0},
end: Loc{2, 0},
text: []string{
@@ -1441,7 +1441,7 @@ func TestSingleDelete1(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{1, 0},
text: []string{
@@ -1462,7 +1462,7 @@ func TestSingleDelete2(t *testing.T) {
"helloworld",
},
[]operation{
operation{
{
start: Loc{2, 0},
end: Loc{7, 0},
text: []string{
@@ -1483,7 +1483,7 @@ func TestSingleDelete3(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{5, 0},
text: []string{
@@ -1504,7 +1504,7 @@ func TestSingleDelete4(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{6, 0},
text: []string{
@@ -1525,7 +1525,7 @@ func TestSingleDelete5(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{11, 0},
text: []string{
@@ -1548,7 +1548,7 @@ func TestMultiDelete6(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{5, 0},
end: Loc{5, 2},
text: []string{
@@ -1571,7 +1571,7 @@ func TestMultiDelete7(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{11, 0},
end: Loc{11, 2},
text: []string{
@@ -1594,7 +1594,7 @@ func TestMultiDelete8(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 2},
text: []string{
@@ -1617,7 +1617,7 @@ func TestMultiDelete9(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{11, 0},
end: Loc{0, 2},
text: []string{
@@ -1638,7 +1638,7 @@ func TestSingleInsert1(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -1659,7 +1659,7 @@ func TestSingleInsert2(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{1, 0},
end: Loc{1, 0},
text: []string{
@@ -1680,7 +1680,7 @@ func TestSingleInsert3(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{5, 0},
end: Loc{5, 0},
text: []string{
@@ -1701,7 +1701,7 @@ func TestSingleInsert4(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{6, 0},
end: Loc{6, 0},
text: []string{
@@ -1722,7 +1722,7 @@ func TestSingleInsert5(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{11, 0},
end: Loc{11, 0},
text: []string{
@@ -1743,7 +1743,7 @@ func TestMultiInsert6(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{0, 0},
end: Loc{0, 0},
text: []string{
@@ -1765,7 +1765,7 @@ func TestMultiInsert7(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{11, 0},
end: Loc{11, 0},
text: []string{
@@ -1787,7 +1787,7 @@ func TestMultiInsert8(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{6, 0},
end: Loc{6, 0},
text: []string{
@@ -1810,7 +1810,7 @@ func TestMultiInsert9(t *testing.T) {
"hello world",
},
[]operation{
operation{
{
start: Loc{6, 0},
end: Loc{6, 0},
text: []string{

View File

@@ -7,7 +7,7 @@ import (
testifyAssert "github.com/stretchr/testify/assert"
lua "github.com/yuin/gopher-lua"
ulua "github.com/zyedidia/micro/internal/lua"
ulua "github.com/zyedidia/micro/v2/internal/lua"
)
type operation struct {

View File

@@ -4,7 +4,7 @@ import (
"unicode/utf8"
"github.com/zyedidia/clipboard"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/util"
)
// InBounds returns whether the given location is a valid character position in the given buffer

View File

@@ -6,9 +6,9 @@ import (
"unicode/utf8"
dmp "github.com/sergi/go-diff/diffmatchpatch"
"github.com/zyedidia/micro/internal/config"
ulua "github.com/zyedidia/micro/internal/lua"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/v2/internal/config"
ulua "github.com/zyedidia/micro/v2/internal/lua"
"github.com/zyedidia/micro/v2/internal/screen"
luar "layeh.com/gopher-luar"
)

View File

@@ -7,7 +7,7 @@ import (
"sync"
"unicode/utf8"
"github.com/zyedidia/micro/pkg/highlight"
"github.com/zyedidia/micro/v2/pkg/highlight"
)
// Finds the byte index of the nth rune in a byte slice

View File

@@ -3,7 +3,7 @@ package buffer
import (
"unicode/utf8"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/util"
)
// Loc stores a location

View File

@@ -1,7 +1,7 @@
package buffer
import (
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/tcell"
)

View File

@@ -13,9 +13,9 @@ import (
"unicode"
"unicode/utf8"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/micro/v2/internal/util"
"golang.org/x/text/encoding"
"golang.org/x/text/encoding/htmlindex"
"golang.org/x/text/transform"

View File

@@ -4,7 +4,7 @@ import (
"regexp"
"unicode/utf8"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/util"
)
func (b *Buffer) findDown(r *regexp.Regexp, start, end Loc) ([2]Loc, bool) {

View File

@@ -10,8 +10,8 @@ import (
"golang.org/x/text/encoding"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
)
// The SerializedBuffer holds the types that get serialized when a buffer is saved

View File

@@ -1,8 +1,8 @@
package buffer
import (
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/screen"
)
func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {

View File

@@ -5,7 +5,7 @@ import (
"log"
lua "github.com/yuin/gopher-lua"
ulua "github.com/zyedidia/micro/internal/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

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

View File

@@ -12,7 +12,7 @@ import (
"github.com/zyedidia/glob"
"github.com/zyedidia/json5"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/util"
"golang.org/x/text/encoding/htmlindex"
)

View File

@@ -5,10 +5,10 @@ import (
"unicode/utf8"
runewidth "github.com/mattn/go-runewidth"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"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/tcell"
)
@@ -139,9 +139,6 @@ func (w *BufWindow) Relocate() bool {
ret := false
activeC := w.Buf.GetActiveCursor()
cy := activeC.Y
if activeC.HasSelection() {
cy = activeC.CurSelection[0].Y
}
scrollmargin := int(b.Settings["scrollmargin"].(float64))
if cy < w.StartLine+scrollmargin && cy > scrollmargin-1 {
w.StartLine = cy - scrollmargin

View File

@@ -4,11 +4,11 @@ import (
"unicode/utf8"
runewidth "github.com/mattn/go-runewidth"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/info"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"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"
"github.com/zyedidia/tcell"
)

View File

@@ -12,11 +12,11 @@ import (
runewidth "github.com/mattn/go-runewidth"
lua "github.com/yuin/gopher-lua"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
ulua "github.com/zyedidia/micro/internal/lua"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"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

@@ -4,10 +4,10 @@ import (
"unicode/utf8"
runewidth "github.com/mattn/go-runewidth"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/util"
"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

@@ -3,10 +3,10 @@ package display
import (
"unicode/utf8"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/shell"
"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/tcell"
"github.com/zyedidia/terminal"
)

View File

@@ -1,10 +1,10 @@
package display
import (
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/internal/views"
"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/views"
)
type UIWindow struct {

View File

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

View File

@@ -5,7 +5,7 @@ import (
"os"
"path/filepath"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/v2/internal/config"
)
// LoadHistory attempts to load user history from configDir/buffers/history

View File

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

View File

@@ -5,8 +5,8 @@ import (
"os"
"sync"
"github.com/zyedidia/micro/internal/config"
"github.com/zyedidia/micro/internal/util"
"github.com/zyedidia/micro/v2/internal/config"
"github.com/zyedidia/micro/v2/internal/util"
"github.com/zyedidia/tcell"
)

View File

@@ -11,7 +11,7 @@ import (
"strings"
shellquote "github.com/kballard/go-shellquote"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/v2/internal/screen"
)
// ExecCommand executes a command using exec

View File

@@ -5,8 +5,8 @@ import (
"os/exec"
"strconv"
"github.com/zyedidia/micro/internal/buffer"
"github.com/zyedidia/micro/internal/screen"
"github.com/zyedidia/micro/v2/internal/buffer"
"github.com/zyedidia/micro/v2/internal/screen"
"github.com/zyedidia/terminal"
)

View File

@@ -190,6 +190,7 @@ FindPrevious
Undo
Redo
Copy
CopyLine
Cut
CutLine
DuplicateLine
@@ -455,7 +456,7 @@ conventions for text editing defaults.
"CtrlP": "FindPrevious",
"CtrlZ": "Undo",
"CtrlY": "Redo",
"CtrlC": "Copy",
"CtrlC": "CopyLine|Copy",
"CtrlX": "Cut",
"CtrlK": "CutLine",
"CtrlD": "DuplicateLine",

View File

@@ -1,7 +1,7 @@
filetype: c++
detect:
filename: "\\.c(c|pp|xx)$|\\.h(h|pp|xx)$|\\.ii?$|\\.(def)$"
filename: "\\.c(c|pp|xx)$|\\.h(h|pp|xx)$|\\.inl$|\\.ii?$|\\.(def)$"
rules:
- identifier: "\\b[A-Z_][0-9A-Z_]+\\b"

View File

@@ -12,6 +12,9 @@ rules:
- statement: "\\b(debugger|switch|while|do|class|extends|super)\\b"
- statement: "\\b(undefined|then|unless|until|loop|of|by|when)\\b"
- constant.bool: "\\b(true|false|yes|no|on|off)\\b"
- constant.number: "\\b[-+]?([1-9][0-9]*|0[0-7]*|0x[0-9a-fA-F]+)([uU][lL]?|[lL][uU]?)?\\b"
- constant.number: "\\b[-+]?([0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)([EePp][+-]?[0-9]+)?[fFlL]?"
- constant.number: "\\b[-+]?([0-9]+[EePp][+-]?[0-9]+)[fFlL]?"
- identifier: "@[A-Za-z0-9_]*"
- constant.string:
@@ -20,10 +23,23 @@ rules:
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- constant.string:
start: "'"
end: "'"
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."
- comment:
start: "#"
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"
- comment:
start: "###"
end: "###"
rules:
- todo: "(TODO|XXX|FIXME)"