Commit graph

317 commits

Author SHA1 Message Date
Dmytro Maluka
55b251ffee Revert "command: Add capability to use relative numbers in goto (#2985)"
This reverts commit ca3a9d0794.
2024-03-17 16:39:47 +01:00
Jöran Karl
4a53419c62
option: Don't apply rmtrailingws in case of timed autosave (#2850) 2024-03-15 18:46:51 +01:00
cyqsimon
8af304cc21
Update OSC52 info for Alacritty (#3174) 2024-03-15 18:43:34 +01:00
Dmytro Maluka
0a69cc68dc
Merge pull request #3023 from dmaluka/timerchan
Rework lua timers and remove lua.Lock
2024-03-14 04:58:19 +01:00
Dmytro Maluka
9089e9ec83 Add micro's own lua timer function micro.After()
Directly using Go's time.AfterFunc() from lua is tricky. First, it
requires the lua timer callback to explicitly lock ulua.Lock to prevent
races. Second, it requires the lua timer callback to explicitly redraw
the screen if the callback changes the screen contents (see #2923).

So instead provide micro's own timer API which ensures both
synchronization and redrawing on its own, instead of leaving this burden
to lua code. In fact, its implementation runs the lua timer callback in
the main micro's goroutine (i.e. from micro's perspective it is
synchronous, not asynchronous), so both redrawing and synchronization
are ensured automatically.

Fixes #2923
2024-03-14 04:52:59 +01:00
Alan
94af5f13bd
Update commands.md (#2966)
* Update commands.md

removed question marks since they're not meant to be typed and their meaning is equivocal

* Update commands.md

added brackets around optional arguments, and added 'key' placeholder indicating a required argument for 'showkey'

* Update commands.md

added single quotes inside of bracketed optional params (though I feel they should be reserved for shell escaping, and italics should be used for replacing text of arguments. I also added brackets (and quotes) around the `exec` parameter for `term`, although I'm not really sure if that's right because this command doesn't work on my system.
2024-03-14 04:39:17 +01:00
Dmytro Maluka
5bfda7b5f6
Merge branch 'master' into fix/file-detection 2024-03-14 04:32:09 +01:00
Dmytro Maluka
00174bb376
Merge pull request #2606 from dmaluka/mouse-release-and-drag-events
Introduce mouse release and mouse drag events
2024-03-14 03:54:04 +01:00
Dmitry Maluka
104caf08dd Highlighting trailing whitespaces
Added option `hltrailingws` for highlighting trailing whitespaces
at the end of lines. Note that it behaves in a "smart" way.
It doesn't highlight newly added (transient) trailing whitespaces
that naturally occur while typing text. It would be annoying to
see transient highlighting every time we enter a space at the end
of a line while typing.
So a newly added trailing whitespace starts being highlighting
only after the cursor moves to another line. Thus the highlighting
serves its purpose: it draws our attention to annoying sloppy
forgotten trailing whitespaces.
2024-03-14 03:10:31 +01:00
Dmitry Maluka
64370b70d6 Highlighting tab errors
Added option `hltaberrors` which helps to spot sloppy whitespace errors
with tabs used instead of spaces or vice versa.

It uses the value of `tabstospaces` option as a criterion whether a
tab or space character is an error or not.
If `tabstospaces` is on, we probably expect that the file should contain
no tab characters, so any tab character is highlighted as an error.
If `tabstospaces` is off, we probably expect that the file uses
indentation with tabs, so space characters in the initial indent part
of lines are highlighted as errors.
2024-03-14 03:09:30 +01:00
Jöran Karl
ca3a9d0794
command: Add capability to use relative numbers in goto (#2985)
* command: Handle relative line numbers for goto

* help: Adapt goto command documentation
2024-03-13 21:32:12 +01:00
toiletbril
69eaa9191a
options: add matchbracestyle (#2876)
* Update docs to include `matchbracestyle`

* Add `matchbracestyle` to infocomplete.go

* Add validator and default settings for `matchbracestyle`

* Highlight or underline braces based on `matchbracestyle`

* Add `match-brace` to default colorschemes

* Correct `FindMatchingBrace()` counting

Make brace under the cursor have priority over brace to the left in
ambiguous cases when matching braces

Co-authored-by: Dmitry Maluka <dmitrymaluka@gmail.com>

* Fix conflicts

---------

Co-authored-by: Jöran Karl <3951388+JoeKar@users.noreply.github.com>
Co-authored-by: Dmitry Maluka <dmitrymaluka@gmail.com>
2024-03-13 20:21:27 +01:00
にてん
f0bc6281d4
Add onRune parameter, utf8 package in plugins.md (#3100)
Add bufpane in parameters of onRune, preRune, and unicode/utf8
Go package in plugins.md.
2024-03-12 21:40:13 +01:00
Dmytro Maluka
af2ec9d540
Make default fileformat value suited to the OS (#3141)
Set fileformat by default to `dos` on Windows.
2024-03-04 13:20:02 -08:00
Jöran Karl
3c16df87ee options: Add capability to define the line count parsed for the signature check 2023-10-26 20:59:42 +02:00
Jöran Karl
433879046e Improve file detection with signature check capabilities
This allows more complex detection upon regex rules for a certain amount of
lines.
2023-10-26 20:20:02 +02:00
Jöran Karl
f7244d09c6
Add reload setting - finalization of #2627 (#2845)
* Add reload setting

Can be set to:

* auto - Automatically reload files that changed
* disabled - Do not reload files
* prompt - Prompt the user about reloading the file.

* option: Add default value for reload option and documentation

---------

Co-authored-by: Wilberto Morales <wilbertomorales777@gmail.com>
2023-10-22 00:18:41 +02:00
Mikko
9b81589fba
help: fix incorrect instructions for disabling key binding (#2943) 2023-10-16 10:46:01 +02:00
Zachary Yedidia
fbce241753 Docs for fakecursor option
Fixes #2908
2023-09-07 08:17:12 -04:00
taconi
75b9a6cefe
Add onSetActive callback (#2885)
Co-authored-by: taconi <igor.tacoi@protonmail.com>
2023-08-31 17:29:07 +01:00
Jan Katins
b02afb1116
Update copypaste.md (#2826)
Status page: https://wezfurlong.org/wezterm/escape-sequences.html#operating-system-command-sequences

Status at 20230521:

> Requests to query the clipboard are ignored. Allows setting or clearing the clipboard

Issue to support querying: https://github.com/wez/wezterm/issues/2050
2023-07-08 14:08:15 -07:00
Jöran Karl
e5bbeff8ac
plugins.md: Add (on|pre)Rune documentation (#2837) 2023-07-08 14:07:56 -07:00
Shreyas A S
51022e6162
Fixed a typo in keybindings.md (#2852)
A 'to' was missing. I noticed it while reading through the documentation.
2023-07-08 14:07:06 -07:00
Christian Muehlhaeuser
ffa7f987b6
Add 'scrollbarchar' option (#2342)
This lets you specify a character that will get used for rendering the
scrollbar.

Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
2023-07-08 14:02:01 -07:00
Ilya Grigoriev
651a30105b
Goto next/previous diff commands + minor cleanups (#2759)
* Comment fix & gofmt fix

* Goto next/previous diff commands

These commands will work in `git` repositories or whenever `set diff on` is
working. They are bound to `Alt-[` and `Alt-]` by default. I would prefer
`Alt-Up` and `Alt-Down`, but that's already taken.

There are no tests at the moment; I'm looking into writing some since that will
be needed for the rest of the plan to make
https://github.com/zyedidia/micro/discussions/2753 a reality. I'm not sure how
difficult that will be.

* Realign JSON in keybindings.md
2023-04-20 15:23:35 -07:00
Alan Hamlett
0500cc234d
util.HttpRequest helper to make requests with headers (#2678) 2023-01-30 01:29:06 -08:00
Dmitry Maluka
34ac83b594 Introduce mouse release and mouse drag events
Introduce separate mouse release and mouse drag (move while pressed)
events: MouseLeftRelease, MouseLeftDrag, MouseRightRelease etc,
to allow binding them to actions independently from mouse press events
(MouseLeft, MouseRight etc).

This change:

- Makes it possible to handle mouse release and drag for arbitrary mouse
  events and actions (including Lua actions), not just for MouseLeft as
  in the current code.

- Fixes issue #2599 with PastePrimary and MouseMultiCursor actions:
  selection is pasted not only when pressing MouseMiddle but also when
  moving mouse with MouseMiddle pressed; similarly, a new multicursor is
  added not only when pressing Ctrl-MouseLeft but also when moving mouse
  with Ctrl-MouseLeft pressed.

My initial approach was not to introduce new events for mouse release
and mouse drag but to pass "mouse released" info to action functions
in addition to *tcell.EventMouse to let the action functions do the
necessary checks (similarly to what MousePress is already doing). But
then I realized it was a bad idea, since we still want to be able also
to bind mouse events to regular key actions (such as PastePrimary)
which don't care about mouse event info.
2023-01-29 18:21:59 +01:00
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
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
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
Zachary Yedidia
986faa783b Add better explanation about find 2022-10-12 19:05:42 -07:00
Zachary Yedidia
957650c3ee Document FindLiteral default binding 2022-10-04 16:30:06 -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
Ben Hammond
585dcc7d19
Adds options for tab bar and tab color reversing (#2480)
* Adds options for tab bar and tab color reversing

* Fixes small bug with tabreverse, options now work fully as expected
2022-07-17 12:18:11 -07:00
0x5c
987e409071
Added lines and percentage statusbar directives (#2055)
- "lines" for the number of lines in the buffer
- "percentage" for the percentage of the file at the current line

Fixes zyedidia#2049
2022-02-22 01:31:32 -08:00
Philippe Eberli
fe59e18e69
Error in documentation of +LINE:COL (#2205)
Its +LINE:COL not +LINE,COL
2022-02-14 13:32:46 -08:00
Evan Shimoniak
9ca89ad300
Made apparent the functionality of the ftoptions plugin (#2321)
* 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`

* Added warning about ftoptions and tabstospaces

The current description for ftoptions states that it "alters some default options depending on the filetype", which hints at this behavior, but does not explicitly state it.

* Clarified specific functionality of ftoptions
2022-02-11 14:15:26 -08:00
Andrey Bienkowski
031d953ed5
Help: mention (un)indent in defaultkeys (#2358) 2022-02-11 14:13:35 -08:00
Reilly Wood
580c32bcef
Fix repo.json info in plugin docs (#2313) 2021-12-31 02:06:53 -05:00
Owen Valentine
cc0af275c1
Adjust default keybinding text (#2293)
Fixes #2287
2021-12-24 22:32:15 -05: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
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
Ryan Westlund
c2d7b62e8f
Fix #2190: Document goto command in commands.md (#2218) 2021-09-24 14:40:11 -07: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
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
Rylee
160a81c572
Add alcritty and foot to the list of OSC 52 supporting terminals (#2154) 2021-07-13 23:37:48 -04:00
Kethan
4b0db74770
Fix typo in tutorial.md (#2130) 2021-06-12 23:52:08 -04:00