Zachary Yedidia
3b34a021e3
Improve file permission detection
...
Mark files as readonly automatically if write permission is denied.
Display errors when opening files (except for non-existence errors).
Fixes #1224
2020-12-17 21:54:18 -05:00
Dmitry Maluka
298fa40f90
Fix buffer.RuneAt ( #1895 )
...
Fix buffer.RuneAt returning the rune not at the given location (as the
documentation claims) but just before it.
2020-10-19 20:36:14 -04:00
Sourya Vatsyayan
fc3dd9a62f
Fix quality issues ( #1856 )
...
* Add .deepsource.toml
* Remove unnecessary comparison with bool
* Remove unnecessary use of slice
* Replace multiple `append`s with one
* Remove unnecessary wrapping of function call
* Fix check for empty string
* Simplify error creation with `fmt.Errorf`
* Fix defers before error check
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Remove untrappable `os.Kill` signal
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Remove empty else branch
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Add missing error check
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Merge variable declaration and assignment
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Remove unnecessary `nil` check
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Revert changes to generated files
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
* Remove .deepsource.toml
Signed-off-by: sourya_deepsource <sourya@deepsource.io>
Co-authored-by: DeepSource Bot <bot@deepsource.io>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2020-09-16 00:08:01 -04:00
Zachary Yedidia
f35f507832
Never backup closed buffers
2020-09-04 13:36:23 -04:00
Zachary Yedidia
5f62f550f3
Add more functions to customize status bar
...
Adds `status.lines`, `status.vcol`, `status.bytes`, `status.size`,
and exposes some functions from go-humanize to plugins.
Ref #1727
2020-06-24 17:19:42 -04:00
Zachary Yedidia
a8332fd316
Improve backup system
...
This commit introduces several improvements to the backup system.
* Backups are made every 8 seconds for buffers that have been modified
since the last backup.
* The `permbackup` option allows users to specify that backups should
be kept permanently.
* `The backupdir` option allows users to store backups in a custom
directory.
Fixes #1641
Fixes #1536
Ref #1539 (removes possibility of race condition for backups)
2020-06-22 17:54:56 -04:00
Zachary Yedidia
cfc595e80e
Fix MoveLines on last line of buffer
...
Fixes #1723
Fixes #1724
2020-06-12 15:16:27 -04:00
Zachary Yedidia
466889f540
Fix fileformat for newly created files
...
Fixes #1575
2020-06-06 15:56:13 -04:00
Zachary Yedidia
3fc9a8ad9e
Fix handling of +LINE:COL syntax
...
Fixes #1685
2020-05-29 22:48:23 -04:00
Zachary Yedidia
eeab114ed5
Add parsecursor
option for file:line:col syntax
...
This option is disabled by default, and when enabled causes micro
to parse `:line:col` as a location for the cursor rather than
as part of the filename.
Closes #1650
Closes #1685
2020-05-29 14:55:24 -04:00
Zachary Yedidia
79c0ea17ad
Use CharacterCount over RuneCount
2020-05-20 16:47:08 -04:00
Zachary Yedidia
bdff221870
Use DecodeCharacter over DecodeRune
2020-05-20 16:43:12 -04:00
dmaluka
a150eef6f9
Fix end line number in HighlightMatches ( #1662 )
...
There is a bit of mess in the usage of HighlightMatches: in some places
we assume that it updates lines from startline to endline inclusive,
in other places we assume it's non-inclusive.
This fix makes it always inclusive.
In particular, it fixes a bug: when we open a file which has no
newline at the end, the last line isn't highlighted.
2020-05-17 16:05:34 -04:00
Zachary Yedidia
eff89a98a7
Fix v2 import path for go mod
2020-05-04 10:16:15 -04:00
Zachary Yedidia
48ca19873f
Better ordering for reading syntax files
...
Ref #1580
2020-03-24 10:52:15 -04:00
Zachary Yedidia
9e8d76f2fa
If stdout is a pipe, output to the pipe
...
If you run micro as `micro | cat` for example, micro will disallow
you from saving the file, and when you quit the buffer, the contents
will be sent to the pipe. This allows one to use micro as part of
an interactive unix pipeline.
Closes #1524
2020-02-27 12:39:19 -05:00
Zachary Yedidia
a6f5dee45c
Fix custom syntax files not highlighting
...
Fixes #1530
2020-02-27 00:58:52 -05:00
Zachary Yedidia
70bcf9f618
Fix text transformation bug
...
This fixes the remaining text transformation tests.
Ref #1526
2020-02-24 20:11:11 -05:00
Zachary Yedidia
dff8b33e9c
Apply basename option in tabbar as well
2020-02-24 13:48:37 -05:00
Zachary Yedidia
2ef4f83358
Fix issue with simultaneous buffers
2020-02-19 17:40:54 -05:00
Zachary Yedidia
a9120ce270
Share more buffer elements and fix rehighlight
...
Fixes #1521
2020-02-19 14:41: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
e7ef81ed97
Share hash across equivalent buffers for fastdirty=off
2020-02-12 13:32:42 -05:00
Zachary Yedidia
7b5bc8fe37
Fix issue with global/local settings
2020-02-12 13:18:59 -05:00
Zachary Yedidia
bad78797bb
Clicking tabbar arrow scrolls and fix multicursor
...
Closes #1503
2020-02-12 13:05:15 -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
848bd1ba8c
Fix rehighlight for retab
2020-02-10 14:49:08 -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
6f424f3213
Properly flush bufio writer
2020-02-09 15:36:31 -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
Philipp Emanuel Weidmann
de33eac058
Add diff gutter
2020-02-08 13:26:24 +05:30
Zachary Yedidia
b0624cb66e
Add support for plugin manager within micro
2020-02-02 14:20:39 -05:00
Zachary Yedidia
953f5a0eff
Highlight in parallel
2020-01-28 20:54:14 -05:00
Zachary Yedidia
477bdb3dc8
Empty highlighting for unknown filetypes
2020-01-28 18:34:44 -05:00
Zachary Yedidia
d74f40882d
Don't rehighlight if there are no modifications
2020-01-28 17:15:02 -05:00
Zachary Yedidia
97ee344268
Fix some issues with syntax highlighting regions
...
Fixes #1464
2020-01-20 23:43:47 -05:00
Zachary Yedidia
b3e40a2644
Make debug mode flag, plugins can access logbuf
2020-01-15 22:25:08 -05:00
Zachary Yedidia
17f0eb80cd
Readonly should only apply to default buffers
...
Ref #1298
2020-01-15 20:09:17 -05:00
Zachary Yedidia
ddc8bf455e
Set filetype to 'off' to disable completely
...
Ref #1427
2020-01-02 19:00:42 -05:00
Zachary Yedidia
0bf54ff0e7
Don't crash if only file to open is directory
2020-01-02 15:25:07 -05:00
Zachary Yedidia
bd83c6a8a9
Remove detect requirement and detect in jinja file
...
Ref #1415
2019-12-28 22:27:44 -05:00
Zachary Yedidia
5b52b8a60f
Support includes
2019-12-28 21:57:03 -05:00
Zachary Yedidia
a61616d79e
More efficient loading for default syntax files
...
This change introduces header files for syntax files. The header
files only contain the filetype and detection info and can be
parsed much faster than parsing a full yaml file. To determine
which filetype a file is, only scanning the headers is necessary
and afterwards only one yaml file needs to be parsed. Use the
make_headers.go file to generate the header files. Micro expects
that all default syntax files will have header files and that
custom user syntax files may or may not have them. Resolving
includes within syntax has not yet been implemented. This
optimization improves startup time.
Ref #1427
2019-12-28 21:26:22 -05:00
Zachary Yedidia
6681387b47
Support for file reloading if changed externally
2019-12-26 17:59:23 -05:00
Zachary Yedidia
b527e4fe42
Reoragnize slightly
2019-12-25 17:05:11 -05:00
Zachary Yedidia
fc706bc404
No backups for no name files
2019-12-25 17:05:11 -05:00
Zachary Yedidia
c4d5d7c195
Better backup behavior
2019-12-25 17:05:11 -05:00
Zachary Yedidia
e42cf3663b
Backup support
2019-12-25 17:05:11 -05:00