Commit graph

427 commits

Author SHA1 Message Date
Zachary Yedidia
49786cf8c3 Fix palette colors with tcell v2 2020-09-21 01:21:59 -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
c26a365f5c Enable xterm automatically if screen init fails 2020-09-15 01:11:59 -04:00
Zachary Yedidia
fcfec28d79 Don't highlight parens in default theme 2020-09-13 20:25:02 -04:00
Zachary Yedidia
5044ccf6bb Update keybinding docs
Also updates the pane type of `info` to `command` which is a more
descriptive name.
2020-09-06 17:38:23 -04:00
Zachary Yedidia
96601a915d Replace meta with alt automatically, update tcell 2020-09-05 21:59:19 -04:00
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