Commit graph

2704 commits

Author SHA1 Message Date
Juan Francisco Cantero Hurtado
fd20fc8837
Fix the syntax for Raku variables. (#2309)
The current version has problems with the last argument and the
brackets in this code:

sub myfunction(Int $x1, Int $x2){

}

Taken from:
https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc
2021-12-21 23:47:31 -05:00
Jake Leahy
c442d7030d
Fix edge case when comment is at start of line (#2237) 2021-12-05 17:45:10 -08:00
antonl05
6998cb5602
add more types for nim (#2284) 2021-11-22 22:41:04 -08:00
Zachary Yedidia
d2dca2b6c3 Fix 2021-11-22 18:46:36 -08:00
Zachary Yedidia
0e63224dea Use abspath for local glob settings
Ref #2276
2021-11-22 18:45:19 -08:00
Hugo Hromic
0bbc3e7e3d
Add support for alternatives system in Debian package (#1935)
* Allows for micro to be selectable in the `editor` group
* Use same priority as in the nano package

Ref: https://wiki.debian.org/DebianAlternatives
2021-11-17 15:51:40 -08:00
Matthias Thym
dd8e341de2
Fix linter help formatting (#2280) 2021-11-17 12:59:16 -08:00
abaldota
d023aef6b5
Python syntax: multiline string should be constant.string, not comment (#2268)
* Python syntax: multiline string should be comment.string, not comment 

''' delimits multiline strings, not comments

* Python syntax: multiline string should be comment.string, not comment 

''' delimits multiline strings, not comments

* Update python3.yaml for python3.10 keywords
2021-11-14 21:54:56 -08:00
Herby Gillot
26c24c25c0
README: add MacPorts install info (#2265) 2021-11-06 20:18:24 -07:00
Evan Shimoniak
58e3cc1be0
Clarified some documentation (#2259)
* Clarified meaning of indentchar setting

The description "sets the indentation character" combined with the default value of a space led me to believe that this was a way to set a preference for tabs/spaces and choose a number of spaces per indentation all at once. I've updated the description to try to make its true function clearer.

* Added note on rmtrailingws

This behavior was unexpected for me, so it's probably good to let other users know which option has precedence.

* Added details to help command

Initially I kept trying to use `help <command-name>` rather than `help commands`
2021-11-02 13:26:14 -07:00
Zachary Yedidia
7df91eb038 Fix makefile for cross compilation 2021-10-29 04:47:23 +00:00
Dmitry Maluka
728d87ceba
Fix regression: non-working direct colors in syntax files (#2252)
After 9ad4437, directly specifying color names (instead of syntax groups)
in syntax files no longer works. In particular *.patch and *.diff files
are not highlighted, since in patch.yaml direct colors names are used.

Restore the previous behavior of GetColor (fallback to direct colors if
no syntax group found) to fix this regression, but also make some changes
in StringToStyle and StringToColor to still fix the issue which was fixed
by 9ad4437. In other words, ensure that there is no confusion between
direct colors ("red", "green" etc) and syntax groups omitted in the
colorscheme file.
2021-10-27 15:12:55 -07:00
Zachary Yedidia
a6796fcbd9 Update makefile generation rules
Ref #2229
2021-09-29 16:30:20 -07:00
Dmitry Maluka
ffbb257434
Support for highlighting all search matches (hlsearch) (#1762)
* Support for highlighting all search matches (hlsearch)

hlsearch is implemented efficiently using the buffer's line array,
somewhat similarly to the syntax highlighting.
Unlike the syntax highlighter which highlights the entire file,
hlsearch searches for matches for the displayed lines only.
Matches are searched when the given line is displayed first time
or after it was modified. Otherwise the previously found matches
are used.

* Add UnhighlightSearch action

and add it to the list of actions triggered by Esc key by default.

* Add comment explaining the purpose of search map

* Add hlsearch colors to colorschemes

Mostly just copied from the corresponding original (mostly vim) colorschemes.

* Highlight matches during/after replace as well

As a side effect it also changes the last search value, i.e. affects FindNext
and FindPrevious, but it's probably fine. In vim it works the same way.

* Improve hlsearch option description
2021-09-28 13:39:03 -07:00
Dmitry Maluka
9ad4437a98
Fix some issues with default colors in colorschemes (#2225)
* Fix default colors for unconfigured syntax groups

When GetColor is called for a syntax group not specified in the
colorscheme, it should fallback not to the terminal's default colors
(tcell.DefaultColor) but to the colorscheme's defaults (DefStyle)
which may be different from tcell.DefaultColor.

For example, if we are using micro's default colorscheme in a terminal
which uses a black-on-white theme, then dots and commas in Go files
("symbol" syntax group in go.yaml) are displayed black on a dark
background, i.e. barely visible.

* Avoid using terminal's default colors directly

If a syntax group color is set to "default" (which we have for some
syntax groups in some colorschemes), it defaults to the terminal's
default colors (tcell.DefaultColor), which is fine for 16-color
colorschemes but not quite fine for truecolor and 256-color
colorschemes which should not depend on the terminal colors.
It should default to the colorscheme's default (DefStyle) instead.

For example, if we are using micro's default colorscheme in a terminal
which uses a black-on-white theme, then "bool" type in C files
("type.extended" syntax group in c.yaml) is displayed black on a dark
background, i.e. barely visible.
2021-09-28 13:30:29 -07:00
Dmitry Maluka
a21a720941
Make 'make' do the same as 'make build' (#2217)
Fix a slight regression after ec3292: when 'make' is run without specifying
a target, it counter-intuitively runs fetch-tags instead of building micro.
2021-09-24 14:40:26 -07:00
Ryan Westlund
c2d7b62e8f
Fix #2190: Document goto command in commands.md (#2218) 2021-09-24 14:40:11 -07:00
Ryan Westlund
9270f17378
Fix #1943: 'Duplicated line' message being wrong (#2219) 2021-09-24 14:39:58 -07:00
TogoorooDev
395bfc2307
Syntax Highlighting Support for FreeBSD Kernel Configuration Files (#2220)
* added FreeBSD kernel configuration file format

* updated format, notably to highlight the word 'include'
2021-09-24 14:39:46 -07:00
Ali Kefia
a417ec4dcb
normalize path - force slash separator to access embed FS (#2197) 2021-08-25 16:26:54 -04:00
Ali Kefia
ec3292e8c4
Build : using go:generate and go:embed (#2195)
* using go:generate and go:embed

* fix import
2021-08-24 22:02:29 -04:00
Zachary Yedidia
fe3186ba9d Ignore tool files 2021-08-21 18:07:43 -04:00
Zachary Yedidia
3a97ce820c More style improvements 2021-08-21 18:04:08 -04:00
Zachary Yedidia
c44ccb8cc7 Merge 2021-08-21 17:58:35 -04:00
Zachary Yedidia
0914f158c2 Improve comments 2021-08-21 17:58:30 -04:00
Andrew Clarke
dcf94816fb
remove carriage return from -clean prompt and fix broken logic (#2186) 2021-08-21 00:30:16 -04:00
Zachary Yedidia
bb609467dd Update comment filetype when commenting 2021-08-20 14:42:38 -04:00
Zachary Yedidia
a4c3f7dad9 Merge branch 'master' of https://github.com/zyedidia/micro 2021-08-20 13:56:22 -04:00
Zachary Yedidia
dceddcfd83 Fix save with sudo auto-detection and sudo/doas message 2021-08-20 13:55:59 -04:00
Zachary Yedidia
0c2e139672 Fix formatting 2021-08-18 16:55:51 -04:00
Zachary Yedidia
fb1e7eabab Update install instructions 2021-08-18 16:55:22 -04:00
Zachary Yedidia
272f3adcc4 Add eget to install instructions 2021-08-18 16:13:17 -04:00
Dmitry Maluka
87ad6fc0bb
plugins.md: update link to the internal documentation (#2191)
godoc.org now redirects to pkg.go.dev and it's not obvious how to locate
the internal packages documentation at https://pkg.go.dev/github.com/zyedidia/micro
2021-08-18 15:35:49 -04:00
Zachary Yedidia
2eeeb0f2e4 Update runtime 2021-08-18 01:09:53 -04:00
Zachary Yedidia
aa541d6d6f Merge 2021-08-18 01:08:58 -04:00
Zachary Yedidia
403a9eb11d Add rust clippy linter and go vet linter 2021-08-18 01:08:54 -04:00
john-batch
77f93bfd93
Make yes/no prompts case-insensitive (#2182) 2021-08-13 23:56:26 -04:00
Zachary Yedidia
b97638566e Merge branch 'pyfisch-patch-3' 2021-08-06 20:45:12 -04:00
Zachary Yedidia
7a1ba01621 Merge branch 'patch-3' of https://github.com/pyfisch/micro into pyfisch-patch-3 2021-08-06 20:44:57 -04:00
riley
2b8cd6b758
Highlight racket files as lisp (#1931)
Add syntax highlighting for [racket](racket-lang.org), a (variant of scheme which is a) variant of lisp which uses the .rkt extension.
2021-08-06 20:38:22 -04:00
AAAA
cbe339da07
Update v.yaml (#1925)
Improvements:
 - Use proper scope names for better colorization
 - Better regex to detect binary, octal, decimal and hexadecimal numbers
 - Extend some definitions based on the Vlang docs

Co-authored-by: AAAA <dev@onerbs.com>
2021-08-06 20:37:42 -04:00
Zachary Yedidia
e290ce2de5 Fixes for syntax and docs
Fixes #2163
Ref #2173
2021-08-03 00:07:14 -04:00
Andrey Nering
c7fd4ba5f1
Document that "bubblegum" is a light theme (#2153) 2021-08-02 21:13:05 -04:00
Zachary Yedidia
0efc919f24 Merge 2021-08-02 21:06:28 -04:00
Zachary Yedidia
c315a91fc6 Allow aborting while opening a file with backup
Also fixes an issue where the abort prompt consumes interrupt signals.

Fixes #2151
2021-08-02 21:05:22 -04:00
pyfisch
6e1fe5b301 More precise filename detection for shell scripts
Make the regular expression much more precise:

* match literal dots instead of any char (match rc.conf but not rcXconf)
* match special filenames exactly (match PKGBUILD but not myPKGBUILD.something)

Run build-all to update internal/config/runtime.go

closes #2163
2021-07-21 22:09:46 +02:00
pyfisch
84a490f14c
Update rust syntax: don't highlight lifetimes (#2164)
Work-around rust lifetimes and character literals both using single quotes.
2021-07-21 15:02:28 -04:00
pyfisch
42a9302636
Update rust syntax: char literal (#2162)
Highlight character literals started with a single quote (').
Importantly this ensures correct highlighting for the character literal '"'.
Limitation: rust char literals contain exactly one character, however this isn't checked by the highlighter.

Closes #2160
2021-07-21 12:37:41 -04:00
Ali Kefia
ae0c28a03d
Fix name collision on linter name (swiftc) (#2158) 2021-07-18 18:30:52 -04:00
Ali Kefia
1a5518ebbb
Shellcheck as a new shell linter + runtime.go out of git control (#2157)
* shellcheck as a new shell linter + runtime.go out of git control

* keep runtime.go and keep both shfmt and shellcheck since we can remove from custom conf
2021-07-16 15:01:50 -04:00