38 Commits

Author SHA1 Message Date
Zachary Yedidia
af22e0a567 Allow overwriting options with flags
Fixes #258

Also related to #233, this commit also changes how +LINE,COL works. Now it is
micro -startpos LINE,COL file.
2016-09-03 11:26:01 -04:00
Zachary Yedidia
fc2d9bb461 Merge pull request #233 from schollz/master
Flag to start at specified line/column number (#224)
2016-08-31 16:39:30 -04:00
Zack Scholl
62ac9f79f2 Switched to +LINE,COL
Previously the flag was parsed for `-cursor LINE,COL`

However, emacs and nano both us `+LINE,COL` and this also makes
it easier to ignore the `+` as a filename.
2016-08-31 10:10:54 -04:00
Zachary Yedidia
ddff950fcd Check for filetype after saving an untitled buffer
Fixes #242
2016-08-30 17:25:30 -04:00
Zack Scholl
4499228cdb Added flag to introduce cursor starting positions 2016-08-30 11:28:28 -04:00
Zachary Yedidia
b4e470b6e2 Add support for making buffer local options in settings.json 2016-08-25 20:15:58 -04:00
Zachary Yedidia
ec0833b09c Update plugins for local settings 2016-08-25 16:01:42 -04:00
Zachary Yedidia
1a9123630b Add support for local or global only settings 2016-08-25 15:48:02 -04:00
Zachary Yedidia
348922e1f2 Add filetype as an option
Still in progress
2016-08-25 15:48:02 -04:00
Zachary Yedidia
261748bd56 Add local settings for each buffer 2016-08-25 15:47:26 -04:00
Zachary Yedidia
0711c29c0a Add onBufferOpen plugin callback 2016-08-24 17:03:02 -07:00
Zachary Yedidia
02f78edaf9 Open help in a separate split 2016-07-14 13:01:02 -04:00
Zachary Yedidia
8c0983a36c Add some more comments 2016-07-10 13:26:24 -04:00
Zachary Yedidia
40affa56c7 Create tab struct and reorganize tab bar 2016-06-08 13:26:50 -04:00
Zachary Yedidia
d72da1eb5c Add more descriptive error message if there is an error with gob 2016-06-07 17:03:05 -04:00
Zachary Yedidia
8d184c1870 Fix glitch with undo 2016-06-07 16:10:39 -04:00
Zachary Yedidia
72f5808025 Replace rope with lineArray 2016-06-07 11:43:28 -04:00
Zachary Yedidia
1d52ef6c54 Add simple way to save with sudo if you forgot to open micro with sudo
If you are editing a read-only file and forgot to open micro with sudo
so you could write to it, when saving the file, micro will now give you
the option to save with sudo.

This little hack is used by vim users to achieve the same behavior, but
micro makes it nicer to use. Here is an explanation for how it works:
http://stackoverflow.com/questions/2600783/how-does-the-vim-write-with-sudo-trick-work

Fixes #158
2016-06-02 13:01:13 -04:00
Zachary Yedidia
ef17306f8b Allow changes from external programs to be undone
We use a diff to be able to transform the buffer into an arbitrary
string (usually when we reread the file after an external program such
as gofmt has changed it) and still preserve undo/redo.

Fixes #136
2016-05-30 21:01:40 -04:00
Zachary Yedidia
d4caf4510c Fix bug with on reopen 2016-05-30 18:22:10 -04:00
Zachary Yedidia
b312e7c9ad Refactor ReOpen function 2016-05-30 17:48:33 -04: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
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
d7b61ecfa8 Fix small bug in Remove function in buffer 2016-05-17 19:57:16 -04:00
Dante Swift
a03cacf1e7 saving now resets buffer IsModified to false 2016-05-15 00:26:36 -06:00
Zachary Yedidia
e2efc963b7 Simplify IsDirty check 2016-05-14 12:04:13 -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
48a17a508d Use hash for savedText instead of full string 2016-05-01 19:07:54 -04:00
Zachary Yedidia
3b4521e9c6 Remove unused syntax highlighting code and optimize IsDirty() 2016-04-20 13:52:10 -04:00
Zachary Yedidia
fdceddefe1 Fix IsDirty 2016-04-18 16:13:49 -04:00
Zachary Yedidia
273401d911 Optimization for IsDirty() 2016-04-18 14:20:40 -04:00
aerth
337f162360 now is go gettable and updated make file 2016-04-18 10:59:41 +00:00