Maxime Coste
6a97455b3b
Do not push a final spurious command separators when parsing commands
...
Fixes #1336
2017-05-08 11:46:03 +01:00
Maxime Coste
ad1175fefc
Update wrap highlighter docstring
2017-05-08 11:30:51 +01:00
Maxime Coste
b0b40485ce
Move SimpleHighlighter as an implementation detail
2017-05-08 11:29:23 +01:00
Maxime Coste
a5d4dbc16e
Fix unneeded and wrong splitting of display atom during wrapping
2017-05-07 16:26:14 +01:00
Maxime Coste
e63156bcfb
Fix infinite loop with longer than width words in word wrap mode
2017-05-07 16:26:14 +01:00
Maxime Coste
4e9193a975
Slight highlighting related code cleanup
2017-05-07 16:26:14 +01:00
Maxime Coste
b4b08d10b4
Fix assert when wrapping a line that takes more than the full window height
2017-05-07 16:26:14 +01:00
Maxime Coste
17b19dc057
Ensure window position line is inside buffer
2017-05-07 16:26:14 +01:00
Maxime Coste
ff15f6bbaf
Document the wrap highlighter
2017-05-07 16:26:14 +01:00
Maxime Coste
4032d05c79
Reject 0 wrap column
2017-05-07 16:26:14 +01:00
Maxime Coste
8dd808726d
Add support for word wrapping with the -word switch to the wrap highlighter
2017-05-07 16:26:14 +01:00
Maxime Coste
bb17fb6dd3
Add a -passes
switch support for the group highlighter
2017-05-07 16:26:14 +01:00
Maxime Coste
fa5ae65f3a
Move passes logic to the base Highlighter class
...
Validate that childs of HighlighterGroup are matching its passes.
2017-05-07 16:26:14 +01:00
Maxime Coste
55631c8d8e
Detect errors while parsing flag line and handle them
...
Fixes #1345
2017-05-07 16:26:14 +01:00
Maxime Coste
053544d740
Disable horizontal scrolling when running a WrapHighlighter
2017-05-07 16:26:14 +01:00
Maxime Coste
23e38a254f
Introduce a LineNumberWrapped face
2017-05-07 16:26:14 +01:00
Maxime Coste
39826afde5
Make scrolling around work more correctly with wrapping
2017-05-07 16:26:14 +01:00
Maxime Coste
bd3ba77e96
Make Wrap highlighter only wrap on window width.
2017-05-07 16:26:14 +01:00
Maxime Coste
5ee21ec932
Respect tabstop in Buffer::offset_coord
2017-05-07 16:26:14 +01:00
Maxime Coste
57c2b32d20
Introduce highlighting phases and display setup computation
...
Highlighters now run in 3 phases:
Wrap, Move, and Colorize. That way we guarantee the wrap
highlighter runs first, then eventual line numbers/flags,
and finally the colorizers.
We also run a `compute_display_setup` method thats responsible
for computing the lines that will be displayed, eventually
scrolling the view to ensure the cursor is visible.
2017-05-07 16:26:14 +01:00
Maxime Coste
a4f9e29d60
Add a wrap highlighter
2017-05-07 16:26:14 +01:00
Maxime Coste
93408e4b76
Do not use any display information to determine where the cursor moves
2017-05-07 16:26:14 +01:00
Maxime Coste
3a3144f3f5
Fix use of invalidated iterator in the command map on exception
...
The command map can get mutated by command execution, so the iterators
can get invalidated (now that we use our curstom HashMap implementation,
all iterators are potentially invalidated by insert/removal)
2017-05-07 16:25:34 +01:00
Maxime Coste
c5824fc506
Merge remote-tracking branch 'lenormf/fix-readme-debian'
2017-05-07 14:47:14 +01:00
Frank LENORMAND
4e3f89972d
doc: Remove Debian from the list of distributions
2017-05-06 19:00:13 +03:00
Frank LENORMAND
495217edf9
doc: Document guidelines about writing kak scripts
2017-05-06 18:45:21 +03:00
Frank LENORMAND
9f62c1a552
rc: Use $SHELL instead of spawning bash
arbitrarily
2017-04-30 13:38:32 +03:00
Maxime Coste
97f7f9aff9
Merge remote-tracking branch 'lenormf/fix-doc-X'
2017-04-25 18:02:26 +01:00
Maxime Coste
80f1056851
Support appending selections to empty register
...
Fixes #1332
2017-04-25 17:25:44 +01:00
Frank LENORMAND
0b8937a459
doc: document the X
key
2017-04-25 11:39:50 +03:00
Maxime Coste
0dc16b8c31
Merge remote-tracking branch 'lenormf/fix-doc-lang'
2017-04-24 09:07:53 +01:00
Maxime Coste
26a105b2b7
Style tweak in highglighters.cc
2017-04-24 07:04:15 +01:00
Maxime Coste
e264d189eb
Add noexcept specifiers to unicode and utf8 functions
2017-04-23 12:47:26 +01:00
Maxime Coste
caed8a55c7
Set stdin to /dev/null instead of closing it when we dont have data to pipe to child
...
Fixes #1330
Fixes #1331
2017-04-22 09:39:55 +01:00
Frank LENORMAND
41822f630c
doc: Fix some issues in spelling, grammar and punctuation
2017-04-21 13:59:38 +03:00
Maxime Coste
e722868c60
Fix generation of empty erase changes
...
Fixes #1308
2017-04-20 17:31:27 +01:00
Maxime Coste
ab3a255d58
Merge remote-tracking branch 'lenormf/command-force-write'
2017-04-20 16:25:24 +01:00
Maxime Coste
dbcddafbfd
Change utf8::to_next/to_previous so that they are more symetrical
...
The previous implementation could yield different positions when
iterating forward and backward, leading to confusion in boost regex.
This makes an existing problem a bit more visible: iterating with
to_next and with read_codepoint wont behave the same way, as
read_codepoint will put the iterator onto the byte following the
utf8 codepoint, whereas to_next will put it on the next utf8
character start byte, which might be different if the buffer content
is not valid utf8.
Fixes #1195
2017-04-20 16:18:49 +01:00
Frank LENORMAND
51ab59cd36
src: Implement a write!
command
...
This commit allows "forced" writes to a write-protected file, by
attempting to temporarily grant the current user write permissions on
it. After the buffer has been written, the previous permissions are
restored if the file existed, or set to 0644 otherwise.
2017-04-20 17:13:42 +03:00
Maxime Coste
30e6387071
Assume filename passed to write_buffer_to_file is already parsed
2017-04-20 09:55:56 +01:00
Maxime Coste
5103b15b84
Safer code for parsing commands
...
Fix some possible past the end of target string reads
Fixes #1310 (maybe, probably, who knows)
2017-04-19 22:04:03 +01:00
Maxime Coste
34bf8c23e1
Fix uninitialised value for cursor mode
2017-04-19 21:23:16 +01:00
Maxime Coste
bee2180da7
Do not try to split non range atoms in column highlighter
...
That means we wont have a very nice interaction between show_whitespaces
and column highlighters, but thats the simplest fix for now, if we want
a better behaviour we need to introduce a way to know that a replaced
range is splittable (meaning it means to have the same amount of columns
as the range it replaces)
Fixes #1275
2017-04-19 21:15:36 +01:00
Maxime Coste
0d8b850bc3
Merge remote-tracking branch 'lenormf/doc-mapping'
2017-04-19 14:46:48 +01:00
Frank LENORMAND
fd874dabae
doc: Write a dedicated "mapping" page
...
Closes #1189
2017-04-18 16:59:52 +03:00
Frank LENORMAND
9a138af17f
rc: Properly modify tmux
's environment with env
2017-04-17 22:55:37 +03:00
Maxime Coste
52ffa98787
When not sending data to a subprocess, close its stdin
...
We were letting stdin untouched, which meant child processes had
access to our terminal input. That meant `!fmt` was trying to read
from our terminal input and catching keystrokes.
Fixes #1281
2017-04-17 20:39:24 +01:00
Maxime Coste
7482d117cc
Fix tests after addition of the set_cursor UI method
2017-04-12 10:48:52 +01:00
Maxime Coste
376449f28a
Add documentation for the set_cursor ui call in json_ui.asciidoc
2017-04-12 10:46:27 +01:00
Maxime Coste
91bfd714e4
Place hardware terminal cursor at the current main cursor/prompt cursor position
...
Fixes #1318
Also fixes https://gitlab.com/gnachman/iterm2/issues/5408
2017-04-12 10:39:17 +01:00