Commit graph

932 commits

Author SHA1 Message Date
Zachary Yedidia
63b4848bb0 Make sure screen is not nil before pollevent
Ref #728
Ref #727
2017-07-10 18:04:11 -04:00
Zachary Yedidia
030a05c103 Always restart the screen when saving with sudo
Fixes #723
2017-07-08 15:13:42 -04:00
Zachary Yedidia
e4751fd84c Optimize search
Fixes #722
2017-07-08 15:03:35 -04:00
Zachary Yedidia
252def5b95 Fix recursive search and replace in special case
Fixes #717
2017-07-01 16:50:25 -04:00
Zachary Yedidia
42f2af7956 Print help text to stdout instead of stderr
Fixes #719
2017-07-01 16:49:08 -04:00
Zachary Yedidia
91fb8225d1 Add 'a' option in replace prompt
Closes #718
2017-07-01 16:47:50 -04:00
Zachary Yedidia
bee60023ae Optimize search and replace 2017-07-01 16:40:28 -04:00
Zachary Yedidia
8f4820ba28 Move cursor selections on Insert or Remove
Ref #715
2017-06-25 19:14:01 -04:00
Zachary Yedidia
19926d95fe Throw error if there is no detect regex
Closes #712
2017-06-22 10:42:06 -04:00
Zachary Yedidia
f27ee60149 Fix compilation errors 2017-06-21 14:37:30 -04:00
Zachary Yedidia
3908813afe Recover errors in highlight
Ref #712
2017-06-21 14:26:35 -04:00
Zachary Yedidia
e6f24b0924 Add new tcell commits 2017-06-20 17:47:39 -04:00
Zachary Yedidia
b2c1c8f8db Merge pull request #710 from HeavyHorst/master
fixed a panic when a line is cut out(strg+k) and the next line is empty.
2017-06-20 16:52:48 -04:00
Zachary Yedidia
5a2f9a374b Merge pull request #709 from mfxmfx/xterm-ctrl-pgup
Add support for xterm CtrlPgUp and CtrlPgDn keys.
2017-06-20 10:53:31 -04:00
Zachary Yedidia
59ab5107bf Add new commits to tcell (ctrlpageup/down) 2017-06-20 10:53:07 -04:00
Rene Kaufmann
06c65d8404 fixed a panic when a line is cut out(strg+k) and the next line
is empty.
2017-06-20 11:53:59 +02:00
Markus F.X.J. Oberhumer
d38055f825 Add support for xterm CtrlPgUp and CtrlPgDn keys. 2017-06-19 19:37:55 +02:00
Zachary Yedidia
4aeb4c78ac Merge 2017-06-18 15:39:50 -04:00
Zachary Yedidia
3741a71cc5 Check bounds on LastVisualX
Fixes #708
2017-06-18 15:38:33 -04:00
Zachary Yedidia
fc9ddaf941 Merge pull request #679 from alialaee/master
Find and replace one at a time
2017-06-18 12:13:43 -04:00
Zachary Yedidia
5ec08d0a29 Use correct separator on windows
Ref #673
2017-06-18 09:56:36 -04:00
Zachary Yedidia
da1ec3132f Update tcell 2017-06-17 23:02:22 -04:00
Zachary Yedidia
167f1e5770 Use the idle-wakeup-fix-forked branch of tcell 2017-06-17 22:54:05 -04:00
Zachary Yedidia
7e4ff05c57 Use submodules for dependency management 2017-06-17 17:52:28 -04:00
Zachary Yedidia
7ccec0e3f7 Merge pull request #704 from zyedidia/multiple-cursors
Multiple cursors
2017-06-17 17:39:31 -04:00
Zachary Yedidia
397361f23d Add multiple cursor docs + improve docs in general 2017-06-17 17:36:27 -04:00
Zachary Yedidia
681da2e90c Deselect with mouse
This commit also makes non editing actions (save, quit...) only execute
once even if there are multiple cursors.
2017-06-17 11:05:23 -04:00
Zachary Yedidia
118e6b1804 Merge cursors properly
Cursors will merge together if they are on top of each other.
2017-06-17 10:43:14 -04:00
Zachary Yedidia
f933b90c66 Get undo working properly with multiple cursors 2017-06-16 22:19:33 -04:00
Zachary Yedidia
21840d3ffe Make cursor movement automatic on insert + remove
This changes the behavior of cursor movement so that all cursors are
adjusted when a change is made to the buffer. Cursors don't have to be
manually moved after calling Insert or Remove, those functions will move
the cursor properly on their own.

