Commit Graph

2846 Commits

Author SHA1 Message Date
Zachary Yedidia
e222ed73b8 Rename multimode to multiopen
Ref #2689
2023-01-24 17:06:52 -08:00
Andrew Geng
432fc7ed58
Add -multimode to open multiple files into split. (#2689)
Adds config option `multimode`, which takes values `tab`, `vsplit`,
or `hsplit` (corresponding to the file-opening commands). I mean to
use it with a command line like

    micro -multimode vsplit foo.h foo.c

to open files in a side-by-side split, but if one really wanted to
one could set it in the config file to change the default behavior of
opening multiple files in tabs.
2023-01-23 11:13:42 -08:00
Zachary Yedidia
43b512fd77 Include mac arm binary in release scripts 2023-01-12 19:19:20 -08:00
Zachary Yedidia
980112c071 Add darwin arm64 prebuilt binary
Fixes #2456
2023-01-12 19:16:07 -08:00
Alan Christian
b0e7efe6a5
description different from JSON real default (#2680)
* description different from JSON real default

* fix wrong line
2023-01-12 12:40:04 -08:00
Steven Xu
64638845e9
fix: allow binding the minus key, fixes #2471 (#2617) 2023-01-11 21:56:54 -08:00
oplexius
97f362b465
Doc changes (#2646)
Try to make things a little more concise to start with, remove a couple of repetitions.

This seems like a good editor for people starting out, and I like it as a good alternative to nano for explaining to beginners how to edit config files. If you appreciate the suggestions, I can go over the rest of the documentation, in the hope of making things even easier to get going with.

If the line breaks are off, I can redo this in a text editor, rather than on the web on github. I've limited the changes, but I could make a few more changes to style...

Btw, the tutorial is just about settings. I'm guessing this is just because things aren't finished, but I'm asking just in case this is an error and there may exist a tutorial somewhere.
2023-01-11 21:56:23 -08:00
Dmitry Maluka
f1801f1958
Comment plugin: improve commenting multi-line selection (#2668)
When commenting a block of multiple lines, the comment symbol is added
right before the first non-whitespace character in each line, e.g.:

void somefunc(int a)
{
    // if (a) {
        // a += 2;
        // printf("a = %d\n", a);
    // } else {
        // printf("none");
    // }
}

which isn't quite nice.

Change it to add the comment at the same position on each line, which is
the position of the leftmost non-whitespace in the entire block, e.g.:

void somefunc(int a)
{
    // if (a) {
    //     a += 2;
    //     printf("a = %d\n", a);
    // } else {
    //     printf("none");
    // }
}

Ref #2282
2023-01-11 21:54:59 -08:00
Zachary Yedidia
443ede470d Fix perl syntax file
Fixes #2656
2022-12-09 01:19:19 -08:00
Mark Shachkov
c4d4d5fb7d
Add CUDA syntax support (#2652)
Reusing cpp syntax with minor additions.
2022-12-03 22:17:35 -08:00
Dmitry Maluka
28e0e20651
Improve buffer view relocation after jumping to a far-away location (#2628)
* Improve buffer view relocation after jumping to a far-away location

When the cursor is moved to a location which is far away from the
current location (e.g. after a search or a goto line), the buffer view
is always relocated in such a way that the cursor is at the bottom or
at the top (minus scrollmargin), i.e. as if we just scrolled to this
location. It's not like in other editors, and IMHO it's annoying. When
we jump to a new location far away, we usually want to see more of its
context, so the cursor should be placed closer to the center of the
view, not near its edges.

This change implements the behavior similar to other editors:

- If the distance between the new and the old location is less than one
  frame (i.e. the view either doesn't change or just slightly "shifts")
  then the current behavior remains unchanged.

- Otherwise the current line is placed at 25% of the window height.

* Postpone calling onBufPaneOpen until the initial resize

It is currently not possible to find out the geometry of a newly created
bufpane in onBufPaneOpen lua callback: bp:GetView() returns {0,0,0,0}
instead of the actual window. The reason is that the bufpane view is not
properly initialized yet when the bufpane is created and the callback is
triggered. It is initialized a bit later, at the initial resize.

So postpone calling onBufPaneOpen until after the initial resize.

* Improve buffer view relocation when opening a file at a far-away location

When a file is opened with the initial cursor location at a given line
which is far away from the beginning of the file, the buffer view is
relocated so that the cursor is at the bottom (minus scrollmargin)
as if we just scrolled to this line, which is annoying since we'd rather
like to see more of the context of this initial location.

So implement the behavior similar to the earlier commit (which addresses
a similar issue about jumping far away after a search or goto):

- If the initial cursor location is less than one frame away from the
  beginning of the buffer, keep the existing behavior i.e. just display
  the beginning of the buffer.

- Otherwise place the cursor location at 25% of the window height.
2022-12-02 19:38:09 -08:00
Jakob Nybo Nissen
9a10cac598
Improve Julia syntax highlighting (#2643)
Specifically, do not allow multiline single-quote strings, which are not a
thing in Julia. The existing rule broke when adjoints were used, such as
`b = a'`.
The syntax rules have been copied from Rust, which also uses single ticks for
character literals, and also uses the ' symbol for things unrelated to chars.
2022-12-02 17:49:50 -08:00
Aaron Clark
0a080ba03c
Syntax: added support for Smalltalk (#2626) 2022-12-02 17:49:25 -08:00
Dmitry Maluka
3f0cd019d7
Fix incorrect LastVisualX after changing bufWidth w/o resize (#2629)
* Fix incorrect LastVisualX after changing bufWidth w/o resize

When we resize a buffer pane with softwrap enabled, we update the
cursors LastVisualX values to ensure that moving cursor up or down
within a wrapped line will move the cursor to the correct location.
The problem is that we need to do it also in cases when the visual
buffer width within the buffer window is changing without resizing
the window itself, e.g. when toggling the ruler on/off.

So update LastVisualX whenever the buffer width changes, not neccesarily
as a result of resizing the buffer window.

* Update LastVisualX and relocate when toggling wordwrap on/off

Visual location of a cursor may change not only when softwrap is toggled
on or off but also when wordwrap is toggled on or off without changing
the softwrap setting. So need to update cursor LastVisualX values and
relocate the view if needed, just like when softwrap is toggled, to make
sure that moving the cursor up and down will work correctly and that the
cursor will not be left out of the view.
2022-12-02 17:49:06 -08:00
zehkira
5d3dbde698
Fix "no" when replacing with empty string (#2641)
* advance to end of found string when not replacing

* simplify search location change
2022-12-02 17:48:50 -08:00
Zachary Yedidia
87ad67ada7 Update readme 2022-11-25 16:48:06 -08:00
Zachary Yedidia
fba5e2bf36 Bump clipper 2022-11-05 18:30:52 -07:00
Zachary Yedidia
2e9dabd434 Fix save with sudo for large file sizes
Fixes #2200
2022-11-02 16:00:12 -07:00
d!key
c8c7ad57bd
Added openSUSE installation command (#2587) 2022-10-12 19:06:01 -07:00
Zachary Yedidia
986faa783b Add better explanation about find 2022-10-12 19:05:42 -07:00
Zachary Yedidia
f86f56a628 Bump tcell 2022-10-07 11:20:31 -07:00
Zachary Yedidia
957650c3ee Document FindLiteral default binding 2022-10-04 16:30:06 -07:00
Dmitry Maluka
8ff7ec50ef
Fix relocate at the end of buffer when scrollmargin is 0 (#2578)
* Add LessEqual and GreaterEqual for SLoc

* Fix relocate at the end of buffer when scrollmargin is 0

Fix the following issue: when scrollmargin is set to 0 and we move the
cursor to the end of buffer (e.g. via Ctrl-End), the buffer view doesn't
move.

The cause is that the condition c.LessThan(w.Scroll(bEnd, -scrollmargin+1))
doesn't hold, since Scroll() takes care not to return a location beyond
the end of buffer, so in this case Scroll() just returns bEnd.
2022-10-01 13:03:40 -07:00
Valiant-Wolf
48645907ec
Revert adding 'git-rebase-todo' to the main git syntax highlighting file (#2564) 2022-09-16 11:27:38 -07:00
Tomo
3cbbba534c
Add justfile syntax (#2523)
Just is 'just a command runner'. It has syntax inspired by make,
 so `makefile.yaml` was used as a template.
2022-08-21 23:53:04 -07:00
Mishanya
3dcd01f8b8
Add template literal string highlighting to typescript (#2525) 2022-08-21 23:52:47 -07:00
trolzen
e7bdcb093b
Restore installation instructions for Debian and Ubuntu. (#2530) 2022-08-20 19:08:57 -07:00
Zachary Yedidia
810133d5a8 Use shell job for terminal callback
Fixes #2529
2022-08-19 15:46:01 -07:00
Zachary Yedidia
3d6b0c6dd6 Ensure screen cannot draw during a term prompt
Fixes #2528
2022-08-16 22:07:41 -07:00
cat-master21
225927b9a2
add: add Pacstall to README.md (#2367) 2022-07-24 14:14:52 -07:00
Daniel Lee Harple
88e76b367c
plugins: load directories that are symlinks (#2214)
Fix issue where symlinked plugin directories were ignored. For example

    $ file ~/.config/micro/plug/example
    example: symbolic link to <target directory>

This allows plugins to be managed in a user's "dotfiles" repository, and
be symlinked into micro's plugin directory.
2022-07-24 14:13:46 -07:00
silvershade1337
208a778387
Add new python 3.10 keywords (#2243)
Keywords from the new python 3.10.0 feature "Structural Pattern Matching" - match and case
2022-07-24 14:11:48 -07:00
Martin Kühl
738f131269
Fix gruvbox-tc colorscheme (#2240)
The underline style is missing a color and accidentally using the
background color for its foreground.  This makes links essentially
invisible.  It's also missing the todo style.

This change adds the missing style and color.  Following the gruvbox
colorscheme it uses the gruvbox shade of blue for links, and makes
todos bold.
2022-07-24 14:11:16 -07:00
Matthias Thym
639d8a0b08
Add Terraform syntax support (#2279) 2022-07-24 14:10:29 -07:00
Lincoln Júnior
ce2d186543
Fix cursor position change after CopyLine command (#2353) 2022-07-24 14:09:14 -07:00
Max Grinberg
091fa9091d
Added installation instruction for Gentoo distro (#2209)
Co-authored-by: Max Grinberg <codeswhite@protonmail.com>
2022-07-24 14:07:57 -07:00
worldmaker
7efec130dc
Fix weird behavior of JumpToMatchingBrace in some ill cases (#1966)
It should not return false immediately when no matching brace is found. This makes the jump fails in certain case: `[  )I]` =/=> `[I  )]`.
When there is no brace near the cursor, the last statement is also executed. This may cause problems when chaining commands.
2022-07-24 14:06:59 -07:00
Mario
cf98b7f824
Update README.md (#2109)
Change over 10 years deprecated ifconfig
2022-07-24 14:04:59 -07:00
Zachary Yedidia
dde4001170 Merge branch 'john-batch-master' 2022-07-24 14:04:00 -07:00
john-batch
c226779aca Case-insensitive highlighting of hexadecimal constants 2022-07-24 14:03:53 -07:00
Max Grinberg
02ef99a3a6
Linux clipboard notes reformatted and reordered (#2210)
Co-authored-by: Max Grinberg <codeswhite@protonmail.com>
2022-07-24 14:00:41 -07:00
Zachary Yedidia
bd9bd3a215 Merge branch 'mardukbp-patch-1' 2022-07-24 13:59:18 -07:00
Zachary Yedidia
ce98970c06 Merge branch 'patch-1' of https://github.com/mardukbp/micro into mardukbp-patch-1 2022-07-24 13:59:12 -07:00
Sizhe Zhao
7cc74491d0
runtime/help/defaultkeys.md: Fix table (#2376) 2022-07-24 13:56:30 -07:00
Waldir Pimenta
63cb6ce9fd
help/options.md: reword hlsearch help text (#2502)
Also adjust text wrapping in some lines that had become too long with recent edits.
2022-07-24 13:56:11 -07:00
Abirdcfly
ee6688eb74
delete minor unreachable code caused by log.Fatal (#2507)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2022-07-24 13:56:02 -07:00
Zachary Yedidia
ad70480de7 Only run info plist on darwin 2022-07-21 17:54:01 -07:00
Zachary Yedidia
490ee93796 Fix info-plist script 2022-07-21 17:46:23 -07:00
Zachary Yedidia
ba11d98fef Merge 2022-07-20 10:16:46 -07:00
Zachary Yedidia
d629008688 Add livemd to markdown extensions 2022-07-20 10:16:42 -07:00