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
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.
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
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
This commit allows a help message to be printed when a `-help` flag is
passed to the editor, which will subsequently quit after a summary and a
description of all the flags available have been displayed.
The GNU convention (passing a single `--help` argument to the program)
is also supported, although undocumented.
The man page also now documents the `+:` argument, although unrelated to
the original changeset.
This commit allows the user to chose to backup the files on which a
filter has been run, by specifying a suffix for the backup file. The
former implementation always backed up the files with a hardcoded
".kak-bak" suffix.
When no suffix is specified on the command line, the files are not
saved.
Fixes#1288
This commit allows the editor to consider the character under the cursor
as an opening delimiter when using an object selector, instead of
ignoring it and looking for one before the cursor.