This should fix issues 1-3 mentioned in the multiple cursors discussion.

Ref #5
2017-06-15 18:52:51 -04:00
Frank Braun
43eb238b08 Implement Spaces() with with strings.Repeat()
Shorter and more efficient.
2017-06-14 19:47:40 +00:00
Zachary Yedidia
00718f99cf Add ability to add cursors with Ctrl-MouseLeft
With the new code that allows binding mouse buttons this was remarkably
easy to add.

The new binding is:

    "Ctrl-MouseLeft": "MouseMultiCursor"

Note: A number of terminals don't support Ctrl-MouseLeft (macOS
especially) so you might want to rebind to MouseRight or MouseMiddle.
2017-06-12 20:25:10 -04:00
Zachary Yedidia
c3a73d63b8 Add comments 2017-06-12 20:25:10 -04:00
Zachary Yedidia
bc3c8eaf74 Use terminal cursor for the base cursor
If all cursors fake then that breaks support for things like
inserting japanese characters nicely, so fake cursors are now only used
as extra cursors.
2017-06-12 20:25:10 -04:00
Zachary Yedidia
8d268ef021 Remove debug messages 2017-06-12 20:25:10 -04:00
Zachary Yedidia
c45ff4dd4f Add multiple cursor support
This commit creates new keybindings and actions to handle multiple
cursors.

Here are the defaults:

    "Alt-n": "SpawnMultiCursor",
    "Alt-p": "RemoveMultiCursor",
    "Alt-c": "RemoveAllMultiCursors",
    "Alt-x": "SkipMultiCursor",
2017-06-12 20:25:10 -04:00
Zachary Yedidia
37ad137012 Properly show end of line selection 2017-06-12 15:49:21 -04:00
Zachary Yedidia
0165c4a40a Allow binding runes to actions
This new functionality would make it possible to emulate vim keybindings
pretty easily, for example.
2017-06-11 20:40:11 -04:00
Zachary Yedidia
3270acdd00 Add functionality for binding mouse buttons
This commit enables users to bind the mouse buttons (left, middle,
right buttons and the scroll wheel).

The default bindings now include the mouse bindings:

    "MouseWheelUp":   "ScrollUp",
    "MouseWheelDown": "ScrollDown",
    "MouseLeft":      "MousePress",
    "MouseMiddle":    "PastePrimary",

Mouse buttons can now also be bound to normal actions. For example:

    "MouseLeft": "Backspace"

This also means that plugins can access mouse event callbacks in the
standard way ('onAction').

More documentation for this will be coming soon.

