mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 13:57:07 +09:00
Merge
This commit is contained in:
@@ -46,7 +46,7 @@ You can also check out the website for Micro at https://micro-editor.github.io.
|
||||
* Small and simple
|
||||
* Easily configurable
|
||||
* Macros
|
||||
* Common editor things such as undo/redo, line numbers, Unicode support...
|
||||
* Common editor things such as undo/redo, line numbers, Unicode support, softwrap...
|
||||
|
||||
Although not yet implemented, I hope to add more features such as autocompletion ([#174](https://github.com/zyedidia/micro/issues/174)), and multiple cursors ([#5](https://github.com/zyedidia/micro/issues/5)) in the future.
|
||||
|
||||
|
||||
@@ -168,6 +168,15 @@ func PluginCmd(args []string) {
|
||||
ToggleLog([]string{})
|
||||
}
|
||||
}
|
||||
case "available":
|
||||
packages := GetAllPluginPackages()
|
||||
messenger.AddLog("Available Plugins:")
|
||||
for _, pkg := range packages {
|
||||
messenger.AddLog(pkg.Name)
|
||||
}
|
||||
if CurView().Type != vtLog {
|
||||
ToggleLog([]string{})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
messenger.Error("Not enough arguments")
|
||||
@@ -179,6 +188,11 @@ func ToggleLog(args []string) {
|
||||
if CurView().Type != vtLog {
|
||||
CurView().HSplit(buffer)
|
||||
CurView().Type = vtLog
|
||||
RedrawAll()
|
||||
buffer.Cursor.Loc = buffer.Start()
|
||||
CurView().Relocate()
|
||||
buffer.Cursor.Loc = buffer.End()
|
||||
CurView().Relocate()
|
||||
} else {
|
||||
CurView().Quit(true)
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ func runtimeHelpColorsMd() (*asset, error) {
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _runtimeHelpCommandsMd = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x56\x4d\x8f\x1b\x37\x0f\xbe\xfb\x57\x10\xfb\x1e\x36\x79\xb1\x9e\xdc\x7d\x29\x8a\xa2\x40\x0b\x24\x45\x8a\xe4\xd2\x53\x45\xcf\x70\x66\x04\x6b\xc4\x89\x28\xd9\x71\x7f\x7d\x41\x51\xfe\xda\x3d\x34\xa7\xf5\x8a\x5f\x8f\x1e\x92\xcf\xe8\x7f\xf0\x99\x45\xfc\x3e\x10\xf4\xbc\x2c\x18\x07\xd9\x6c\xfe\xe2\x02\x3d\x46\xa0\xef\xd4\x97\x4c\xa0\x3f\x07\x9f\x39\x5d\x7c\x60\x7f\x86\x35\x91\x88\x8f\x13\xb8\x5f\x72\x0a\x5b\x72\x30\x72\x08\x7c\xa2\x6a\xcd\xf3\x35\x61\xb7\xf9\x8d\x12\x01\x26\xaa\xa7\xeb\xeb\x7a\x90\x67\xcc\x70\x6e\x35\x8b\x50\xb7\xd9\xfc\x1f\xdc\xb7\xe2\xb3\xdb\xc1\x9f\xc5\x67\x81\xc5\xf7\x89\xed\x5c\xf0\x48\x30\xfa\x40\x11\x17\xfa\xc9\xed\xe0\x0b\x1e\x49\xac\x60\x49\x89\x62\x86\x7d\x19\x47\x4a\x1d\xfc\x3e\xd6\xe3\x8b\x33\x78\x81\x35\xf1\xd1\x0f\x34\x80\xcf\x70\xf2\x21\x6c\x00\xe0\xb9\xa6\x44\x79\x7e\xf0\xb6\x6a\x89\xd6\x80\x3d\xc1\x93\x10\xa6\x7e\x7e\x82\xa7\x23\x86\x42\x4f\x30\x06\x9c\xc4\xed\xe0\xeb\xec\xa5\x66\x82\x8b\xab\x33\x57\x07\x27\x9f\x67\x70\xd5\xdf\x75\xa0\x95\xbe\xce\x04\xce\x22\x2b\x1f\xbc\x66\xcf\x11\x43\xa7\xc6\x9f\x33\x64\x4d\xb6\xb2\x8f\xf9\x45\xb1\xa4\x0a\x99\x63\x38\x03\x47\xaa\x25\x77\xe0\x7a\xf7\x02\xa7\xd9\xf7\x33\x50\xc4\x7d\x20\x01\xd7\xcf\xd4\x1f\x1c\x2c\x3c\x50\xad\x63\x66\x94\x83\x80\x1f\x95\xda\xe7\x01\x82\x3f\x10\x64\x86\x95\xd2\xc8\x69\xa9\x77\x6d\x90\x17\x25\x8d\xb0\x9f\x21\xfb\x7a\x71\x00\xf8\x83\x33\x59\x67\xae\xf7\x59\x8a\x64\xd8\x13\x20\x1c\x31\xf8\x01\x12\x4d\xf4\xbd\x03\xa5\x59\xe1\xb1\xb1\x8d\x69\x2a\x9a\x50\x34\xcb\xc0\x24\x10\x39\xc3\x5c\x29\x8e\x67\x90\x15\x7b\x12\xf0\x11\x7c\x7e\xa9\x5d\x5f\xf0\x0c\xbc\xf8\x5c\xa3\xbf\x15\xce\x24\xad\xd3\x94\x1b\x43\x60\x24\xee\x40\x28\x5b\xab\xdb\x79\x66\x33\x75\xf0\x85\x6c\xbc\x9c\x59\xc4\xc1\x4c\x61\x85\xcc\xab\xef\x15\xc9\xc8\x09\x10\x82\x97\xac\x40\x9b\xd3\x75\xea\x84\xf2\xb5\x66\xe0\x1e\xc3\x8f\x16\x86\xea\x1d\xce\xf0\xae\xb6\xc9\xc7\xfb\x41\xd4\xba\x36\x8b\xef\x5b\xf6\x99\x4f\x2d\x83\xe6\x9c\xf9\xf4\x38\xb8\x96\xb2\x11\x39\xf9\x23\xc5\xe6\x6d\xe1\x74\xc4\x00\x4f\xf4\xdd\x56\x8f\xe3\x93\xdb\xc1\xaf\x1a\x83\x99\x04\x10\x3e\x16\x84\x9b\xb5\xbb\xeb\x61\xdd\x1f\x1b\xd3\xc8\x15\xd7\x9a\x7c\xcc\xda\x91\x3c\xeb\x12\x0b\x57\x2e\x64\xe6\x12\x06\x5d\x42\x70\x0b\x89\x50\x9c\x28\xed\x3e\x91\x08\x4e\xf4\xae\xeb\xba\xf7\x4e\xaf\x3e\x78\x59\x03\x9e\x01\x35\x93\x35\xc0\xb6\xa5\x44\x90\x79\xdb\x36\xdb\xed\x20\x95\x28\x77\x97\x91\x99\x42\xb8\x8a\x48\x23\x6b\x8f\xfd\x61\x4a\x5c\xe2\xd0\xd5\x05\xd1\x9c\xcd\xe5\x59\x80\x4b\x5e\x8b\xed\xaa\xce\x5e\xab\x4c\x35\x5a\xa7\x2e\xf8\x48\x70\x9a\x49\xe7\x09\x46\x1f\xbd\xcc\x24\x5a\x37\xfa\x38\x19\xaa\xbd\x8f\x03\x1c\xe8\x0c\xd8\x37\xe6\xfb\x44\x8d\xb2\x03\x9d\xd5\xac\x14\x8c\x89\x97\xea\x96\xb9\x79\xde\xa6\x4a\xa8\xb7\x81\xe1\xa8\xf0\x6e\x51\x02\xb8\x67\x15\x24\x4e\xb0\xb0\x2e\x6c\x1c\x59\xcf\x14\xb3\x32\x7f\xa0\xb3\x80\xde\x16\x5b\x06\xdd\x7b\x3c\xa2\x0f\xba\xbb\x06\xf0\x28\x6b\xa8\xe8\x4d\x79\xdc\x0e\x78\x25\x75\x85\x23\xa5\xec\x75\x1c\xcd\xc3\x14\xe5\xea\x57\x15\x2e\xf2\xbd\xc0\x59\x6b\x4d\xe3\x5e\xde\x26\x50\x39\x59\x29\xd2\x60\xa9\x54\xd8\x97\x35\x9f\x2f\x8a\x59\xd1\xcc\x6f\xd0\x88\xe6\x46\xb9\x00\x75\xb0\x2f\xf9\x0a\x71\xe6\xe4\xff\xe1\x98\x6f\x35\xa2\x64\xc2\x01\x78\x54\x30\xaf\x21\x58\x8d\x8c\xfb\xb7\xd7\xbd\xcd\x89\x9a\xb4\xc1\x08\x91\x4e\x90\x71\x6f\x51\x81\xa7\x3b\x6e\x02\x4f\xba\x2a\x18\x02\x2c\x36\xa0\x46\xf4\x40\xfb\x32\x81\x64\xcc\x55\xd8\x9a\x98\xac\xa1\x4c\x2a\x3a\x51\xb2\x46\xd8\xbf\x7f\xb7\xfa\xed\xf4\x1e\x82\x39\x3c\xc4\x26\x5a\xb4\xd5\x8f\xa1\x76\xf8\x1f\x91\x2a\x3b\x6e\x57\xff\x48\x05\xdc\x0a\xd2\xd0\xbc\x1f\x41\x96\x75\xc0\xac\xc9\xed\xc7\x8f\x84\x98\x46\xbf\xc2\x66\x87\x24\x75\x3a\xdf\x02\x7c\x50\xf9\x8b\x12\x8e\xba\x2c\x37\xa1\xd4\xca\xd7\x69\xbd\x54\x06\xac\x12\x32\xf9\x3c\x97\x7d\xd7\xf3\xf2\xa1\xea\xcb\xd6\x1e\x09\x1f\xcc\x6b\xdb\xcf\x18\x23\x05\xfb\x9c\x5c\x9e\x14\x18\x84\x41\x88\x6e\xcb\x92\x16\xac\x8a\x6a\x3b\x53\x5f\x08\x76\xa5\x05\x23\x4e\x94\x34\xba\x29\x85\xfb\x6c\x96\x4f\x66\x71\x97\xb5\xbc\x28\x66\x23\xe3\x41\xfb\x2f\x9f\xf1\xc0\x58\x05\xa9\xfe\x30\x46\x53\x89\xfa\xbd\xab\xd3\xa6\x6c\x6e\xb7\xdb\xcd\x46\x15\xc8\x1e\x32\xaa\x09\xd7\x37\x8a\x6e\xed\xf5\xed\xd0\xde\x37\x03\x8d\x58\x42\xbe\xb0\xb2\xb3\x19\xf5\x51\x5b\xfd\x51\xd5\xf5\x5e\xda\xeb\x48\x6b\x1f\x28\x25\x4e\xd2\x6d\xfe\x0d\x00\x00\xff\xff\x82\x21\x32\x02\x7a\x09\x00\x00")
|
||||
var _runtimeHelpCommandsMd = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x56\x4d\x8f\xdb\x36\x13\xbe\xfb\x57\x0c\xf6\x3d\x6c\xf2\x62\xad\xdc\x7d\x29\x8a\xa2\x40\x0b\x24\x45\x8a\xe4\xd2\x53\x39\x96\x46\x12\x61\x8a\xa3\x70\x48\x3b\xee\xaf\x2f\x86\x43\x7f\xed\x1e\x9a\x93\x65\xce\xd7\x33\x5f\x0f\xf9\x3f\xf8\xcc\x22\x7e\x1f\x08\x7a\x5e\x16\x8c\x83\x6c\x36\x7f\x71\x81\x1e\x23\xd0\x77\xea\x4b\x26\xd0\xcf\xc1\x67\x4e\x17\x1d\xd8\x9f\x61\x4d\x24\xe2\xe3\x04\xee\x97\x9c\xc2\x96\x1c\x8c\x1c\x02\x9f\xa8\x4a\xf3\x7c\x75\xd8\x6d\x7e\xa3\x44\x80\x89\xea\xe9\xfa\x3a\x1e\xe4\x19\x33\x9c\x5b\xcc\x22\xd4\x6d\x36\xff\x07\xf7\xad\xf8\xec\x76\xf0\x67\xf1\x59\x60\xf1\x7d\x62\x3b\x17\x3c\x12\x8c\x3e\x50\xc4\x85\x7e\x72\x3b\xf8\x82\x47\x12\x0b\x58\x52\xa2\x98\x61\x5f\xc6\x91\x52\x07\xbf\x8f\xf5\xf8\xa2\x0c\x5e\x60\x4d\x7c\xf4\x03\x0d\xe0\x33\x9c\x7c\x08\x1b\x00\x78\xae\x2e\x51\x9e\x1f\xb4\x2d\x5a\xa2\x35\x60\x4f\xf0\x24\x84\xa9\x9f\x9f\xe0\xe9\x88\xa1\xd0\x13\x8c\x01\x27\x71\x3b\xf8\x3a\x7b\xa9\x9e\xe0\xa2\xea\x4c\xd5\xc1\xc9\xe7\x19\x5c\xd5\x77\x1d\x68\xa4\xaf\x33\x81\x33\xcb\x5a\x0f\x5e\xb3\xe7\x88\xa1\x53\xe1\xcf\x19\xb2\x3a\x5b\xd9\xc7\xfc\xa2\x58\x52\x85\xcc\x31\x9c\x81\x23\xd5\x90\x3b\x70\xbd\x7b\x81\xd3\xec\xfb\x19\x28\xe2\x3e\x90\x80\xeb\x67\xea\x0f\x0e\x16\x1e\xa8\xc6\x31\x31\xca\x41\xc0\x8f\x5a\xda\xe7\x01\x82\x3f\x10\x64\x86\x95\xd2\xc8\x69\xa9\xb9\x36\xc8\x8b\x16\x8d\xb0\x9f\x21\xfb\x9a\x38\x00\xfc\xc1\x99\xac\x33\xd7\x7c\x96\x22\x19\xf6\x04\x08\x47\x0c\x7e\x80\x44\x13\x7d\xef\x40\xcb\xac\xf0\xd8\xaa\x8d\x69\x2a\xea\x50\xd4\xcb\xc0\x24\x10\x39\xc3\x5c\x4b\x1c\xcf\x20\x2b\xf6\x24\xe0\x23\xf8\xfc\x52\xbb\xbe\xe0\x19\x78\xf1\xb9\x5a\x7f\x2b\x9c\x49\x5a\xa7\x29\xb7\x0a\x81\x15\x71\x07\x42\xd9\x5a\xdd\xce\x33\x9b\xa8\x83\x2f\x64\xe3\xe5\x4c\x22\x0e\x66\x0a\x2b\x64\x5e\x7d\xaf\x48\x46\x4e\x80\x10\xbc\x64\x05\xda\x94\xae\x53\x27\x94\xaf\x31\x03\xf7\x18\x7e\x34\x30\x54\xed\x70\x86\x77\xb5\x4d\x3e\xde\x0f\xa2\xc6\xb5\x59\x7c\xdf\xbc\xcf\x7c\x6a\x1e\xd4\xe7\xcc\xa7\xc7\xc1\x35\x97\xad\x90\x93\x3f\x52\x6c\xda\x66\x4e\x47\x0c\xf0\x44\xdf\x6d\xf5\x38\x3e\xb9\x1d\xfc\xaa\x36\x98\x49\x00\xe1\x63\x41\xb8\x49\xbb\xbb\x1e\xd6\xfd\xb1\x31\x8d\x5c\x71\xad\xc9\xc7\xac\x1d\xc9\xb3\x2e\xb1\x70\xad\x85\xcc\x5c\xc2\xa0\x4b\x08\x6e\x21\x11\x8a\x13\xa5\xdd\x27\x12\xc1\x89\xde\x75\x5d\xf7\xde\x69\xea\x83\x97\x35\xe0\x19\x50\x3d\x59\x03\x6c\x5b\x4a\x04\x99\xb7\x6d\xb3\xdd\x0e\x52\x89\x72\x97\x8c\xcc\x14\xc2\x95\x44\x5a\xb1\xf6\xd8\x1f\xa6\xc4\x25\x0e\x5d\x5d\x10\xf5\xd9\x54\x9e\x05\xb8\xe4\xb5\xd8\xae\xea\xec\xb5\xc8\x54\xad\x75\xea\x82\x8f\x04\xa7\x99\x74\x9e\x60\xf4\xd1\xcb\x4c\xa2\x71\xa3\x8f\x93\xa1\xda\xfb\x38\xc0\x81\xce\x80\x7d\xab\x7c\x9f\xa8\x95\xec\x40\x67\x15\x6b\x09\xc6\xc4\x4b\x55\xcb\xdc\x34\x6f\x53\x25\xd4\xdb\xc0\x70\x54\x78\x37\x2b\x01\xdc\xb3\x12\x12\x27\x58\x58\x17\x36\x8e\xac\x67\x8a\x59\x2b\x7f\xa0\xb3\x80\x66\x8b\xcd\x83\xee\x3d\x1e\xd1\x07\xdd\x5d\x03\x78\x94\x35\x54\xf4\xc6\x3c\x6e\x07\xbc\x92\xaa\xc2\x91\x52\xf6\x3a\x8e\xa6\x61\x8c\x72\xd5\xab\x0c\x17\xf9\x9e\xe0\xac\xb5\xc6\x71\x2f\x6f\x1d\x28\x9d\xac\x14\x69\x30\x57\x4a\xec\xcb\x9a\xcf\x17\xc6\xac\x68\xe6\x37\x68\x44\x7d\xa3\x5c\x80\x3a\xd8\x97\x7c\x85\x38\x73\xf2\xff\x70\xcc\xb7\x18\x51\x32\xe1\x00\x3c\x2a\x98\xd7\x10\x2c\x46\xc6\xfd\xdb\x74\x6f\x73\xa2\x22\x6d\x30\x42\xa4\x13\x64\xdc\x9b\x55\xe0\xe9\xae\x36\x81\x27\x5d\x15\x0c\x01\x16\x1b\x50\x2b\xf4\x40\xfb\x32\x81\x64\xcc\x95\xd8\x1a\x99\xac\xa1\x4c\x4a\x3a\x51\xb2\x5a\xd8\xdf\xbf\x5b\xfc\x76\x7a\x0f\xc1\x14\x1e\x6c\x13\x2d\xda\xea\x47\x53\x3b\xfc\x0f\x4b\xa5\x1d\xb7\xab\x3f\x52\x01\xb7\x80\x34\x34\xed\x47\x90\x65\x1d\x30\xab\x73\xfb\xf8\x11\x13\xe3\xe8\x57\xd8\xec\x90\xa4\x4e\xe7\x5b\x80\x0f\x2c\x7f\x61\xc2\x51\x97\xe5\x46\x94\x1a\xf9\x3a\xad\x97\xc8\x80\x95\x42\x26\x9f\xe7\xb2\xef\x7a\x5e\x3e\x54\x7e\xd9\xda\x23\xe1\x83\x69\x6d\xfb\x19\x63\xa4\x60\xd7\xc9\xe5\x49\x81\x41\x18\x84\xe8\xb6\x2c\x69\xc1\xca\xa8\xb6\x33\xf5\x85\x60\x29\x2d\x18\x71\xa2\xa4\xd6\x8d\x29\xdc\x67\x93\x7c\x32\x89\xbb\xac\xe5\x85\x31\x5b\x31\x1e\xb8\xff\xa1\x4a\xd7\x4c\x5a\x33\x6e\x09\x5d\x53\xd4\x52\x0d\x7c\x8a\x81\x71\x80\x77\xf5\x42\xf6\xb1\x0f\x65\xa0\xba\x5b\x7a\x85\x5d\x8c\x8c\x59\xf1\x5c\xef\xc4\x90\x08\x87\xf3\xad\x4b\xef\x2f\xef\x07\x75\x54\xe7\x44\x3f\xac\x95\xa9\x44\xbd\x68\xeb\x98\x6b\x1b\xb7\xdb\xed\x66\xa3\xd4\x67\x2f\x28\x25\xa3\xeb\xe3\x48\xe9\xe2\xfa\x68\x69\x0f\xab\x81\x46\x2c\xe1\x8a\x7e\x67\xcb\xe1\xa3\xce\xd8\x47\xa5\xf5\xfb\x3b\xa5\xee\x92\x66\x45\x29\x71\x92\x6e\xf3\x6f\x00\x00\x00\xff\xff\x6f\xa3\x15\xbb\xf3\x09\x00\x00")
|
||||
|
||||
func runtimeHelpCommandsMdBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
||||
@@ -27,8 +27,7 @@ type View struct {
|
||||
Cursor *Cursor
|
||||
|
||||
// The topmost line, used for vertical scrolling
|
||||
Topline int
|
||||
Bottomline int
|
||||
Topline int
|
||||
// The leftmost column, used for horizontal scrolling
|
||||
leftCol int
|
||||
|
||||
@@ -292,7 +291,7 @@ func (v *View) GetSoftWrapLocation(vx, vy int) (int, int) {
|
||||
}
|
||||
|
||||
screenX, screenY := 0, v.Topline
|
||||
for lineN := v.Topline; lineN < v.Bottomline; lineN++ {
|
||||
for lineN := v.Topline; lineN < v.Bottomline(); lineN++ {
|
||||
line := v.Buf.Line(lineN)
|
||||
|
||||
colN := 0
|
||||
@@ -323,10 +322,41 @@ func (v *View) GetSoftWrapLocation(vx, vy int) (int, int) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
func (v *View) Bottomline() int {
|
||||
screenX, screenY := 0, 0
|
||||
numLines := 0
|
||||
for lineN := v.Topline; lineN < v.Topline+v.height; lineN++ {
|
||||
line := v.Buf.Line(lineN)
|
||||
|
||||
colN := 0
|
||||
for _, ch := range line {
|
||||
if screenX >= v.width-v.lineNumOffset {
|
||||
screenX = 0
|
||||
screenY++
|
||||
}
|
||||
|
||||
if ch == '\t' {
|
||||
screenX += int(v.Buf.Settings["tabsize"].(float64)) - 1
|
||||
}
|
||||
|
||||
screenX++
|
||||
colN++
|
||||
}
|
||||
screenX = 0
|
||||
screenY++
|
||||
numLines++
|
||||
|
||||
if screenY >= v.height {
|
||||
break
|
||||
}
|
||||
}
|
||||
return numLines + v.Topline
|
||||
}
|
||||
|
||||
// Relocate moves the view window so that the cursor is in view
|
||||
// This is useful if the user has scrolled far away, and then starts typing
|
||||
func (v *View) Relocate() bool {
|
||||
height := v.Bottomline - v.Topline
|
||||
height := v.Bottomline() - v.Topline
|
||||
ret := false
|
||||
cy := v.Cursor.Y
|
||||
scrollmargin := int(v.Buf.Settings["scrollmargin"].(float64))
|
||||
@@ -911,10 +941,6 @@ func (v *View) DisplayView() {
|
||||
}
|
||||
}
|
||||
}
|
||||
v.Bottomline = curLineN
|
||||
if !v.Buf.Settings["softwrap"].(bool) {
|
||||
v.Bottomline++
|
||||
}
|
||||
}
|
||||
|
||||
// DisplayCursor draws the current buffer's cursor to the screen
|
||||
|
||||
@@ -59,6 +59,9 @@ Here are the possible commands that you can use.
|
||||
You can also see more information about the plugin manager
|
||||
in the `Plugin Manager` section of the `plugins` help topic.
|
||||
|
||||
* `plugin available`: list plugins available for download (this includes
|
||||
any plugins that may be already installed).
|
||||
|
||||
* `reload`: reloads all runtime files.
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user