Commit Graph

3592 Commits

Author SHA1 Message Date
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
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
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
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
Maxime Coste
80dd9ec4cb Name key '+' as plus and '-' as minus 2017-04-11 10:47:15 +01:00
Maxime Coste
413d8b7ddd Change multi modifier key syntax to be <c-a-space> instead of <ca-space>
Better fix for #1311
2017-04-11 10:44:14 +01:00
Maxime Coste
112bd156e4 Merge remote-tracking branch 'lenormf/fix-filter-backup-suffix' 2017-04-10 21:39:24 +01:00
Maxime Coste
c1c40a4b56 Remove some now unneeded uses of const String& params
HashMap supports finding String from StringView.
2017-04-10 21:33:20 +01:00
Maxime Coste
a4b82131e5 Add support for parsing multiple modifiers in keys
<ca-key> means control+alt key, <ac-key> works as well.
Fixes #1311
2017-04-10 21:19:56 +01:00
Frank LENORMAND
16068321c1 src: Support the -help flag
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.
2017-04-10 22:23:30 +03:00
Maxime Coste
94145f2a89 ncurses: When hiding the menu, recompute the info position 2017-04-04 08:36:21 +01:00
Maxime Coste
6ad2f721dd Do not disable autoinfo and autoshowcompl in non interactive context
Fixes #1303
Fixes #1152
2017-04-03 18:16:32 +01:00
Maxime Coste
f31e898f13 Change prompt completion to only update when idle 2017-04-03 18:11:09 +01:00
Maxime Coste
055ed5ff7e Expose hook params regex captures in hook_param_capture_N 2017-03-30 11:31:07 +01:00
Maxime Coste
2cfe3cae36 Add an InsertDelete hook 2017-03-30 10:38:56 +01:00
Maxime Coste
5f4f8991e5 Merge remote-tracking branch 'lenormf/fix-makefile-distclean' 2017-03-27 15:51:05 +01:00
Frank LENORMAND
ce7673b7b7 src: Fix the distclean Makefile target
Have the Makefile remove the actual binaries and generated documentation
when called with the `distclean` target
2017-03-26 10:49:17 +03:00
Maxime Coste
95e020ed77 Remove some unneeded type declarations in AliasRegistry 2017-03-24 20:13:18 +00:00
Frank LENORMAND
6b8587000b src: Introduce a -i suffix flag for filter backups
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
2017-03-23 08:50:43 +03:00
Maxime Coste
ca17572301 Try to fix clang 3.5 compilation 2017-03-22 21:08:52 +00:00
Maxime Coste
777ba287e1 Merge faces in show_whitespaces highlighter instead of replacing it 2017-03-21 18:17:43 +00:00
Maxime Coste
8b1078e510 Use a HashMap to store the normal mode keymap 2017-03-16 23:40:38 +00:00
Maxime Coste
e44f95820e Fixes some clang-tidy warning and add a few missing meta.hh include 2017-03-16 23:34:02 +00:00
Maxime Coste
5f7464d90d Try to clean up option include a bit 2017-03-16 09:57:39 +00:00
Maxime Coste
7eaa058450 Move enum/flags option functions to option_types.hh 2017-03-15 18:28:32 +00:00
Maxime Coste
7d9f1df73a Small code tweaks regarding flags handling 2017-03-15 18:25:59 +00:00
Maxime Coste
458dd2e9fa Remove unneeded 'valid' helper template 2017-03-15 18:02:36 +00:00
Maxime Coste
db9b863222 Migrate WithBitOps template specialization to with_bit_ops function
This way we dont depend on knowing the base template to enable bit ops
on an enum type.
2017-03-15 18:00:58 +00:00
Maxime Coste
a49e175727 Migrate to a more value based meta programming model
Introduce Meta::Type<T> to store a type as value, and pass it
around, migrate enum_desc and option_type_name to this.
2017-03-15 17:42:02 +00:00
Maxime Coste
a88e58763b Move SelectionList::set implementation out of the header 2017-03-15 16:51:55 +00:00
Maxime Coste
5705b6c6f9 The canonical name for the documentation command is :doc, not :help 2017-03-15 11:49:00 +00:00
Frank LENORMAND
0acb350619 src: Make the cursor character an opening delimiter
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.
2017-03-15 14:39:40 +03:00
Dan Rosén
5a403a9611 Increase modelinefmt configuration power 2017-03-11 21:43:51 +01:00
Maxime Coste
34da4bf08b Add dilbert in the ui_options doctring 2017-03-10 12:09:09 +00:00
Maxime Coste
564da076a6 Merge remote-tracking branch 'lenormf/assistant-dilbert' 2017-03-10 12:06:35 +00:00
Maxime Coste
0faa5567ca Fix crash on non utf8 files trigering highlighting of backward ranges
Fixes #1274
2017-03-09 23:40:34 +00:00
Maxime Coste
a0b42323ed Add a -debug flag to :edit to set the buffer as debug data
As for the *debug* buffer, buffers with the debug flag wont get
used for cycling through buffer, or word completion.
2017-03-08 19:33:25 +00:00
Frank LENORMAND
59b65bb9fb ncurses: Add a Dilbert assistant
Drawn by myself.
2017-03-08 20:03:29 +03:00
Maxime Coste
da206d9323 Try to please clang-3.5 2017-03-07 17:21:55 +00:00
Maxime Coste
dc7c5f6e67 Collapse undo groups during an eval command 2017-03-07 16:18:09 +00:00
Maxime Coste
89fa6d4fbf Small code simplification 2017-03-07 16:11:40 +00:00
Maxime Coste
30c9b3c426 Merge branch 'patch-1' of git://github.com/guillaumecherel/kakoune 2017-03-07 15:52:44 +00:00
Maxime Coste
a1a566e921 Cleanup hash_map code 2017-03-07 15:48:04 +00:00