Commit graph

191 commits

Author SHA1 Message Date
Zachary Yedidia
d0b75bc09f Add simulation screen tests 2020-06-20 18:24:12 -04:00
Zachary Yedidia
bcc35c9f8c Fix backspace on Windows
Fixes #1735
2020-06-20 13:22:01 -04:00
Zachary Yedidia
f5dc0a51ba Fix issue with search and replace at the end of a range 2020-06-18 16:38:10 -04:00
Zachary Yedidia
a584ff36de Merge 2020-06-17 23:14:03 -04:00
Zachary Yedidia
f5405cee18 Improve keybinding label consistency
The old notation (for example `CtrlG`) causes confusion when combined
with new notation needed for alt (`Alt-g`) due to Alt being case
sensitive. Previously both formats were supported, but the documentation
and defaults used a combination. This commit only uses the new notation
for consistency.

Ref #1470
2020-06-17 23:11:50 -04:00
Zachary Yedidia
3516c8a9a6 Start replacement search at cursor location
Fixes #1731
2020-06-17 22:43:22 -04:00
Zachary Yedidia
efb38b8636 Merge branch 'settings-config'
With these changes, settings.json should only contain options that
have been modified from their default values. Micro will actively
options that are set to default values from the settings.json file.
To see a full list of settings and their defaults, see the "options"
documentation, as well as `micro -options`.
2020-06-09 16:34:37 -04:00
Zachary Yedidia
0654db334a Show key name in raw pane 2020-06-09 15:57:52 -04:00
Zachary Yedidia
660d345880 Don't apply cli options to settings.json 2020-06-08 22:19:15 -04:00
Zachary Yedidia
79ee757757 Only start autocompletion for alphanumerics
Ref #1712
2020-06-08 13:54:31 -04:00
Zachary Yedidia
140662f1ec Verify that all settings have correct type
This prevents crashes that occur when the user has put the wrong
type for a setting manually in the settings.json file.
2020-06-07 17:31:16 -04:00
Zachary Yedidia
44c1929f9d Fix mouse support in command bar 2020-06-07 15:46:12 -04:00
Zachary Yedidia
ffc922a7c5 Only perform save callback if save was successful
Fixes #1684
2020-05-29 15:02:38 -04:00
Zachary Yedidia
8bd7e5807c Always use current pane for keybinding actions
Fixes #1677
2020-05-29 14:38:29 -04:00
Andrew Clarke
9b59e07b47
Use "goto -1" to move cursor to end of document. (#1691) 2020-05-29 13:29:09 -04:00
Zachary Yedidia
79c0ea17ad Use CharacterCount over RuneCount 2020-05-20 16:47:08 -04:00
Zachary Yedidia
0a6720498f Merge branch 'master' of https://github.com/zyedidia/micro 2020-05-17 12:23:21 -04:00
Zachary Yedidia
c46257222c Add support for FindLiteral
Use the FindLiteral action to use Find without regex support.

Fixes #1661
2020-05-17 12:22:33 -04:00
Jeff Warner
d0f7ecf9ca
Adds command "tabmove ±n", for better tab management (#1636)
* Adds command "tabmove ±n", for better tab management

* Added tabmove to help:commands

* Replace uses of util.Min, util.Max with util.Clamp

Browsing code and discovered `util.Clamp`, ideal for this section of my code

* oops, missed an arg

* Typo, again
2020-05-14 21:51:49 -04:00
dmaluka
fb35e0312a
Fix unbind of a rune (#1649)
Fix problem with non-working unbind of a rune key.
E.g. after the following commands:

bind "n" "FindNext"
unbind "n"

Observed result: "n" key still triggers FindNext action
Expected result: "n" key inserts "n" rune
2020-05-14 21:50:28 -04:00
Zachary Yedidia
55e97596d3 Fix movelinesup when selection is not complete 2020-05-07 19:39:17 -04:00
Zachary Yedidia
eff89a98a7 Fix v2 import path for go mod 2020-05-04 10:16:15 -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
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
Zachary Yedidia
eb7189dcdb Make cursor follow selections
Fixes #1624
2020-04-21 09:33:21 -04:00
2pac
a067ce1f41
implemented circular tab movement (#1619)
Co-authored-by: 2pac <tarasyarema@pm.me>
2020-04-17 13:42:48 -04:00
Ján Jančár
f0da73bae2
Add StartOfTextToggle and SelectToStartOfTextToggle actions. (#1612)
These actions reintroduce the behavior of micro where the Home key
toggles between the start of text (first) and the start of the line.
The same applies for the variant with selection. This commit also
sets these bindings as the defaults.
2020-04-10 17:21:02 -04:00
Zachary Yedidia
d92deacf99 Ensure mouse release before focus change
Fixes #1613
2020-04-10 15:58:43 -04:00
Zachary Yedidia
60c8c81da3 Relocate during replace
Fixes #1587
2020-03-24 11:33:52 -04:00
Zachary Yedidia
c76a973877 Merge 2020-03-24 11:17:12 -04:00
Zachary Yedidia
6def99ce24 Clarify replace message if replacing in selection 2020-03-24 11:14:54 -04:00
Hugo Locurcio
cd379cd838
Clarify the Find operation being regex-enabled (#1561)
This makes it more obvious that the Find option accepts regular
expressions as input.

See discussion in #1560.
2020-03-24 10:59:40 -04:00
Zachary Yedidia
fee5528309 Fix term emulator crash if invalid exec given
Ref #1583
2020-03-24 10:22:10 -04:00
Zachary Yedidia
527750b68d Copy selection to primary on mouse release
Fixes #1558
2020-03-05 16:00:40 -05:00
Zachary Yedidia
629efe5eb7 Add JumpLine action back
You can bind to "command-edit:goto ", but binding to the action
"JumpLine" will have the same effect now.

Fixes #1550
2020-03-02 20:09:19 -05:00
Zachary Yedidia
8a2048e7f6 Use tabbar color group, and mark modified tabs
Fixes #1523
2020-02-24 13:45:10 -05:00
Zachary Yedidia
e1827480c9 Filename completion for all non-command prompts
Fixes #1529
2020-02-24 13:00:55 -05:00
Zachary Yedidia
5ffc19f159 Use filecomplete for shell mode 2020-02-17 22:29:33 -05:00
Zachary Yedidia
cc994b6241 Fix relocation with softwrap on small buffers
Fixes #1512
2020-02-15 15:38:20 -05:00
Zachary Yedidia
db32b84cd1 Relocate after rune insert
Fixes #1510
2020-02-14 15:52:20 -05:00
Zachary Yedidia
38f88ade60 Search and replace within a selection
Closes #1098
2020-02-13 19:48:48 -05:00
Zachary Yedidia
faa207907c Handle terminal paste and raw events in info bar 2020-02-13 16:10:35 -05:00
Zachary Yedidia
30ed25859a Support regex capture groups in replace command
See https://golang.org/pkg/regexp/syntax/ for the
supported syntax. Here are some examples:

```
replace "(foo)" "$1-bar"
replace "(foo)" "${1}-bar"
replace "(?P<group>foo)" "$group-bar"
replace "(?P<group>foo)" "$group-bar"
replace "(?P<key>\w+):\s+(?P<value>\w+)$" "$key=$value"
```

Closes #1115
2020-02-13 16:05:56 -05:00
Zachary Yedidia
a07ee26b05 Fix gutter offset when softwrap is enabled 2020-02-13 11:04:10 -05:00
Zachary Yedidia
5519f053ac Merge branch 'autosu' of https://github.com/seitokaichou/micro into seitokaichou-autosu 2020-02-12 14:15:30 -05:00
Zachary Yedidia
ea290e4fb5 Merge branch 'bug-endless-reload-prompt' of https://github.com/jawahars16/micro into jawahars16-bug-endless-reload-prompt 2020-02-12 13:56:00 -05:00
Zachary Yedidia
12c286f9b1 Introduce IndentLine action
Closes #1476
2020-02-12 13:30:24 -05:00
Zachary Yedidia
bad78797bb Clicking tabbar arrow scrolls and fix multicursor
Closes #1503
2020-02-12 13:05:15 -05:00
Zachary Yedidia
bf1258578c Expose OpenLogBuf to plugins 2020-02-12 12:35:40 -05:00
Zachary Yedidia
6588f02f7b Only highlight matching brace if one is found
Fixes #1505
2020-02-12 01:32:23 -05:00
Zachary Yedidia
8224037080 Don't block when redraw channel becomes full
Fixes #1497
2020-02-11 20:03:32 -05:00
Zachary Yedidia
695d4c2b1b Use filepath.Join more 2020-02-11 13:09:17 -05:00
Zachary Yedidia
c88c1b84da Term should return error on unsupported systems
Fixes #1494
2020-02-10 19:09:03 -05:00
Zachary Yedidia
bdf9e6d3a4 Merge branch 'diff-gutter' of https://github.com/p-e-w/micro 2020-02-10 00:28:43 -05:00
Zachary Yedidia
63046ae909 Don't autocomplete in the middle of a word
Fixes #1490
2020-02-09 16:46:53 -05:00
Zachary Yedidia
af48e4b79b Fix save callbacks
Fixes #1491
2020-02-09 16:36:15 -05:00
Zachary Yedidia
4e73d0779b Create bindings.json if it does not exist 2020-02-09 16:27:39 -05:00
Zachary Yedidia
13e30a63eb Minor improvements 2020-02-09 00:40:50 -05:00
Zachary Yedidia
6d99d34eb0 Fix unsplit crash
Fixes #1488
2020-02-08 21:06:13 -05:00
Zachary Yedidia
57c34e2248 More plugin docs and improve doc formatting 2020-02-08 18:31:06 -05:00
Zachary Yedidia
6514b77e0d Enable autosave option
The autosave option is now specified as an integer, which denotes
the number of seconds to wait between saving the file. If the option
is 0, then autosaving is disabled. If the option is given by the user
as a boolean, it will be converted to 8 if true, and 0 if false.

Fixes #1479
2020-02-08 16:53:08 -05:00
Zachary Yedidia
8a907956d1 Use actual lua functions for callbacks instead of strings 2020-02-08 15:49:41 -05:00
Philipp Emanuel Weidmann
de33eac058
Add diff gutter 2020-02-08 13:26:24 +05:30
Zachary Yedidia
24a684cff2 Merge branch 'master' of https://github.com/dbeef/micro into dbeef-master 2020-02-07 19:37:56 -05:00
Zachary Yedidia
b4e7e981f3 Support paste action in terminal 2020-02-07 19:17:17 -05:00
Zachary Yedidia
a52c0c2907 Add StartOfText options to multiactions 2020-02-06 17:10:32 -05:00
Zachary Yedidia
be7d27bc49 Action callbacks for lua actions 2020-02-06 11:12:34 -05:00
Zachary Yedidia
f6a9c482a6 Allow plugins to resize panes 2020-02-05 17:16:31 -05:00
Zachary Yedidia
8483f1da1e Make curpane only return bufpanes 2020-02-02 17:12:50 -05:00
Zachary Yedidia
28ed47e358 Fix cycleback in infopane 2020-02-02 16:16:53 -05:00
Zachary Yedidia
b0624cb66e Add support for plugin manager within micro 2020-02-02 14:20:39 -05:00
Zachary Yedidia
bcb1947a0a Add plugin manager 2020-02-01 23:54:38 -05:00
Zachary Yedidia
866b3c9238 Resize tabbar properly
Ref #1467
2020-01-26 00:44:34 -05:00
Zachary Yedidia
3252324d24 Don't indent empty lines
Fixes #1472
2020-01-26 00:40:40 -05:00
Zachary Yedidia
cf41a587a3 Split the actions StartOfLine and StartOfText
The default keybindings now use StartOfText which moves the cursor
to the start of the text on the current line instead of the actual
start of the line (if the line begins with whitespace).

Fixes #1468
2020-01-25 13:02:13 -05:00
Zachary Yedidia
b658f94e5a Change ctrl-arrow default binding for non-Mac OSes
On non-Mac operating systems, the default for CtrlLeft/CtrlRight
is now WordLeft and WordRight instead of moving the cursor to the
start and end of lines (now rebound to Alt-Left/Right by default).
Default keybindings are unchanged on Mac.

Fixes #1465
2020-01-20 22:35:00 -05:00
Zachary Yedidia
0abe427026 Make readonly and filetype local-only 2020-01-20 22:03:32 -05:00
Zachary Yedidia
6a465500bc Properly handle empty args with new shellquote lib
Fixes #1454
2020-01-06 11:38:21 -05:00
Zachary Yedidia
d234e9ec41 Add cycleautocompleteback action 2020-01-04 15:51:15 -05:00
Zachary Yedidia
dfb6bc0312 Fix save callback issue 2020-01-03 17:38:50 -05:00
Zachary Yedidia
ddc8bf455e Set filetype to 'off' to disable completely
Ref #1427
2020-01-02 19:00:42 -05:00
Zachary Yedidia
2855ae204c Replace shellwords with shellquote 2020-01-02 18:30:51 -05:00
Zachary Yedidia
50ff45c213 Some documentation updates 2020-01-02 15:10:28 -05:00
Zachary Yedidia
dc4da37908 Add "paste" option to enable aggressive pasting
Ref #1043
2020-01-02 12:42:39 -05:00
Zachary Yedidia
e98be1a1e5 Update deps 2020-01-01 20:44:45 -05:00
Zachary Yedidia
a2f7080602 Raw event support with new tcell 2019-12-31 22:34:43 -05:00
Zachary Yedidia
a2916c0e32 Escape sequence support 2019-12-31 21:50:26 -05:00
Zachary Yedidia
0301e3539e Use upstream updated zyedidia tcell 2019-12-31 20:15:45 -05:00
Zachary Yedidia
6632ab0a77 Switch to gdamore/tcell 2019-12-31 17:53:16 -05:00
Zachary Yedidia
2c72a3755c Fix openbuffer view creation 2019-12-31 17:52:55 -05:00
Zachary Yedidia
d83b912b3b Add xclip message for pasting if unsupported 2019-12-31 16:12:39 -05:00
Zachary Yedidia
3b66a3364c Fix some formatting 2019-12-29 22:02:14 -05:00
Zachary Yedidia
9b03a3dc6d Add message if xclip/xsel not found
Ref #1236
Fixes #1031
2019-12-29 21:43:29 -05:00
Zachary Yedidia
5180634947 Merge 2019-12-29 18:23:22 -05:00
Zachary Yedidia
da643a0c1f Run action completion on saves with prompts at the right time 2019-12-29 18:23:17 -05:00
Zachary Yedidia
cd6765673f Support tcell EventPaste 2019-12-29 13:45:08 -05:00
Zachary Yedidia
c2e7fd34a7 Fix issues related to tabbar/infobar mouse events
Fixes #1440
2019-12-28 15:56:56 -05:00
Zachary Yedidia
bd0c172667 Improve mouse selection performance 2019-12-28 12:04:43 -05:00