47 Commits

Author SHA1 Message Date
Zachary Yedidia
1a575bc9ae Fix UpN if proposedY < 0
Fixes #804
2017-09-07 16:44:05 -04:00
Yannick A
921f88b95d Cursor move at the first char when Up on the first line (and at the last char when Down on last the line) (#773)
* Cursor move at the beginning of the line when Up on the first line (and at the last character when Down on last the line)

* Fix an issue when Up to a shorter line than current line
2017-08-09 11:58:37 -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
Rene Kaufmann
06c65d8404 fixed a panic when a line is cut out(strg+k) and the next line
is empty.
2017-06-20 11:53:59 +02:00
Zachary Yedidia
3741a71cc5 Check bounds on LastVisualX
Fixes #708
2017-06-18 15:38:33 -04:00
Zachary Yedidia
f933b90c66 Get undo working properly with multiple cursors 2017-06-16 22:19:33 -04:00
Zachary Yedidia
5dc8fe40ca Add option to disable use of a the primary clipboard
Closes #544
2017-02-07 19:21:25 -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
89c468924e Fix rare out of bounds error with selections
Fixes #446
2016-11-11 20:12:21 -05:00
Zachary Yedidia
d0fa467a3c Revert "Improve performance for very long lines"
This reverts commit d5694c0f35.

Fixes #351
See #348
2016-09-11 16:05:15 -04:00
Zachary Yedidia
d5694c0f35 Improve performance for very long lines 2016-09-10 10:03:51 -04:00
Zachary Yedidia
2041e12eba Fix some issues with mouse selection copying 2016-09-05 08:36:30 -04:00
Zachary Yedidia
c71e816e37 Fix recursive function 2016-09-04 21:28:40 -04:00
Zachary Yedidia
6721ec8e7d Copy to primary clipboard for any change in selection 2016-09-04 21:19:14 -04:00
Zachary Yedidia
261748bd56 Add local settings for each buffer 2016-08-25 15:47:26 -04:00
Zachary Yedidia
e3c2335c14 Slight additional improvement to word movement 2016-08-20 12:31:52 -07:00
Zachary Yedidia
198b1b8e79 Improve cursor word movement
The definition of a "word" is a bit more subtle now. Before it would
just move the cursor until a whitespace was found. Now it will stop
at non word characters as well.
2016-08-20 12:26:54 -07:00
Zachary Yedidia
5da6b31b9c Pressing tab on a selection indents the selection
See #203
2016-08-02 18:30:36 -04:00
Zachary Yedidia
72f5808025 Replace rope with lineArray 2016-06-07 11:43:28 -04:00
Zachary Yedidia
d6307b2718 Proper support for double width characters
Fixes #99
2016-06-04 16:25:11 -04:00
Zachary Yedidia
9e96623725 Small improvement to line selection 2016-06-01 18:00:49 -04:00
JT Olds
8bd23a575f Add CursorPageUp and CursorPageDown actions 2016-05-31 16:02:42 -06:00
Zachary Yedidia
19717dd3ae Check if the file being edited has been modified by an external program 2016-05-29 17:58:06 -04:00
Zachary Yedidia
ee9f2a3d9c Add persistent undo as the option 2016-05-29 11:02:56 -04:00
Zachary Yedidia
a92a7dc4e6 Add savecursor option
This adds the `savecursor` option which will remember where the cursor
was when the file was closed and put it back when the file is opened
again. The option is off by default so that people aren't confused as to
why the cursor isn't at the start of a file when they open it.

This commit also adds a more general ability to serialize a buffer so
various components can be saved (which could also be useful for persistent
undo).

Fixes #107
2016-05-28 17:29:49 -04:00
Zachary Yedidia
f730864e9f Do a bounds check for charpos function 2016-05-24 09:15:01 -04:00
Zachary Yedidia
df684ec505 Store cursor and eventhandler in buffer instead of view
This is better design because the cursor and eventhandler are things the
buffer should know about directly but the view shouldn't. This should
make it easier to add persistent undo or location saving between
sessions (see #107).
2016-05-22 15:01:02 -04:00
Zachary Yedidia
29ae840413 Use rope substring instead of report 2016-05-07 10:57:40 -04:00
Zachary Yedidia
8670a03973 Add the text member back.
It seems rope.Report is not acting how I expected it to. I need to look
into this in more detail but for now I am adding the Text variable back
to the Buffer.

Fixes #98
2016-05-06 19:15:10 -04:00
Zachary Yedidia
eba820a9c7 Rewrite gofmt and goimports as plugins 2016-05-05 12:53:07 -04:00
Zachary Yedidia
87d9221a73 Small optimization 2016-05-05 11:23:20 -04:00
Zachary Yedidia
f6dc983823 Optimization for buffer text
We no longer store a string representation of the buffer and instead
directly access it through the rope
2016-05-04 12:43:17 -04:00
Zachary Yedidia
539d4b1167 Fix differences between selection with keys and with mouse
Fixes #89
2016-04-30 16:51:21 -04:00
Zachary Yedidia
56cdfcfe46 If a setting is not defined, use the default, not the zero value 2016-04-30 15:02:33 -04:00
Zachary Yedidia
e0f20fbb55 Fix selection bugs 2016-04-30 14:06:00 -04:00
Zachary Yedidia
f6393dd835 Use a map for settings instead of a struct
Using a map for the settings means that plugins will be able to create
their own settings at runtime.
2016-04-30 11:39:48 -04:00
Zachary Yedidia
80755dcf31 Improve word movement behavior 2016-04-27 10:44:36 -04:00
Zachary Yedidia
8e03e20055 Minor cleanup 2016-04-26 20:18:56 -04:00
Zachary Yedidia
84a844994a Correct word movement behavior 2016-04-26 19:53:43 -04:00
Zachary Yedidia
6c99eea610 Improve WordRight and WordLeft bindings 2016-04-26 09:58:56 -04:00
Zachary Yedidia
e00e0cfa3f Starting to add more mappings for arrow keys
These mappings include Alt+arrows and Shift+arrows and Alt+Shift+arrows

This commit also switches the version of tcell that micro uses to my
fork which supports alt, shift, and ctrl + arrows.
2016-04-26 09:58:56 -04:00
Zachary Yedidia
20ab7a44ab Relocate cursor on reOpen() 2016-04-24 17:26:42 -04:00
aerth
b39d383dac cut lines into clipboard 2016-04-24 01:29:09 +00:00
Zachary Yedidia
0fac02cd08 Fix SelectLine 2016-04-23 14:02:20 -04:00
Zachary Yedidia
77caf5878d Fix windows binary links
Fixes #47
2016-04-21 07:05:15 -04:00
Zachary Yedidia
6aab17f445 Set last visual x after SetLoc is called
Fixes #46
2016-04-20 20:03:53 -04:00
aerth
337f162360 now is go gettable and updated make file 2016-04-18 10:59:41 +00:00