Commit graph

2802 commits

Author SHA1 Message Date
Zachary Yedidia
005442a4d0 Merge 2021-06-17 17:11:35 -04:00
Zachary Yedidia
6c666190e2 Update zyedidia/pty from upstream
Fixes #2138
2021-06-17 17:10:59 -04:00
vandervoortj
9ceb69921a
Add nix language syntax (#2024)
* Create nix.yaml

Add nix language syntax

* Add nix-linter
2021-06-15 17:56:31 -04:00
Kethan
4b0db74770
Fix typo in tutorial.md (#2130) 2021-06-12 23:52:08 -04:00
Dmitry Maluka
3bfd367d87
find: select prefilled text (#2127)
The new feature of prefilling the search bar with the selected text (added
in 3d0b5db) has an annoying side effect: if we do have some text selected
but we want to search for some other pattern, not the selected text,
then we have to manually delete the prefilled text before we can start
entering our wanted search pattern.

A simple solution is to select the prefilled text, so that we can replace it
with our pattern right away just by typing, without any additional keystrokes.
2021-06-09 17:04:11 -04:00
Balló György
6d5beb50ba
Add desktop-id to Appstream Metainfo (#2122)
It's needed for tools like appstream-generator to detect the associated desktop file.
2021-06-06 17:53:33 -04:00
Ali Kefia
3d0b5db2e4
find: prefill with selection (#2115)
* find: prefill with selection

* keep search func - could be used in plugins
2021-06-02 16:04:31 -04:00
Jeff Zhao
ee9c78dc86
Improve linter performance (#2083)
Only compute args if we are actually going to use it
2021-06-01 19:34:10 -04:00
Rosetta H&S
b66ec2bf7a
Add highlighting for user-defined types (#2107)
* Added highlighting for user-defined types

Provides automatic highlighting of user-defined types ending with either "_t" or "_T", as is seen in editors such as Nano, or within GitHub itself.

* Update cpp.yaml
2021-06-01 19:33:40 -04:00
Héctor M. Monacci
2dc2cabe0e
Dont take # as comment when preceded by backslash (#2112)
When escaped with a backslash (e.g., inside a regex) the numeral char, ```#```, shouldn't be interpreted as a beginning of comment.
2021-06-01 19:33:06 -04:00
Zachary Yedidia
56c7744e23 Fix erlang comment syntax 2021-05-31 20:26:32 -04:00
Zachary Yedidia
9bc32d4be9 Update tcell
Fixes #2108
2021-05-24 01:43:11 -04:00
Zachary Yedidia
0b0c99f1f5 Warn for readonly instead of setting option
Fixes #2106
2021-05-19 14:58:00 -04:00
Zachary Yedidia
6bc498e625 Update tcell
Fixes #2081
2021-05-16 16:35:47 -04:00
Zachary Yedidia
346c10f20e
Merge pull request #2076 from dmaluka/softwrap-improvement2
Softwrap improvements
2021-05-11 20:36:23 -04:00
Zachary Yedidia
86df9ad3b0 Merge 2021-04-20 21:28:37 -04:00
Zachary Yedidia
0851499130 Handle SIGHUP properly
Fixes #2085

Not the nicest solution but it will do for now.
2021-04-20 21:27:59 -04:00
Dmitry Maluka
88c95c8fae Fix up X,Y values in BufView
Let's return absolute X, Y values, rather than relative to the bufwindow.
2021-04-09 01:48:58 +02:00
Dmitry Maluka
aaac60a78d Replace BufWidth & BufHeight with BufView
BufView returns not only the buffer's width and height but also its
x,y position. It may be useful e.g. for checking if a mouse click was
on the actual buffer or ourside it, e.g. on the gutter.
2021-04-08 23:54:18 +02:00
Dmitry Maluka
ab6ce444a7 Don't highlight padding spaces in word wrapping
Don't highlight space characters at the right edge which are used just
for padding after line break in word wrapping, i.e. don't correspond to
any real characters in the buffer.

This makes it look nicer e.g. when selecting word-wrapped text.
2021-04-08 23:54:14 +02:00
Dmitry Maluka
965e43ebf1 Implement word wrapping
Fixes #264
Fixes #1644
2021-04-08 23:54:10 +02:00
Dmitry Maluka
f2613eeb3b Simplify LocFromVisual implementation
Now that we have LocFromVLoc, we can radically simplify the code of LocFromVisual.
Less duplication, less potential bugs.
2021-04-08 23:54:06 +02:00
Dmitry Maluka
6d13710d93 Implement moving cursor up/down within a wrapped line
Modified behavior of CursorUp, CursorDown, CursorPageUp etc:
if softwrap is enabled, cursor moves by visual lines, not logical lines.

TODO: implement it also for Home and End keys: move cursor to the
visual start or end of a line. I haven't implemented it for now, because
I'm not sure what should be the behavior of StartOfTextToggle then
(considering that Home key is bound to StartOfTextToggle by default).

Fixes #1598
2021-04-08 23:54:02 +02:00
Dmitry Maluka
7a3d1e6e30 Add VLoc, VLocFromLoc and LocFromVLoc
VLoc allows any location in the buffer to be represented as a visual
location in the linewrapped buffer. In particular, this is useful
for implementing moving cursor up and down within a wrapped line.
2021-04-08 23:53:57 +02:00
Dmitry Maluka
0487db8b99 Fix horizontal scrolling with a wide rune at the right edge of window 2021-04-08 23:53:53 +02:00
Dmitry Maluka
cd7ab640c5 Fix displaying incomplete tab or wide rune at the right edge of window
Fix displaying tabs and wide runes which don't fit in the window.
Don't overwrite the vertical divider and the adjacent window.

- For tabs: display only as many of the tab's spaces as fit in the window.

- For wide runes: if a rune doesn't fit, don't display it in this line at all.
  If softwrap is on, display this rune in the next line.

Fixes #1979
2021-04-08 23:53:49 +02:00
Dmitry Maluka
a1651aec2f Fix horizontal scrolling issue after toggling softwrap on/off
Fixes #645
2021-04-08 23:53:44 +02:00
Dmitry Maluka
c960c93a83 Add BufWidth and BufHeight
Fixes issue with the usage of a slightly incorrect buffer height value
(v.Height should be v.Height-1 if statusline is displayed).

Also, to avoid too many duplications, the code reorganized a little:
buffer display params (width, height, gutter offset and others) are
calculated in a single place.
2021-04-08 23:53:40 +02:00
Alex Tsantilis
f1aaa30743
Update and rename perl6.yaml to raku.yaml (#1927)
The language has been renamed but still aims to support the old file extensions for a time.
2021-04-07 16:21:19 -04:00
Laszlo Gombos
9ed3525076
Improve patch file detection by adding a header rule. (#1942) 2021-04-07 16:20:57 -04:00
Dmitry Maluka
1f73f8587c
Add buffer.WordAt (#2070)
Add buffer.WordAt function returning the word around a given location
in the buffer. Useful for plugins.
2021-04-07 16:20:39 -04:00
Dmitry Maluka
c5798b5b8c
Fix softwrap scrolling issues (#1981)
Softwrap implementation enhanced to fix various issues with scrolling,
centering, relocating etc.

The main idea is simple: work not with simple line numbers but
with (Line, Row) pairs, where Line is a line number in the buffer
and Row is a visual line (a row) number within this line.
The logic remains mostly the same, but simple arithmetic operations
on line numbers are replaced with corresponding operations on
(Line, Row) pairs.

Fixes #632, #1657
2021-04-07 16:18:51 -04:00
Zachary Yedidia
6f949fe985 Merge 2021-03-08 13:11:08 -05:00
Zachary Yedidia
2d5fc15990 Update runewidth version
Fixes #1873
2021-03-08 13:10:52 -05:00
Zachary Yedidia
3c00d20ccc Update snap badge 2021-03-05 20:57:31 -05:00
Zachary Yedidia
ae114a766c Merge 2021-03-02 17:16:54 -05:00
Zachary Yedidia
6761bdf8aa Fix noregex interactive replace
Fixes #2052
2021-03-02 17:16:19 -05:00
Zachary Yedidia
c014af9280 Add ForceQuit action
Closes #1039
2021-03-01 21:55:49 -05:00
Dmitry Maluka
de8f4bf72f
Fix regressions in buffer settings initialization (#2035)
Fix regressions after ba98b55:

- Unable to override filetype autodetection by setting a specific filetype
  for specific files, i.e. this doesn't work:

    "*.h": {
        "filetype": "c++"
    },

- Unable to enable/disable syntax highlighting for specific files,
  i.e. this doesn't work:

    "*.c": {
        "syntax": false
    },

- "readonly" setting doesn't work (neither global nor per-filetype).
2021-02-22 18:18:37 -05:00
Zachary Yedidia
975e78d9c0 Remove conf highlighting (too many conflicts)
Fixes #2031

The conf highlighter interferes with many more specific highlighters and
doesn't provide much value on its own.
2021-02-20 14:27:58 -05:00
Zachary Yedidia
8aadf6af65 Fix #2030: warn for invalid pane type 2021-02-18 19:02:23 -05:00
relrelb
6c694a1db4
Improve C syntax highlighting (#2015) 2021-02-17 22:28:19 -05:00
Nikolay Korotkiy
261eb41912
Add Gemini syntax file (#2016) 2021-02-17 22:27:56 -05:00
Sebastian Kolind Sørensen
d7abc8f100
Add .tsx support for Typescript syntax (#2021)
* Update to look for tsx files also

* Shorten filename detection
2021-02-17 22:27:45 -05:00
ejose19
a36ab0188a
docs: update Arch Linux installation method (#2028) 2021-02-17 22:27:13 -05:00
Zachary Yedidia
ba98b558d9 Only initialize buffer settings once
Ref #2009
2021-02-07 13:14:40 -05:00
Zachary Yedidia
c21b85929f gofmt 2021-01-27 22:52:40 -05:00
Zachary Yedidia
c1e0e1d3b6 Merge branch 'ilius-PR-find-on-type' 2021-01-27 13:49:47 -05:00
Zachary Yedidia
c3a17a71be Rename to incsearch 2021-01-27 13:49:38 -05:00
Zachary Yedidia
120cd02b30 Merge branch 'PR-find-on-type' of https://github.com/ilius/micro into ilius-PR-find-on-type 2021-01-27 13:48:01 -05:00