Commit graph

621 commits

Author SHA1 Message Date
Zachary Yedidia
11104fd093 Update to tcell v2 2020-09-05 14:52:35 -04:00
Zachary Yedidia
f35f507832 Never backup closed buffers 2020-09-04 13:36:23 -04:00
Dmitry Maluka
c9b0451a33
AddToHistory function for plugins (#1830)
Add InfoBuf's method AddToHistory function which adds a new item
to the history for the prompt type `ptype`.
This function is not used by micro itself. It is useful for plugins
which add their own items to the history, bypassing the infobar
command line.
2020-08-23 15:47:14 -04:00
Dmitry Maluka
c7e72220dd
Add scrollbar color group (#1840)
Ref #1837
2020-08-23 15:45:43 -04:00
Dmitry Maluka
7e19b68426
Avoid duplicate entries in history (#1822) 2020-08-13 01:38:50 -04:00
Zachary Yedidia
c5bafbc1c5 Merge 2020-08-12 01:18:18 -04:00
Zachary Yedidia
6b80870dfd Don't auto-relocate mouse events 2020-08-12 01:18:15 -04:00
Zachary Yedidia
5cb618c466 Improve showkey command 2020-08-11 22:18:10 -04:00
Zachary Yedidia
352f57cf11 Enable registering raw events
Fixes #1821
2020-08-11 14:36:58 -04:00
Zachary Yedidia
1e83e666fb Don't overwrite user bindings
This fix still needs more work.

Ref #1821
2020-08-11 01:43:41 -04:00
Zachary Yedidia
c837a7d0b7 Ref #1819 2020-08-10 20:34:10 -04:00
Zachary Yedidia
63d45bc9c5 Fix JobSend stdin 2020-08-10 12:24:29 -04:00
Zachary Yedidia
0283c01432 Record events in cursor 2020-08-09 16:42:03 -04:00
Zachary Yedidia
bbd6f559ab Allow configuration for info/term bindings
This commit exposes the separate infopane bindings to configuration
from the user. This also adds support for separate bindings in the
terminal emulator view. Default bindings are provided, but can also
be rebound in bindings.json.
2020-08-09 16:42:03 -04:00
Zachary Yedidia
2363a4019b Separate bindings for buffers and command bar
This commit separates actions in the command bar from actions in
a normal buffer, and implements what is needed to allow rebinding,
although an interface for command bar keybindings is not yet exposed
to the user.
2020-08-09 16:42:03 -04:00
Zachary Yedidia
d33c28eeb8 Preliminary support for key sequences
This commit adds support for binding key sequences such as
"<Ctrl-x><Ctrl-c>". This commit does not solve the problem
of global bindings yet, and therefore the command bar doesn't
work properly in this commit.
2020-08-09 16:42:03 -04:00
Zachary Yedidia
5ff8b3791d Basic implementation of KeyTree 2020-08-09 16:42:03 -04:00
Zachary Yedidia
6c53407e6d Improve internal keyevent names 2020-08-09 16:42:03 -04:00
Zachary Yedidia
dd54a64746 Initialize t.release to true 2020-08-04 18:41:14 -04:00
Dmitry Maluka
6e43af31cb
Fix non-working split resize with mouse drag (#1811)
Fix the 2nd part of #1773: resize via mouse drag doesn't work if the
split on the left contains other splits, i.e. is not a leaf node.

The problem is that only leaf nodes have unique id. For non-leaf nodes
ID() returns 0. So we shouldn't search the node by id.
So replace GetMouseSplitID() with GetMouseSplitNode().
2020-08-04 18:37:19 -04:00
Dmitry Maluka
a4cc5a4146
Fix erased vertical dividing line (#1810)
Fix the 1st part of #1773: the dividing line between vertical splits
is not displayed if the split on the left contains other splits, i.e.
is not a leaf node.
2020-08-04 18:33:16 -04:00
Zachary Yedidia
95ec55fbbf Check error in terminal emulator 2020-07-27 17:43:55 -04:00
Zachary Yedidia
015e7c7b83 Don't update internal plugins
Ref #1792
2020-07-22 15:40:40 -04:00
Ryan Westlund
1f27f51f9a
Add syntax support for Renpy (#1789) 2020-07-22 15:26:37 -04:00
franekjel
1a89d2095d
Support for multiple modifiers in colorschemes (#1772)
* Support for multiple modifiers (eg. "bold italic")

* Test for multiple modifiers (bold + italic + underline)
2020-07-14 17:58:03 -04:00
Zachary Yedidia
781a2dd826 Add flake8 linter, postinit and preinit
Closes #1768
2020-07-13 13:28:26 -04:00
Zachary Yedidia
a45591a24d Read paste option in screen init
Fixes #1767
2020-07-10 12:26:15 -04:00
Zachary Yedidia
a52dbb2142 Fix swift linting problem 2020-07-09 18:08:14 -04:00
Zachary Yedidia
41a27cc58a Update linter to include eslint
Ref #1766
2020-07-09 18:04:40 -04:00
Zachary Yedidia
3d387732c4 Update linter documentation
Ref #1766
2020-07-09 17:58:42 -04:00
Zachary Yedidia
806525c3da Improve comment plugin
When commenting a selection, the plugin won't just toggle each
line individually but will only uncomment the block if it is all
comments.

The comment plugin also now takes into account any number of spaces
between the comment character and the text. For example '//comment' will
be uncommented properly, as well as '//      comment'.

Fixes #1758
2020-07-05 15:48:49 -04:00
Zachary Yedidia
102ae04a16 Improve multicursor clipboard
Ref #1721
2020-07-05 01:12:35 -04:00
Zachary Yedidia
037c3c993f Add clipboard support for multicursors
Fixes #1721
2020-07-04 21:26:36 -04:00
Zachary Yedidia
d8596919a6 Fix reading clipboard internally for OSC52 2020-07-04 20:54:27 -04:00
Zachary Yedidia
cf86f6848f Don't set fastdirty base if modified 2020-07-04 20:09:44 -04:00
Zachary Yedidia
aeb5563df0 Update runtime 2020-07-04 20:06:37 -04:00
Zachary Yedidia
f143418267 Add support for copy-paste via OSC 52
Ref #1754
2020-07-04 20:00:39 -04:00
Zachary Yedidia
67355337b3 Fix escape not exiting prompt 2020-07-03 22:12:58 -04:00
Zachary Yedidia
32c8517a90 Rebind escape to clear info and deselect 2020-07-03 21:02:16 -04:00
Zachary Yedidia
b793e9bb92 Use tcell's CanDisplay instead of Go's IsPrint
Fixes #1755
2020-07-02 17:57:50 -04:00
Zachary Yedidia
977290d77b Improve php string highlighting
Fixes #1753
2020-07-01 23:38:47 -04:00
Utkarsh Gupta
b748d0c383
Drop unnecessary Ftoa and FtoaWithDigits function (#1751)
Fixes: #1749

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-30 13:19:27 -04:00
Zachary Yedidia
253281ae5e Add a lock for plugins to use if using async code
Ref #1539
2020-06-28 16:29:32 -04:00
Zachary Yedidia
f5c6f66c8f Fix path escaping on Windows
Windows does not allow ':' in a path, but for some reason previous
versions still worked, except the file for storing buffer info
(which had a ':' in the name) was not viewable except by opening
it with micro.

Ref #1736
2020-06-27 17:59:28 -04:00
Ryan Westlund
e946d9eddf
Improve Haskell syntax highlighting (#1745) 2020-06-26 17:53:43 -04:00
Zachary Yedidia
60846f549c Update plugin documentation 2020-06-24 17:24:45 -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
db1df05017 Support month and day names in crontab syntax
Ref #1739
2020-06-24 16:33:22 -04:00
Zachary Yedidia
05cbc310f3 Use boundaries in cron syntax rules
Fixes #1739
2020-06-24 16:00:56 -04:00
Zachary Yedidia
3ddb2ee316 Add Search function to BufPane 2020-06-23 18:47:42 -04:00
Zachary Yedidia
687e4bdc25 Don't delete user settings if a parse error occurs 2020-06-23 17:29:20 -04:00
Zachary Yedidia
37c754c7c7 Treat CRLF as LF when inserting text
In effect, pasting text with \r\n will remove the \r character and
delegate whether or not the file will be saved with CRLF or LF line
endings to the `fileformat` option.

Ref #1742
2020-06-23 17:17:22 -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
4d13308624 Persist plugin options correctly 2020-06-20 20:07:33 -04:00
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
891b117a33 Bind Ctrl-/ (CtrlUnderscore) in comment plugin 2020-06-18 17:18:34 -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
cfc595e80e Fix MoveLines on last line of buffer
Fixes #1723
Fixes #1724
2020-06-12 15:16:27 -04:00
Zachary Yedidia
b8ec7b320a Add note for macOS terminals in docs 2020-06-12 14:20:26 -04:00
Ján Priner
b2261fc225
Add latex support in comment plugin (#1725) 2020-06-12 12:58:51 -04:00
Philipp Emanuel Weidmann
5ce26cca71
Make determining whether a code point represents a combining mark faster (#1719) 2020-06-12 00:10:00 -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
Dmitry Maluka
1f58eecf3c
Lower priority of cursorline and colorcolumn highlighting (#1697)
Fixes #1665
2020-06-08 16:15:54 -04:00
Zachary Yedidia
ae05ff1811 settings.json only contains modified settings
If a setting has a default value it will not be listed in settings.json.
2020-06-08 15:33:38 -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
2e3d08580e Merge 2020-06-06 15:56:36 -04:00
Zachary Yedidia
466889f540 Fix fileformat for newly created files
Fixes #1575
2020-06-06 15:56:13 -04:00
Dmitry Maluka
63900cb395
Fix highlighting at the end of line (#1705)
Fixes #1664
2020-06-04 23:32:31 -04:00
Zachary Yedidia
b473fe458d Merge 2020-06-03 00:27:51 -04:00
Zachary Yedidia
8cf56bfc56 Up arrow on first line brings to start
Fixes #1701
2020-06-03 00:27:24 -04:00
Zachary Yedidia
51ab8f9914 Unicode replacement char for non-displayable chars 2020-05-30 18:11:52 -04:00
Zachary Yedidia
3fc9a8ad9e Fix handling of +LINE:COL syntax
Fixes #1685
2020-05-29 22:48:23 -04:00
Zachary Yedidia
b05d3a5193 Slightly improve performance for very long lines 2020-05-29 15:31:13 -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
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
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
Colin Hughes
00edf0207f
Added hybrid line numbers (#1690)
* Added hybrid line numbers

* Changed rulerhybrid to relativeruler, modified documentation accordingly.

* Reverted go.mod and go.sum
I don't know how they got changed but they are good now.

Co-authored-by: Colin Hughes <semilin@pop-os.localdomain>
2020-05-28 22:24:09 -04:00
Zachary Yedidia
8956448fca UpdateRules after save is successful 2020-05-28 13:06:29 -04:00
Zachary Yedidia
a915cf9283 Fix '> save' command 2020-05-28 13:02:09 -04:00
Dmitry Maluka
c5b0c2d41f
Fix dropped redraw events (#1675)
If screen.Redraw() is called very quickly after a key or mouse event,
it may send the redraw event while micro is not waiting for it but
still processing the key or mouse event. Since drawChan is non-buffered
and at the same time non-blocking, this redraw event will be simply lost,
so the screen content will not be up-to-date.
2020-05-23 14:59:23 -04:00
Zachary Yedidia
bd43a44194 Merge branch 'master' of https://github.com/zyedidia/micro 2020-05-21 14:36:34 -04:00
Zachary Yedidia
bfe68b1626 Allow divider customization with divchars option
Adds the `divchars` and `divreverse` options to customize divider
styles.
2020-05-21 14:35:54 -04:00
Zachary Yedidia
0064b8268f Improve unicode line array test 2020-05-20 19:53:54 -04:00
Zachary Yedidia
9a22d93ea2 Expose CharacterCount to plugins 2020-05-20 18:04:00 -04:00
Zachary Yedidia
5c8a2332d9 Use unicode.Mark for combining unicode range 2020-05-20 18:01:10 -04:00
Zachary Yedidia
ff0683d6d0 Final touches for combining character support 2020-05-20 17:00:56 -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
Zachary Yedidia
a491dd1c52 Merge branch 'buffer-benchmarks' of https://github.com/p-e-w/micro into p-e-w-buffer-benchmarks 2020-05-20 15:28:36 -04:00
Zachary Yedidia
d7ab44253f Update tcell and support italics in colorschemes
Closes #1640
2020-05-17 12:48:34 -04:00
Zachary Yedidia
0a6720498f Merge branch 'master' of https://github.com/zyedidia/micro 2020-05-17 12:23:21 -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
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
30395b1f67 Remove outdated c++ highlighter
Fixes #1652
2020-05-14 21:37:19 -04:00
Zachary Yedidia
ddf70953fe Support snake case autocompletion
Fixes #1655
2020-05-14 21:34:17 -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
Zachary Yedidia
f59468642d Update runtime 2020-04-10 17:27:57 -04:00
Zachary Yedidia
85e85b7ccc Merge 2020-04-10 17:27:34 -04:00
Zachary Yedidia
8f5888e7bf Use StartCol in colorcolumn calculation
Fixes #1615
2020-04-10 17:27:11 -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
jsyedidia
a76bf02f5f
Add Haskell linter hlint to linter plugin (#1610) 2020-04-05 14:05:01 -04:00
Zachary Yedidia
1cf9537340 Fix python3 syntax file and make python3 default
The python3 syntax had "filename" instead of "filetype"
as the header. This commit also makes standard py extensions
use the python3 highlighting and requires .py2 or a python2
env to use python2 highlighting because python3 is the standard
python now.

Fixes #1592
2020-03-24 11:42:23 -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
allanderek
ee157f6503
Add elm as a default comment type in the comment plugin. (#1586) 2020-03-24 10:56:50 -04:00
Zachary Yedidia
48ca19873f Better ordering for reading syntax files
Ref #1580
2020-03-24 10:52:15 -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
18d540583b Don't clear infobar if not enabled
Fixes #1584
2020-03-17 14:21:36 -04:00
Zachary Yedidia
943ea15fa3 Fix linter c++ entry
Fixes #1578
2020-03-14 15:40:05 -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
Philipp Emanuel Weidmann
d038d3040f
Add more sophisticated buffer benchmark system 2020-03-01 13:20:10 +05:30
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
8a9a14562f Use bytes.Buffer for LineArray.Bytes 2020-02-27 11:27:00 -05:00
Zachary Yedidia
a6f5dee45c Fix custom syntax files not highlighting
Fixes #1530
2020-02-27 00:58:52 -05:00
Zachary Yedidia
b12886b066 Improve buffer test 2020-02-25 23:59:27 -05:00
Zachary Yedidia
56f5b475eb Improve buffer test 2020-02-25 23:21:50 -05:00
Zachary Yedidia
c51f84955e Update runtime 2020-02-25 21:08:22 -05:00
Zachary Yedidia
e4bf1e9984 Undo event chunks instead of single events 2020-02-25 20:53:48 -05:00
Zachary Yedidia
53bda0cfa7 Fix buffer tests and selection bug
Fixes #1528
Ref #1526
2020-02-25 20:24:02 -05:00
Zachary Yedidia
f059541e0d Merge branch 'buffer-tests' of https://github.com/p-e-w/micro into buffer-unit-tests 2020-02-25 10:30:31 -05:00
Zachary Yedidia
d78fe81e21 line_array insert for eofnewline and make default
Makes the `eofnewline` option enabled by default.

Fixes #1525
2020-02-24 22:31:05 -05:00
josh
25b9342fbe
fix eofnewline not running on files with 1 rune (#1535) 2020-02-24 22:26:51 -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
8a2048e7f6 Use tabbar color group, and mark modified tabs
Fixes #1523
2020-02-24 13:45:10 -05:00
Zachary Yedidia
0174d7dba4 Move multi-cursors correctly after newlines
Fixes #1527
2020-02-24 13:39:34 -05:00
Zachary Yedidia
e1827480c9 Filename completion for all non-command prompts
Fixes #1529
2020-02-24 13:00:55 -05:00
Zachary Yedidia
d8584d1ddb Debug off using default "go build"
Ref #1469
2020-02-24 12:55:59 -05:00
Philipp Emanuel Weidmann
f0cdc3cabb
Add buffer test and benchmark suite (and tool to generate it) 2020-02-22 08:51:38 +05:30
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
cf3fdb344a Merge 2020-02-18 21:40:36 -05:00
Zachary Yedidia
b91242124c Go lint the current directory of file
Closes #1520
2020-02-18 21:40:14 -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
087e7207f7 Add 'xterm' option
Ref #1489
2020-02-15 12:53:17 -05:00
Zachary Yedidia
db32b84cd1 Relocate after rune insert
Fixes #1510
2020-02-14 15:52:20 -05:00
Zachary Yedidia
600d8558b2 Change some default option values 2020-02-13 20:51:56 -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
e7ef81ed97 Share hash across equivalent buffers for fastdirty=off 2020-02-12 13:32:42 -05:00
Zachary Yedidia
12c286f9b1 Introduce IndentLine action
Closes #1476
2020-02-12 13:30:24 -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
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
7d47659481 Fix deleteLines off-by-one error
Fixes #1501
2020-02-12 01:16:11 -05:00
Zachary Yedidia
dcd4bae96f Clamp modifications
Fixes #1502
2020-02-12 00:55:52 -05:00
Zachary Yedidia
1a64ffb88b Don't expose draw channel to outside packages 2020-02-11 20:39:26 -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
feaf3951d2 Update haskell syntax file 2020-02-11 19:13:36 -05:00
Zachary Yedidia
695d4c2b1b Use filepath.Join more 2020-02-11 13:09:17 -05:00
Zachary Yedidia
8176e8c6f8 Improve one-dark colorscheme divider 2020-02-10 23:37:21 -05:00
Zachary Yedidia
71f5f043fb Merge 2020-02-10 19:56:17 -05:00
Zachary Yedidia
f3eaf99665 Draw FakeCursor in infobar when on a character
Fixes #1496
2020-02-10 19:55:13 -05:00
Zachary Yedidia
c88c1b84da Term should return error on unsupported systems
Fixes #1494
2020-02-10 19:09:03 -05:00
Zachary Yedidia
e1e310a96e Document all options 2020-02-10 15:07:00 -05:00
Zachary Yedidia
185b8de17b Merge branch 'issue_1008' of https://github.com/sum01/micro into sum01-issue_1008 2020-02-10 14:59:31 -05:00
Zachary Yedidia
848bd1ba8c Fix rehighlight for retab 2020-02-10 14:49:08 -05:00
Zachary Yedidia
ecb9fd5a8a Change diffgutter default to false 2020-02-10 00:30:13 -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
3ed77dbb2e Sanitize inputs to insert and remove 2020-02-10 00:18:08 -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
6f424f3213 Properly flush bufio writer 2020-02-09 15:36:31 -05:00
Zachary Yedidia
e110e93e0f Improve disk performance with buffered io 2020-02-09 15:21:23 -05:00
Zachary Yedidia
8ddf335e68 Improve remove performance 2020-02-09 14:58:37 -05:00
Zachary Yedidia
ca9d102267 Start insert performance improvements 2020-02-09 14:30:20 -05:00
Zachary Yedidia
13e30a63eb Minor improvements 2020-02-09 00:40:50 -05:00
Zachary Yedidia
ce91e41e5a Update third party licenses 2020-02-09 00:03:03 -05:00
Zachary Yedidia
6d99d34eb0 Fix unsplit crash
Fixes #1488
2020-02-08 21:06:13 -05:00
Zachary Yedidia
b77980082c Fix to allow readonly to be disabled 2020-02-08 19:37:37 -05:00
Rein F
2fd59adffa Show that the file is readonly (#1486)
* Show that the file is readonly)

* change the (readonly) statusline msg into [ro]
2020-02-08 19:34:35 -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
Rein F
e759d4087b Fix for issue 2 in #1484
Exit message when exiting terminal now isnt visibile in other views
2020-02-08 00:15:37 +01:00
Zachary Yedidia
106ba48079 Add some docs for linter, comment, status 2020-02-07 11:32:12 -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
6e3f38b271 Add scrolling to command bar autocompletion 2020-02-02 20:17:46 -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
6a1b8f4a4f Add option to clean unused settings and other parts of config 2020-02-02 15:30:06 -05:00
Zachary Yedidia
dba8ef2fdd Use namespaces for plugin options 2020-02-02 14:35:30 -05:00
Zachary Yedidia
b0624cb66e Add support for plugin manager within micro 2020-02-02 14:20:39 -05:00
Zachary Yedidia
09ea82c97e Disable current line num style if no cursorline 2020-02-02 00:34:28 -05:00
Zachary Yedidia
d94b81b8e6 Synchronize undo and redo chunks
Fixes #1372
Fxies #1471
2020-02-02 00:14:56 -05:00
Zachary Yedidia
bcb1947a0a Add plugin manager 2020-02-01 23:54:38 -05:00
Zachary Yedidia
b0b5d7b392 Add CurPane and CurTab functions for plugins 2020-02-01 12:20:08 -05:00
Zachary Yedidia
2598d8ad70 Update colorschemes and add new ones
This commit updates the colorschemes and adds some new ones:

* gotham (https://github.com/novln/micro-gotham-colors)
* monokai-dark (https://github.com/Theodus/micro-monokai-dark)
* one-dark (https://github.com/joseluisq/micro-one-dark)
* sunny-day (https://github.com/dwwmmn/micro-sunny-day)
2020-01-31 15:05:55 -05:00
Zachary Yedidia
f731e422ea Improve lua interface 2020-01-31 14:21:27 -05:00
Zachary Yedidia
d326a9cddd Merge 2020-01-31 00:56:20 -05:00
Zachary Yedidia
e3131a0779 Add text event callback 2020-01-31 00:56:15 -05:00
Zachary Yedidia
46c5a81b0d Fix callback cancelation 2020-01-30 18:04:17 -05:00
Zachary Yedidia
59146cabb1 Add callback option to linter 2020-01-30 18:00:17 -05:00
Zachary Yedidia
35e3bddea0 Modify linter and add plugin cmd 2020-01-30 17:51:04 -05:00
Zachary Yedidia
016b8dcc4c Do not add non-plugin directories in plug/ 2020-01-28 23:49:51 -05:00
Zachary Yedidia
03228762d4 Don't call plugin if nil 2020-01-28 22:06:58 -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
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
8e7a016917 Tab horizontal scrolling should not be negative
Fixes #1467
2020-01-25 13:17:13 -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
97ee344268 Fix some issues with syntax highlighting regions
Fixes #1464
2020-01-20 23:43:47 -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
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
Serge Voilokov
8d373cde6e Add golang keywords (#1455)
* Add golang keywords

* Update runtime
2020-01-06 12:06:44 -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
c7f36f9480 Don't indent softwrap if ruler is off
Ref #1450
2020-01-05 20:32:29 -05:00
Zachary Yedidia
955bde4abc Minor view fix 2020-01-05 15:02:52 -05:00
Zachary Yedidia
6c3814dfac Better message for gob error 2020-01-05 12:45:27 -05:00
Zachary Yedidia
d234e9ec41 Add cycleautocompleteback action 2020-01-04 15:51:15 -05:00
Bonnie
c2c0325384 Fix #1383: "Save with Sudo" rewrite (#1424)
* Rewrite save with sudo (Fixes #1383)

* Combine overrideFile & overrideFileAsRoot into 1 function
2020-01-03 17:39:12 -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
0bf54ff0e7 Don't crash if only file to open is directory 2020-01-02 15:25:07 -05:00
Zachary Yedidia
50ff45c213 Some documentation updates 2020-01-02 15:10:28 -05:00
Zachary Yedidia
eb2b546600 Merge 2020-01-02 12:43:52 -05:00
Zachary Yedidia
dc4da37908 Add "paste" option to enable aggressive pasting
Ref #1043
2020-01-02 12:42:39 -05:00
Zachary Yedidia
9333354fc8 Fix save with sudo on mac 2020-01-02 01:25:00 -05:00
Zachary Yedidia
b557ed2221 Fix PluginAddRuntimeFile 2020-01-02 01:18:16 -05:00
Zachary Yedidia
6d0128059b Finish support for a fake cursor 2020-01-01 22:40:51 -05:00
Zachary Yedidia
d6dd838abd Better support for fake cursor 2020-01-01 21:29:18 -05:00
Zachary Yedidia
d9e262c394 Use fake cursor for windows 2020-01-01 20:47:05 -05:00
Zachary Yedidia
e98be1a1e5 Update deps 2020-01-01 20:44:45 -05:00
Zachary Yedidia
d7b39fe7a5 Disable true color by default 2019-12-31 23:09:33 -05:00
Zachary Yedidia
abf07a8357 Update runtime 2019-12-31 22:42:35 -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
466c48da31 Merge 2019-12-31 17:53:00 -05:00
Zachary Yedidia
2c72a3755c Fix openbuffer view creation 2019-12-31 17:52:55 -05:00
Zachary Yedidia
92054aa649 Merge 2019-12-31 16:49:21 -05:00
Zachary Yedidia
4b5be43e60 Create all parents of micro config automatically
Ref #1184
2019-12-31 16:48:45 -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
cf1f9fa007 Use MICRO_CONFIG_HOME before trying XDG_CONFIG_HOME 2019-12-28 23:10:51 -05:00
Zachary Yedidia
29a5cef559 Update default plugins slightly 2019-12-28 22:39:57 -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
8663014bbe Add support for syntax headers and update tcell 2019-12-28 18:53:51 -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
Zachary Yedidia
629f20720a Fix add runtime file for local plugins 2019-12-27 20:28:25 -05:00
Zachary Yedidia
b1efabaaed Command binding fix 2019-12-27 00:43:45 -05:00
Zachary Yedidia
185d54d664 Search and replace fixes 2019-12-27 00:06:02 -05:00
Zachary Yedidia
6681387b47 Support for file reloading if changed externally 2019-12-26 17:59:23 -05:00
Zachary Yedidia
6ba66320f0 Don't forward tabbar mouse events to panes
Fixes #1435
2019-12-26 17:02:02 -05:00
Zachary Yedidia
ec2976b069 Scroll up as much as possible
Fixes #1434
2019-12-26 16:57:09 -05:00
Zachary Yedidia
8570ff9a8c Remove autosave option
With the new backup option, the autosave option is no longer useful.
Since it never really worked well in the first place, it has been
removed.

Closes #1420
2019-12-26 14:35:48 -05:00
Zachary Yedidia
7f7ad29671 Improve lua interface for statusline 2019-12-26 12:46:10 -05:00
Zachary Yedidia
a95dab078e Minor edit to statusline format
Ref #1432
2019-12-26 12:25:42 -05:00
Zachary Yedidia
f8218e0648 Fix bottomline when softwrap enabled 2019-12-25 19:44:58 -05:00
Zachary Yedidia
e66d01e989 Some documentation 2019-12-25 19:37:51 -05:00
Zachary Yedidia
ff6f28e366 Autocompletion fix for infobuffer 2019-12-25 17:05:11 -05:00
Zachary Yedidia
4951f155ea Support for more complex action chaining 2019-12-25 17:05:11 -05:00
Zachary Yedidia
94ff79e7b2 Lua prompt support and plugin improvements 2019-12-25 17:05:11 -05:00