99 Commits

Author SHA1 Message Date
Zachary Yedidia
6f302826c8 Add bracket surround 2017-09-13 10:48:53 -04:00
Zachary Yedidia
0c1db1e813 Escape regex chars in selections for multicursors
Fixes #808
2017-09-08 19:16:14 -04:00
Zachary Yedidia
efff850e54 Clear cursors before performing undo or redo
This fix isn't ideal because it removes the cursors but it does work

Fixes #798
2017-09-04 15:47:24 -04:00
Yannick A
7fe8d73473 Fix somes selections issues (#771)
* SelectLeft on the last character is now possible

* SelectLeft on the last character is now possible

* CursorRight on selection places the cursor after the last selected character

* SelectRight on the last character do not select the last character and do nothing
2017-08-09 11:52:38 -04:00
Zachary Yedidia
69c6d8a099 Fix some lint problems 2017-08-08 11:30:09 -04:00
Zachary Yedidia
5c785ab1ac Fix MoveLines when user has a selection
Ref #767
2017-08-03 12:42:40 -04:00
Yannick Armand
9dd1df36d5 Move current line down/up: cursor stay with moved line 2017-08-03 12:02:07 +02:00
Yannick Armand
ed9bc66060 OutdentSelection works on all cases (whatever tabsize or tabstospace values) 2017-08-01 22:42:42 +02:00
Yannick Armand
cc5855d07b Display number of lines in the JumpLine prompt 2017-08-01 16:41:57 +02:00
Zachary Yedidia
86c2ac95bb Merge cursors after spawning with mouse
Fixes #760
2017-07-31 22:30:57 -04:00
Zachary Yedidia
3b2d7abe3d Store visual x when cursor loc moves in certain cases
Fixes #739
2017-07-15 17:52:56 -04:00
Zachary Yedidia
e4751fd84c Optimize search
Fixes #722
2017-07-08 15:03:35 -04:00
Zachary Yedidia
681da2e90c Deselect with mouse
This commit also makes non editing actions (save, quit...) only execute
once even if there are multiple cursors.
2017-06-17 11:05:23 -04:00
Zachary Yedidia
118e6b1804 Merge cursors properly
Cursors will merge together if they are on top of each other.
2017-06-17 10:43:14 -04:00
Zachary Yedidia
f933b90c66 Get undo working properly with multiple cursors 2017-06-16 22:19:33 -04:00
Zachary Yedidia
21840d3ffe Make cursor movement automatic on insert + remove
This changes the behavior of cursor movement so that all cursors are
adjusted when a change is made to the buffer. Cursors don't have to be
manually moved after calling Insert or Remove, those functions will move
the cursor properly on their own.

This should fix issues 1-3 mentioned in the multiple cursors discussion.

Ref #5
2017-06-15 18:52:51 -04:00
Zachary Yedidia
00718f99cf Add ability to add cursors with Ctrl-MouseLeft
With the new code that allows binding mouse buttons this was remarkably
easy to add.

The new binding is:

    "Ctrl-MouseLeft": "MouseMultiCursor"

Note: A number of terminals don't support Ctrl-MouseLeft (macOS
especially) so you might want to rebind to MouseRight or MouseMiddle.
2017-06-12 20:25:10 -04:00
Zachary Yedidia
c3a73d63b8 Add comments 2017-06-12 20:25:10 -04:00
Zachary Yedidia
8d268ef021 Remove debug messages 2017-06-12 20:25:10 -04:00
Zachary Yedidia
c45ff4dd4f Add multiple cursor support
This commit creates new keybindings and actions to handle multiple
cursors.

Here are the defaults:

    "Alt-n": "SpawnMultiCursor",
    "Alt-p": "RemoveMultiCursor",
    "Alt-c": "RemoveAllMultiCursors",
    "Alt-x": "SkipMultiCursor",
2017-06-12 20:25:10 -04:00
Zachary Yedidia
3270acdd00 Add functionality for binding mouse buttons
This commit enables users to bind the mouse buttons (left, middle,
right buttons and the scroll wheel).

The default bindings now include the mouse bindings:

    "MouseWheelUp":   "ScrollUp",
    "MouseWheelDown": "ScrollDown",
    "MouseLeft":      "MousePress",
    "MouseMiddle":    "PastePrimary",

Mouse buttons can now also be bound to normal actions. For example:

    "MouseLeft": "Backspace"

This also means that plugins can access mouse event callbacks in the
standard way ('onAction').

More documentation for this will be coming soon.

