Commit Graph

5398 Commits

Author SHA1 Message Date
Maxime Coste
40f845d77e Respect scroll offset even when wrapping lines
Fixes #1433 although in a slightly different way than requested:
We ensure that scrolloff *displayed* lines are visible below the
cursor, not scrolloff *buffer* lines.
2017-06-15 12:29:34 +01:00
Dan Skorupski
f8c9aeff3d Update Homebrew install tip in README
Homebrew advises not using homebrew/dupes anymore:

% brew install homebrew/dupes/ncurses
Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
...
Warning: Use ncurses instead of deprecated homebrew/dupes/ncurses

John Doe Copyright Waiver

I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2017-06-15 00:10:55 -05:00
Maxime Coste
e73cd78288 Fix corner case in C family indenting 2017-06-13 10:19:38 +01:00
Maxime Coste
98627726cf Always store InclusiveBufferRange with first < second
Closes #1434
2017-06-13 09:00:55 +01:00
Maxime Coste
ab56be090a minor style tweak 2017-06-12 06:12:10 +01:00
Maxime Coste
208b28cbe7 Simplify a bit buffer iteration functions
Dont try to ensure the returned value is valid, incrementing past
the end/decrementing before begin is the caller's error.
2017-06-12 06:10:18 +01:00
Maxime Coste
250886a9e1 Use read_fd to get pipe command from stdin instead of ad-hoc code
read_fd will also now throw on read error instead of just returning
the data read so far as if nothing failed.
2017-06-12 05:21:34 +01:00
Maxime Coste
398b2b115c Merge remote-tracking branch 'lenormf/fix-tmpdir-modules' 2017-06-12 05:06:14 +01:00
Maxime Coste
7bcfbd055c Fix corner case in compute_modified_ranges 2017-06-11 12:25:12 +01:00
Maxime Coste
63a791d651 Fix the Buffer::end() madness
Until now, buffer had multiple recognized end coordinates, either
{ line_count, 0 } or { line_count - 1, line[line_count - 1].length }.

Now the only correct end coord is { line_count, 0 }, removing the need
for various special cases.
2017-06-11 12:01:40 +01:00
Maxime Coste
b4647a16dd Remove backup file from git 2017-06-09 21:30:40 +01:00
Maxime Coste
be964e7477 gitignore backup files 2017-06-09 21:30:23 +01:00
Maxime Coste
d86a612774 Fix wrapping support 2017-06-09 16:00:22 +01:00
Maxime Coste
0dec1e3a91 Remove unused only_buffer mode for DisplayLine::trim 2017-06-09 15:30:13 +01:00
Maxime Coste
7b9d8d39b1 Simplify column highlighter and make it more robust
Fixes #1382
2017-06-09 15:24:07 +01:00
Maxime Coste
3612eb50e5 Fix bug in word completer
A bug could be triggered in the word completer when a multiselection
would trigger word completion with one selection being at buffer first
character.
2017-06-09 14:21:18 +01:00
Maxime Coste
64aa6f3fb4 Proper linear time insert completion insertion
The previous solution, ad9b090ddf, was
failing when completion was not replacing any text, as going through
SelectionList was not permitting to replace empty ranges.

Handle replacement as first a deletion then an insert to get fast
update, as having a list of forward deletions and then a list
for forwad insertion is much faster to update than a list of
interleaved delete/insert.
2017-06-09 14:13:43 +01:00
Maxime Coste
f310db639c Rework partial line display logic
Instead of highlighting full lines and then trim them to make them
fit in the window, highlight only the visible portion, and rely on
the compute_display_setup system introduced for wrapping to setup
our buffer range correctly
2017-06-09 13:22:32 +01:00
Frank LENORMAND
d113d5232a rc jedi: Don't create an unused debug/log file 2017-06-09 14:30:58 +03:00
Frank LENORMAND
813d09a101 rc: Fix calls to mktemp
Allow `mktemp` to make use of the `TMPDIR` environment variable when
calling it with a template.