Fixes #542
2017-06-11 17:49:59 -04:00
Zachary Yedidia
a1f6dd6f4f Update default colorscheme 2017-06-10 18:52:08 -04:00
Zachary Yedidia
cf92f91e1e Improve solarized-tc colorscheme 2017-06-07 12:41:20 -04:00
Zachary Yedidia
eeb2aaf9ae Merge 2017-06-04 19:17:08 -04:00
Zachary Yedidia
f84c9f3b5d More descriptive error for 'terminal entry not found' 2017-06-04 19:17:02 -04:00
Tommy
4644a2b5cc Check for readonly on viewtype and if true do not let any edits or paste to buffer. eg help and plugins. Finished needs checking. (#674)
* corrected spelling error and missing public function comments

* check for readonly and if true do not insert character

* mouse middle  click checks for view type readonly and does not paste if view is readonly

* check for view readonly with binding keys and if readonly do not change the content.
2017-05-29 14:18:10 -04:00
Zachary Yedidia
89863660ba Fix boolean logic order for hiding cursor
Fixes #684
2017-05-28 19:52:56 -04:00
Zachary Yedidia
624daabc02 Add support for zyedidia/Literate 2017-05-27 16:55:59 -04:00
Zachary Yedidia
05a187e470 Update runtime 2017-05-27 16:38:03 -04:00
ali
480a220fda Change replace command default behaviour to confirm replacement for each occurrences 2017-05-26 03:43:57 +04:30
Zachary Yedidia
6cf6857602 Add comment 2017-05-22 11:21:17 -04:00
Zachary Yedidia
97e2fb1288 Use messenger error instead of termerror 2017-05-21 10:46:06 -04:00
Zachary Yedidia
d1e70b5abf Add suspend for linux only 2017-05-21 10:44:33 -04:00
Zachary Yedidia
a70fb9db7d Test suspend code 2017-05-21 10:30:26 -04:00
Zachary Yedidia
f364965ac0 Create ftoptions option to disable auto settings
Closes #662
2017-05-19 18:17:38 -04:00
Zachary Yedidia
e7ee194acf Merge 2017-05-17 12:13:24 -04:00
Zachary Yedidia
6e5536eae9 Load colorscheme after loading plugins
Fixes #671
2017-05-17 12:12:58 -04:00
tommy
d8dee90c10 check viewtype before saving and if scratch is true then do not save 2017-05-15 20:00:58 +01:00
Zachary Yedidia
dcee63771a Merge 2017-05-14 10:27:37 -04:00
Zachary Yedidia
b7133b302b Don't remember path on save if it is invalid
Fixes #656
2017-05-14 10:27:15 -04:00
aerth
f6ccaadc0c
use space for indentchar if empty, fixes #660 2017-05-12 16:32:24 -07:00
Tommy
7c80de7ee1 Caps lock issue#658 (#659)
* caps-lock-issue #658

* when esc key is pressed the message is cleared away
2017-05-10 10:02:17 -04:00
Zachary Yedidia
ef0f506b6f Allow upper case in 'Save changes' prompt
Fixes #658
2017-05-09 14:46:23 -04:00
Zachary Yedidia
18f9b6f34e Add tabmovement option
This option makes micro treat spaces at the beginning of lines as if
they are tabs. This option only does anything if tabstospaces is already
on. E.g. micro will move over 4 spaces at once when at the start of a
line.

Closes #616
2017-05-05 12:04:18 -04:00
Zachary Yedidia
57110c98e4 Fix rare problem with tabs and horizontal scrolling 2017-05-05 11:34:14 -04:00
Zachary Yedidia
a6ee75a9cf Add SaveAll command and display + for modified tabs
Closes #651
2017-05-05 11:05:23 -04:00
Zachary Yedidia
8d1618692e Disallow view switching during a search
Closes #642

This commit also removes some unnecessary functions that weren't being
used.
2017-05-05 10:52:09 -04:00
Zachary Yedidia
960c6cae62 Properly draw split divider 2017-05-05 10:40:49 -04:00
Zachary Yedidia
67ec0d3c80 Correctly detect synatx ft from header 2017-05-03 11:04:56 -04:00
Zachary Yedidia
d3f32b5bc3 If softwrap is on the leftcol must be 0
Fixes #645
2017-05-02 20:12:37 -04:00
Zachary Yedidia
84e350aa6f Optimize memory usage for loading syntax files 2017-05-02 10:30:27 -04:00
Zachary Yedidia
80242f0e08 Update runtime 2017-04-29 16:01:51 -04:00
Zachary Yedidia
2a3ce12bd4 Add termtitle option and move autoclose utf8 code 2017-04-29 16:01:09 -04:00
Collin Warren
aed8ba105a Readded title setting. ( As per the tcell pull. ) (#600) 2017-04-29 15:51:31 -04:00
timon999
5ee774892a Make autoclose plugin work with Non-Ascii Unicode characters (#641)
* Make autoclose plugin work with Non-Ascii Unicode characters

* Removed lines that I forgot to remove
2017-04-29 15:44:36 -04:00
Zachary Yedidia
b4dda8bad8 Use less memory when opening very large files 2017-04-29 14:12:00 -04:00
Zachary Yedidia
47324aea97 Merge 2017-04-28 11:07:28 -04:00
Zachary Yedidia
def2b28d4e Differentiate between help buffers and log buffers
Closes #636
2017-04-28 11:07:05 -04:00
Zachary Yedidia
ab24523bff Fix problem with search and replace indices
Closes #637
2017-04-27 20:10:51 -04:00
Zachary Yedidia
b8debb5404 Merge pull request #585 from samdmarshall/add-yaml-linter
Add yaml linter
2017-04-22 18:53:11 -04:00
Zachary Yedidia
d0e39853c6 Fix issue with cursorline 2017-04-22 18:48:05 -04:00
Samantha Marshall
a0bfd99a5d
Updating changes to be in-line with master
Merging in master
2017-04-22 14:22:38 -04:00
Zachary Yedidia
471a8b7c2b Fix crash if tabs extend past view width
Ref #631
2017-04-21 12:48:03 -04:00
Zachary Yedidia
591e5e3145 Fix colorcolumn being ignored
Closes #627
2017-04-18 13:33:19 -04:00
Zachary Yedidia
282e7b1828 Merge pull request #626 from Necklaces/master
Added more default bindings:
2017-04-16 11:39:49 -04:00
Zachary Yedidia
007b060cbd Speed up search and replace
Ref #625
2017-04-16 11:11:04 -04:00
Zachary Yedidia
8168a75bde Slightly speed up search and replace
This commit also adds a linter for literate
2017-04-16 10:43:13 -04:00
Nichlas Severinsen
5afda4e76c Added more default bindings:
- Shift+Home for selecting to start of line
- Shift+End for selecting to end of line
These already exist as Ctrl+Shift+Left/Right-arrow
2017-04-16 15:34:44 +02:00
Zachary Yedidia
88c712b848 Allow plugins to create runtime files from strings 2017-04-15 14:45:44 -04:00
Zachary Yedidia
fca63d02f9 Update runtime 2017-04-15 12:02:01 -04:00
Zachary Yedidia
6458d3cac4 Don't draw cursorline at cursor position
Fixes #622

If the cursorline is drawn at the cursor's position, then the cursor
doesn't display. I'm not really sure why this is a problem with the
gnome terminal, it didn't seem to happen on earlier versions.
2017-04-13 21:37:13 -04:00
Zachary Yedidia
843867717c Merge 2017-04-02 09:27:25 -04:00
Zachary Yedidia
dd87769090 Fix TabSwitch to work by tab name as well 2017-04-02 09:27:04 -04:00
Zachary Yedidia
398370424b Relocate cursor on search
This commit also fixes some true color colorscheme issues

Fixes #614
2017-03-31 10:39:10 -04:00
Zachary Yedidia
be2d3c9c1e Read extra new line
Ref #603
2017-03-29 12:01:01 -04:00
Zachary Yedidia
05aa30d1be Improve html syntax rules 2017-03-29 10:08:37 -04:00
Zachary Yedidia
1c2b57dfe8 Add support for limit-group to highlights region limits 2017-03-29 09:54:54 -04:00
Zachary Yedidia
47ef864295 Add skip statements to all strings 2017-03-29 09:45:16 -04:00
Zachary Yedidia
a517ea45bd Slight improvements to included region highlighting 2017-03-29 09:25:08 -04:00
Zachary Yedidia
342f3c223d Don't skip included rules in end 2017-03-29 09:21:54 -04:00
Zachary Yedidia
079cbe11f4 Fix incorrect crystal filetype detection
Closes #608
2017-03-28 19:26:14 -04:00
Zachary Yedidia
3e61bd4d49 Improve some more region highlighting 2017-03-28 17:18:06 -04:00
Zachary Yedidia
b517ed28c0 Fix region highlighting with empty rules 2017-03-28 15:18:38 -04:00
Zachary Yedidia
299712ead3 Add support for skipping and remove need for lookbehind 2017-03-27 20:53:08 -04:00
Zachary Yedidia
c24f75999a Better unicode support in highlight 2017-03-27 19:35:28 -04:00
Zachary Yedidia
bde48c051a Fix out of bounds error on syntax highlighting
Fixes #606
2017-03-27 16:26:32 -04:00
Zachary Yedidia
d087a890ba Fix some issues with unicode syntax highlighting
Closes #604
2017-03-27 14:40:42 -04:00
Zachary Yedidia
75d4e70560 Document the keepautoindent option
Closes #602
2017-03-27 13:22:34 -04:00
Zachary Yedidia
73ab25d008 Properly handle files that don't end with newlines
Closes #603
2017-03-27 13:15:00 -04:00
Zachary Yedidia
47fd1475b5 Fix indent char styling
Closes #598
2017-03-27 11:45:24 -04:00
Zachary Yedidia
12d74b99e8 Merge branch 'master' into view-refactor 2017-03-26 20:40:03 -04:00
Zachary Yedidia
1350deae56 Fix small softwrap bug 2017-03-26 18:01:02 -04:00
Zachary Yedidia
df564e1b8b Update yaml syntax file 2017-03-26 17:45:58 -04:00
Zachary Yedidia
bb7ce4cbb3 Add memusage option to view memory usage 2017-03-26 17:37:04 -04:00
Zachary Yedidia
1655fde09b Fix precedence for python multi-comments 2017-03-26 17:24:02 -04:00
Zachary Yedidia
89d1f1c202 Proper unicode support 2017-03-26 17:20:53 -04:00
Zachary Yedidia
b23c507af5 Read one line for empty strings 2017-03-26 15:27:53 -04:00
Zachary Yedidia
15055440da Optimize how files are read into the buffer 2017-03-26 15:23:32 -04:00
Zachary Yedidia
e2b7c85955 Small optimization to state only highlighting 2017-03-26 13:03:43 -04:00
Zachary Yedidia
9c5ab2afbd Fix possible overflow error 2017-03-25 17:31:46 -04:00
Zachary Yedidia
d413562145 Add more performance and memory optimizations 2017-03-24 14:11:21 -04:00
Zachary Yedidia
87f54be13a Add support for lookbehind in region regexes
Use the 'regexp2' library for lookahead and lookbehind in region
start and end regular expressions to support things like closing quotes
that aren't preceded by backslashes.
2017-03-22 19:03:06 -04:00
Zachary Yedidia
bea1c5dc28 Fix another issue with horizontal scrolling 2017-03-22 12:28:02 -04:00
Zachary Yedidia
04b4dbbfee Improve performance on long lines 2017-03-22 11:58:43 -04:00
Zachary Yedidia
d55e7319da Fix small bug 2017-03-21 15:46:06 -04:00
Zachary Yedidia
54bb99d758 Improve new syntax files and fix a region glitch 2017-03-21 15:07:39 -04:00
Zachary Yedidia
b0e287498e Update runtime 2017-03-21 13:16:08 -04:00
Zachary Yedidia
8a33c98bc6 Support rule precedence just like the old format 2017-03-21 13:15:46 -04:00
Zachary Yedidia
59bf1a2260 Optimize the memory usage for syntax highlighting 2017-03-21 12:45:27 -04:00
Zachary Yedidia
214adcf611 Properly clear syntax highlighting when it is disabled 2017-03-20 17:40:33 -04:00
Zachary Yedidia
23152f0c50 Use bytes for highlight groups 2017-03-20 15:14:04 -04:00
Zachary Yedidia
2a4abbee24 Fix larger multiline region highlighting 2017-03-16 16:38:44 -04:00
Zachary Yedidia
f637268fa7 Fix small issue with regions 2017-03-16 13:15:12 -04:00
Zachary Yedidia
ea7f90713c Fix some small glitches with cursor positioning 2017-03-13 19:23:47 -04:00
Zachary Yedidia
53a19afe52 Fix error when opening directory
Fixes #587
2017-03-11 13:08:32 -05:00
Zachary Yedidia
ed6951a653 Check if file is dir before opening
Fixes #587
2017-03-09 12:56:24 -05:00
Zachary Yedidia
2e99f52133 Fix split divider style 2017-03-09 12:40:53 -05:00
Zachary Yedidia
da5542a557 Fix findNext and findPrevious with certain regexes
Fixes #576
2017-03-05 11:20:42 -05:00
Zachary Yedidia
253e86230c Build runtime 2017-03-03 11:49:53 -05:00
CaptainMcClellan
9f9b5def41 Added theming to the Vsplit divider. (#578)
* Added title setting (Requires tcell pull!) and optimized tab display.

* Changed tcell call to screen.

* Fixed bad reference for getting Buffer name.

* Themeable vsplit divider.

* Bugfix.
2017-03-03 11:48:51 -05:00
Zachary Yedidia
ab74e56a40 Revert "Added title setting (Requires tcell pull!) and optimized tab display." (#581) 2017-03-03 11:43:44 -05:00
Zachary Yedidia
98365b6bfb Fix block indent selection
Fixes #572
2017-03-02 19:46:23 -05:00
CaptainMcClellan
57c030d3b9 Added title setting (Requires tcell pull!) and optimized tab display. (#575)
* Added title setting (Requires tcell pull!) and optimized tab display.

* Changed tcell call to screen.

* Fixed bad reference for getting Buffer name.
2017-03-02 12:27:49 -05:00
Zachary Yedidia
6df2d7d822 Update runtime 2017-03-01 17:09:09 -05:00
Zachary Yedidia
995a910f6a Update runtime
Also made a minor addition to ruby.micro which fixes #574.
2017-03-01 09:36:41 -05:00
CaptainMcClellan
c29e58e3d4 Syntax Highlight Overhaul (#568)
* Adds new syntax groups and docs
* Large refactor of syntax highlighting files

* Changed keybindings for changing tabs.

* Improved the documentation.

* Added F3 for find to default bindings.

* Massive overhaul of the syntax files

* Phase 1 color-scheme updates.

* The new colorschemes.

* Colorscheme and syntax updates.

* Tiny fix to the cmc theme.

* Another phase of colorschemes and testing gitconfig.

* Fixed haskell error

* Fortran fix

* Delete test.txt

Heh, sorry about forgetting to do this again.
2017-03-01 09:30:35 -05:00
Zachary Yedidia
bd0c5c655e Add more syntax files and include syntax highlighter in the repo 2017-02-26 11:14:35 -05:00
Zachary Yedidia
e6e190942c Minor fixes 2017-02-26 11:14:35 -05:00
Zachary Yedidia
25ad139675 Remove old view code 2017-02-26 11:14:35 -05:00
Zachary Yedidia
a095644731 Minor fix to tab size 2017-02-26 11:14:35 -05:00
Zachary Yedidia
f197eca320 Improve horizontal scrolling 2017-02-26 11:14:35 -05:00
Zachary Yedidia
d602cb68ca Support include statements in syntax files 2017-02-26 11:14:35 -05:00