mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-23 09:17:08 +09:00
@@ -566,6 +566,20 @@ func (h *BufPane) IndentSelection() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// IndentLine moves the current line forward one indentation
|
||||
func (h *BufPane) IndentLine() bool {
|
||||
if h.Cursor.HasSelection() {
|
||||
return false
|
||||
}
|
||||
|
||||
tabsize := int(h.Buf.Settings["tabsize"].(float64))
|
||||
indentstr := h.Buf.IndentString(tabsize)
|
||||
h.Buf.Insert(buffer.Loc{X: 0, Y: h.Cursor.Y}, indentstr)
|
||||
h.Buf.RelocateCursors()
|
||||
h.Relocate()
|
||||
return true
|
||||
}
|
||||
|
||||
// OutdentLine moves the current line back one indentation
|
||||
func (h *BufPane) OutdentLine() bool {
|
||||
if h.Cursor.HasSelection() {
|
||||
|
||||
@@ -559,6 +559,7 @@ var BufKeyActions = map[string]BufKeyAction{
|
||||
"Autocomplete": (*BufPane).Autocomplete,
|
||||
"CycleAutocompleteBack": (*BufPane).CycleAutocompleteBack,
|
||||
"OutdentLine": (*BufPane).OutdentLine,
|
||||
"IndentLine": (*BufPane).IndentLine,
|
||||
"Paste": (*BufPane).Paste,
|
||||
"PastePrimary": (*BufPane).PastePrimary,
|
||||
"SelectAll": (*BufPane).SelectAll,
|
||||
@@ -664,6 +665,7 @@ var MultiActions = map[string]bool{
|
||||
"IndentSelection": true,
|
||||
"OutdentSelection": true,
|
||||
"OutdentLine": true,
|
||||
"IndentLine": true,
|
||||
"Paste": true,
|
||||
"PastePrimary": true,
|
||||
"SelectPageUp": true,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -194,6 +194,8 @@ DuplicateLine
|
||||
DeleteLine
|
||||
IndentSelection
|
||||
OutdentSelection
|
||||
OutdentLine
|
||||
IndentLine
|
||||
Paste
|
||||
SelectAll
|
||||
OpenFile
|
||||
|
||||
@@ -66,12 +66,12 @@ the `misspell` linter which checks for misspelled words in a file.
|
||||
```lua
|
||||
local config = import("micro/config")
|
||||
|
||||
config.RegisterCommonOption("misspell", true)
|
||||
|
||||
function init()
|
||||
-- uses the default linter plugin
|
||||
-- matches any filetype
|
||||
linter.makeLinter("misspell", "", "misspell", {"%f"}, "%f:%l:%c: %m", {}, false, true, 0, 0, hasMisspell)
|
||||
|
||||
config.RegisterCommonOption("misspell", true)
|
||||
end
|
||||
|
||||
function hasMisspell(buf)
|
||||
|
||||
Reference in New Issue
Block a user