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.
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
* 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.
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.
* 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.
* 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.
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.
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.
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.