Don't use the deprecated `-t` flag.
2017-06-09 14:30:54 +03:00
Maxime Coste
e145d05e34 Add some unit tests for horizontal scrolling with tabulations 2017-06-09 11:49:54 +01:00
Maxime Coste
c54c8c05bf Add horizontal/vertical scrolling display tests 2017-06-09 10:55:17 +01:00
Maxime Coste
fb81b1bc86 Rename 'unit' test directory to 'normal' as they are the normal mode tests 2017-06-09 10:48:37 +01:00
Maxime Coste
242f951c84 More explicit and simpler code 2017-06-09 09:54:18 +01:00
Alex Leferry 2
105b35192f Add Alacritty 2017-06-08 19:02:44 +02:00
Maxime Coste
fe46c05685 Remove spurious double underscore 2017-06-08 10:37:48 +01:00
Maxime Coste
2b5fafa909 Do not show startup info when piping into kak
Fixes #1340
2017-06-08 10:03:07 +01:00
Maxime Coste
ad9b090ddf Fix quadratic behaviour in when selecting an insert completion
Use the fast, linear time SelectionList::insert algorithm instead of
an ad-hoc one that needs to call SelectionList::update after each
modification of the buffer.

Fixes #1417
2017-06-08 09:55:34 +01:00
Maxime Coste
4ab40af3a9 Disable idle timers on all transient contexts 2017-06-08 09:53:23 +01:00
Maxime Coste
609b0bbbac Merge remote-tracking branch 'Delapouite/rotate-forward' 2017-06-08 07:14:20 +01:00
Maxime Coste
eadf8930fb Add -width <max_width> support in the wrap highlighter
Will always wrap at the minimum between max_width and actual window
width.

Fixes #1424
2017-06-08 07:05:44 +01:00
Maxime Coste
acc2dbf79c Move variable closer to its point of use 2017-06-07 20:33:34 +01:00
Maxime Coste
56b52bdb3d Filter debug buffers before creating the SafePtr vector in -buffer * 2017-06-07 20:25:39 +01:00
Maxime Coste
e947c20ce0 Do not disable incsearch option in context wrap
It will only trigger on idle, which should not happen during non-
interactive contexts.
2017-06-07 20:24:37 +01:00
Maxime Coste
03f8679e5c Only trigger PromptEvent::Change on idle
There is no need to trigger that event on every keystroke, we can
trigger it only when we hit the idle timeout, avoiding computations
when input keys are pasted.
2017-06-07 20:16:19 +01:00
Maxime Coste
b81500c0e4 Use microseconds instead of milliseconds for built-in profiling 2017-06-07 20:06:47 +01:00
Maxime Coste
1c0bdd8c85 Run BufCreate hook *before* Buf{Open,New}File 2017-06-07 19:46:43 +01:00
Maxime Coste
4495aefea6 Use range based find_if wrapper for finding shell env vars 2017-06-07 19:46:16 +01:00
Maxime Coste
d9b1ee13d9 Change merge_overlapping to guarantee we dont break the sorting
In certain cases, we could end up with a unsorted selection list,
leading to broken invariant.
2017-06-07 19:30:44 +01:00
Maxime Coste
1d4093bcdc Fix memory errors due to sharing the MatchResults in the Hooks struct
A hook execution triggered by another hook execution would change the
shared MatchResults object, which is a wrong behaviour and makes it
point to dead string data.
2017-06-07 19:18:15 +01:00
Maxime Coste
575e6fe325 Remove unneeded unknown_expand exception type 2017-06-07 19:01:26 +01:00
Maxime Coste
b7982c6ee3 Use range based accumulate wrapper instead of std::accumulate 2017-06-07 13:36:47 +01:00
Maxime Coste
a0d848da8d Do not allow whitespaces as % string delimiters 2017-06-07 13:09:45 +01:00
Maxime Coste
81118552c8 Fix missing hook removal command in c-family.kak 2017-06-07 12:44:00 +01:00
Maxime Coste
f0285a8e60 Move hook executing logic into HookManager
The existing HookManager was able to run arbitrary hook functions,
but in practice was only used for user provided textual hooks.

That separation was causing some suboptimal performances, by moving
that logic directly in the hook manager we can improve hook filtering
performance which is a big part of startup time when opening lots
of files.
2017-06-07 12:33:39 +01:00
Maxime Coste
4606453fed Avoid expensive copies of Hooks in HookManager::run_hooks
Use a deferred deletion mechanism to ensure hooks are kept alive
for the duration of run_hooks.
2017-06-07 12:15:16 +01:00
Maxime Coste
87477cf2bb Move NestedBool to utils.hh 2017-06-07 11:55:42 +01:00
Maxime Coste
21da24235a Small style tweak 2017-06-07 11:40:13 +01:00
Maxime Coste
5a5d2ad7cb noexcept-ify utf8::iterator methods 2017-06-07 10:58:49 +01:00
Maxime Coste
cb6ef4afb6 noexept-ify BufferIterator methods 2017-06-07 10:58:01 +01:00