Fixes #542
2017-06-11 17:49:59 -04:00
Zachary Yedidia
d1e70b5abf Add suspend for linux only 2017-05-21 10:44:33 -04:00
Zachary Yedidia
a70fb9db7d Test suspend code 2017-05-21 10:30:26 -04:00
tommy
d8dee90c10 check viewtype before saving and if scratch is true then do not save 2017-05-15 20:00:58 +01:00
Zachary Yedidia
b7133b302b Don't remember path on save if it is invalid
Fixes #656
2017-05-14 10:27:15 -04:00
Zachary Yedidia
18f9b6f34e Add tabmovement option
This option makes micro treat spaces at the beginning of lines as if
they are tabs. This option only does anything if tabstospaces is already
on. E.g. micro will move over 4 spaces at once when at the start of a
line.

Closes #616
2017-05-05 12:04:18 -04:00
Zachary Yedidia
a6ee75a9cf Add SaveAll command and display + for modified tabs
Closes #651
2017-05-05 11:05:23 -04:00
Zachary Yedidia
b4dda8bad8 Use less memory when opening very large files 2017-04-29 14:12:00 -04:00
Zachary Yedidia
12d74b99e8 Merge branch 'master' into view-refactor 2017-03-26 20:40:03 -04:00
Zachary Yedidia
da5542a557 Fix findNext and findPrevious with certain regexes
Fixes #576
2017-03-05 11:20:42 -05:00
Zachary Yedidia
98365b6bfb Fix block indent selection
Fixes #572
2017-03-02 19:46:23 -05:00
Zachary Yedidia
2fcb40d5a9 Use new syntax highlighting engine from zyedidia/highlight
This changes all the syntax files in the runtime directory and also
changes how syntax highlighting is done from inside micro.
2017-02-26 11:14:35 -05:00
Zachary Yedidia
043f7cdc47 Fix various linter and vet warnings 2017-02-21 13:07:37 -05:00
Zachary Yedidia
c1db99a5a5 Merge pull request #522 from samdmarshall/master
Redo of #516 -- Making micro a bit more user-friendly around the quitting behavior
2017-02-16 15:57:04 -05:00
Samantha Marshall
a7e5a5b26c only prompt the user if they can close all buffers, otherwise it would be misleading 2017-01-10 10:18:49 -05:00
Samantha Marshall
ea0dda98ce adding different functionality for closing a tab versus quitting micro 2017-01-10 10:13:21 -05:00
Nicolai Søborg
41fb57e449 Fix: incorrect clipboard w/ CutLine, DeleteLine and Search (#508)
* Fix: incorrect clipboard w/ CutLine, DeleteLine and Search

* Refactor: Add Cursor.CopySelection(clipboard)
2017-01-09 18:28:45 -05:00
Zachary Yedidia
379a49f944 Merge pull request #488 from McSwaggens/removewhitespaces-setting
Added removewhitespaces setting
2016-12-22 17:49:49 -05:00
Daniel Jones
a311e07106 Changed removewhitespaces setting to keepautoindent 2016-12-23 09:44:57 +11:00
Zachary Yedidia
0d9fc601ac Merge pull request #489 from november-eleven/refactor/plugin-name
Enable human-friendly plugin name
2016-12-22 15:44:09 -05:00
theodus
4cb26d2e8e move to new tab 2016-12-13 12:12:20 -05:00
Thomas LE ROUX
651cb89948 refactor(plugin): Enable human-friendly plugin name 2016-12-12 16:37:48 +01:00
Daniel Jones
0558de12c6 Added removewhitespaces setting 2016-12-11 23:01:10 +11:00
Zachary Yedidia
eeaac76f5f Use io.Readers to read files more efficiently 2016-11-29 13:44:30 -05:00
Zachary Yedidia
400ac56651 Make tab.CurView public 2016-11-28 20:50:11 -05:00
Zachary Yedidia
5481a834bf Actually rename width, height, lockWidth, lockHeight 2016-11-28 20:28:40 -05:00
Zachary Yedidia
0fbae7610c Fix buffer name problem
Fixes #458
2016-11-19 19:07:51 -05:00
Zachary Yedidia
c692570212 Replace CtrlO with open command
This comit also makes it possible for a binding to auto-type the
beginning of a command into command mode.

Closes #450
2016-11-19 12:57:54 -05:00
Zachary Yedidia
1b9bb31dd6 Cleanup and add more comments 2016-10-18 11:12:28 -04:00
Jon Craton
cc9342df9d Added OutdentLine action 2016-10-15 12:47:15 -04:00