Commit Graph

81 Commits

Author SHA1 Message Date
Maxime Coste
68aba9e353 Use shell specific quoting for env vars
Add a test case to validate roundtrips between Kakoune and the
shell.
2018-08-29 07:53:59 +10:00
Maxime Coste
7cf3cbde8e Cleanup some trailing whitespaces and double semicolon 2018-07-26 21:56:34 +10:00
Maxime Coste
7b9f162e7d Opt-in types for quoting of option lists
This avoid quoting ints in int-lists for example, as they do not
risk containing whitespaces.

Fixes #2223
2018-07-22 15:51:32 +10:00
Maxime Coste
8b2e5ea862 Make selection lists use the option list syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
b548dd3a6f Change option lists to be specified as separate arguments on commands line
Option lists and maps are specified using separate arguments, avoiding
the need for additional escaping of their separator and reusing the
existing command line spliting logic instead.

As discussed on #2087, this should make it much easier to work with
list options, and make the general option system feel cleaner.
2018-07-05 07:54:28 +10:00
Maxime Coste
f06badcfd3 Fix clang compilation 2018-05-28 08:26:19 +10:00
Maxime Coste
b5693c6253 Refactor option_from_string to return directly the option value 2018-05-27 13:00:50 +10:00
Maxime Coste
f6f2dafaf7 Make set -add replace existing value when applied to a map option 2018-03-30 09:26:39 +11:00
Maxime Coste
a480e566dc ranges: Add transform overload taking directly a pointer to member
This overload will forward to the general transform implementation
using std::mem_fn to generate a callable.
2018-03-13 14:24:03 +11:00
Maxime Coste
eeacb8b5a8 Use the _str and _sv string literals more often 2018-01-18 09:00:54 +11:00
Maxime Coste
99636c6230 Remove Vector returning split functions, use range adaptor
Do not allocate temporary vectors to store splitted data, use the
'split' range adaptor along with transform(unescape) to provide the
same feature with less allocations.
2017-12-06 17:18:44 +08:00
Maxime Coste
615fe0368c Options: rework conversion to string of prefixed lists
* use the list_separator variable instead of hard coding ':'
* fix trailing separator when converting empty prefixed list to string
* correctly escape the prefix in case it contains a separator
2017-11-13 11:45:28 +08:00
Maxime Coste
078f0b5c90 option_types.hh: fix unfulfilled dependencies of the header 2017-11-13 11:27:55 +08:00
Maxime Coste
53069bcb2d Ensure line-specs and range-specs options are sorted internally 2017-11-02 09:51:15 +08:00
Delapouite
3ed0ac8f62 Fix typo: to many → too many 2017-09-07 21:45:46 +02:00
Maxime Coste
ab6a999431 Rename containers.hh to ranges.hh (and Container to Range) 2017-08-29 15:23:03 +07:00
Maxime Coste
d37c3d175d More uses of standard type traits aliases 2017-07-19 08:49:44 +02:00
Maxime Coste
5bf401948a Cleanup some code with C++14 features 2017-07-19 08:47:14 +02:00
Maxime Coste
268c214f56 Change completion_extra_word_char to be a list of codepoints instead of a string 2017-06-26 14:39:17 +01:00
Maxime Coste
c6eddefb0d Slight code refactoring and perf improvement in vector option to string 2017-06-24 12:24:24 +01:00
Maxime Coste
8dc9f8cc22 Support option_add for HashMap options
Fixes #1407
2017-06-03 18:01:38 +01:00
Maxime Coste
83d85df26e Add an update-option command to update range-descs/line-descs options
update-option will make the range-descs and line-descs option up to
date with the latest buffer modfications, changing the ranges/lines
to where they moved according the modifications since the timestamp
on the option.
2017-05-25 19:54:08 +01:00
Maxime Coste
074666d298 Small code tweak 2017-05-24 15:40:16 +01: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
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
f0ae0b8410 Replace IdMap with HashMap 2017-03-07 01:12:37 +00:00
Maxime Coste
e9f93f1b2f Add support for HashMap options types 2017-03-06 22:25:08 +00:00
Maxime Coste
ea6994dd3b Use a struct WorstMatch instead of varargs for the fallback option_add
varargs cannot handle non pod types.
2016-12-30 06:43:32 +00:00
Maxime Coste
243bcf6a6d Support set -add on flag types
Fixes #1082
2016-12-27 21:52:53 +00:00
Maxime Coste
b337f99ca7 Add a 'keys' debug flag, showing the keystrokes comming to clients 2016-11-26 13:29:17 +00:00
Maxime Coste
025b91baca Convert some uses of lambda to more concise std::mem_fn 2016-10-10 23:44:18 +01:00
Maxime Coste
f73e89a716 Add information of types of options 2016-08-06 09:05:50 +01:00
Maxime Coste
b5a68307ba Use a specific option type completions for insert completion
Fix escaping in jedi.kak as well
2016-04-04 13:42:58 +01:00
Maxime Coste
b6105fa106 Use markup for line-flags instead of a single face 2015-12-12 23:16:07 +00:00
Maxime Coste
4cb74623bb Store the buffer timestamp in line flags options respect it for highlighting
Option content is auto updated to match current buffer, so that line flags
are updated according to buffer modifications.
2015-12-12 11:45:45 +00:00
Maxime Coste
70250fc1e3 Pass directly the StringView to option_add and let it do the option parsing 2015-12-12 11:26:34 +00:00
Maxime Coste
a8d2c93ac8 Add a profiling debug flag to get timings for hooks/shell eval 2015-11-21 12:11:19 +00:00
Maxime Coste
5e4f5cd2a0 Move enum option handling in enum.hh and refactor enum options 2015-11-20 09:06:53 +00:00
Maxime Coste
c0f1b7b99f Introduce a debug flags option to control some tracing
Support shell|hooks and write traces in debug buffer
2015-11-19 21:58:26 +00:00
Maxime Coste
daf041e839 Implement some generic utilities to convert flags to/from strings 2015-11-19 00:17:52 +00:00
Maxime Coste
9656f088e7 Change autoinfo option to be a flags option, document flags options
Support the value1|value2|value3 syntax for flag options.
2015-11-18 23:47:28 +00:00
Maxime Coste
5938712d1f Support :set -add on strings, using concatenation 2015-10-22 13:21:59 +01:00
Maxime Coste
693d9a4861 Store key hash in IdMap 2015-09-16 20:02:12 +01:00
Maxime Coste
73c0fa175e Use IdMap instead of UnorderedMap for ui options and env vars 2015-09-16 19:04:19 +01:00
Maxime Coste
dc504284c3 Change flag lines highlighter to use faces instead of colors
Fixes #130
2015-08-23 12:13:14 +01:00
Maxime Coste
8f6fc6a0f3 Port even more code to use format function 2015-06-01 21:15:59 +01:00