aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
Commit message (Collapse)AuthorAge
* vim-patch:8.0.1041: bogus characters when indenting during visual-block appendJan Edmund Lazo2018-08-23
| | | | | | | Problem: Bogus characters appear when indenting kicks in while doing a visual-block append. Solution: Recompute when indenting is done. (Christian Brabandt) https://github.com/vim/vim/commit/e2e69e48134cbfdedea7802810932f8592705024
* Remove all occurences of the mb_ptr2char macroZviRackover2018-08-06
| | | | | | | First step towards implemening issue #7401. The same can be done for all deprecated mb_ functions in follow-up patches.
* vim-patch:8.0.1765: CTRL-G j in Insert mode is incorrect when 'virtualedit' ↵Jan Edmund Lazo2018-07-23
| | | | | | | set (#8757) Problem: CTRL-G j in Insert mode is incorrect when 'virtualedit' is set. Solution: Take coladd into account. (Christian Brabandt, closes vim/vim#2743) https://github.com/vim/vim/commit/db0eedec16621854c772760d02427804bc0a298d
* transstr_buf: fix length comparison #8681Michael Hoffmann2018-07-10
| | | | | | | | | | | | | | | closes #8466 closes #8664 Regression by 0d7daaad98d5. - Fix length comparison. - Fix loop(s) which iterated over all fields of array `pcc` even if it was not filled up (try unicode 0x9f as statusline character). Note about the tests: - To input unicode with more than two hex digits you can use <C-v>U...: a + U+fe20: a︠ a + U+fe20 + U+fe21: a︠︡
* test: port kword_test to Lua for utf_char2bytes()Jan Edmund Lazo2018-07-01
| | | | | | Use LuaJIT FFI to create char pointer. Validate output with utf_ptr2char(), vim_iswordc() and vim_iswordp(). Use const for LuaJIT string-to-char conversion.
* vim-patch:8.0.0252: not properly recognizing word characters between 128 and 255Jan Edmund Lazo2018-07-01
| | | | | | | | Problem: Characters below 256 that are not one byte are not always recognized as word characters. Solution: Make vim_iswordc() and vim_iswordp() work the same way. Add a test for this. (Ozaki Kiichi) https://github.com/vim/vim/commit/4019cf90b8657d4ab1c39744db63550f44f405a2
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* vim-patch:8.0.0454: compiler warnings for "always true" comparison (#8431)KunMing Xie2018-05-24
| | | | | | Problem: Compiler warnings for comparing unsigned char with 256 always being true. (Manuel Ortega) Solution: Add type cast. https://github.com/vim/vim/commit/977d03733601948ab334fec24d0da82bc18c57c3
* *: Fix clint errorsZyX2018-04-22
|
* charset: Fix PVS/V560: remove condition which was already checkedZyX2018-04-09
|
* charset: Silence PVS/V785: remove switch()ZyX2018-04-09
| | | | No idea why it thinks that pre is constant expression, but switch() may be removed.
* charset: Fix transchar() with multibyte charactersZyX2018-04-09
| | | | | | | It appears that transchar() was working under assumption that `transchar_nonprint()` may be used for multibyte characters while its documentation stated exact opposite. It was not actually untrue though, except that longer buffer would be needed then the one stated in documentation. But it is false now with assert().
* buffer: PVS/V557: Refactor maketitle()ZyX2018-04-09
|
* charset,*: Refactor transstr()ZyX2018-04-09
|
* charset: Move vim_str2nr flags from vim.h to charset.hZyX2017-11-06
|
* charset: Refactor vim_str2nrZyX2017-11-06
|
* charset: Some more refactoring of vim_str2nrZyX2017-10-29
|
* charset: Do not call strlen() from vim_str2nrZyX2017-10-16
|
* charset: Avoid overflow in vim_str2nrZyX2017-10-16
|
* Merge branch 'master' into expression-parserZyX2017-10-15
|\
| * vim-patch:8.0.0164 (#7368)KunMing Xie2017-10-08
| | | | | | | | | | | | Problem: Outdated and misplaced comments. Solution: Fix the comments. https://github.com/vim/vim/commit/caa55b65c204946d160c1b743c5f8f3b506dc4d3
* | charset: Fix out-of-bounds array accessZyX2017-10-15
|/ | | | It is incorrect to *first* access ptr[2] and *then* check whether maxlen allows it.
* charset: Fix V728: excessive checkZyX2017-07-04
|
* vim-patch:8.0.0219James McCoy2017-06-04
| | | | | | | | Problem: Ubsan reports errors for integer overflow. Solution: Define macros for minimum and maximum values. Select an expression based on the value. (Mike Williams) https://github.com/vim/vim/commit/7a40ea2138102545848ea86a361f1b8dec7552b5
* vim-patch:7.4.1976James McCoy2017-06-04
| | | | | | | Problem: Number variables are not 64 bits while they could be. Solution: Add the num64 feature. (Ken Takata) https://github.com/vim/vim/commit/22fcfad29276bd5f317faf516637dcd491b96a12
* charset: Fix V695: dead branchesZyX2017-05-20
| | | | | | | | Based on comments it appears that some non-printable characters intended to be shown as `|x` (0xA0..0xFE) and some as `~x` (0x80..0x9F, 0xFF, excluding previous). But this never happens because this is being catched by condition `c >= 0x80` above which makes them be represented as `<A0>`. Since I find this variant more useful and it additionally is backwards compatible (Vim does the same thing) I just dropped dead branches.
* *: Add comment to all C filesZyX2017-04-19
|
* refactor: pos_T macros to functions (#6496)Felipe Oliveira Carvalho2017-04-11
|
* mbyte: replace vim_tolower with mb_tolower handling locale correctlyBjörn Linse2017-04-10
|
* *: Use const char * in set_one_cmd_contextZyX2017-03-29
| | | Also renames functions added in master and renamed here.
* charset: Remove useless condition from vim_iswordc_tabZyX2017-03-29
|
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* vim-patch:8.0.0250James McCoy2017-03-24
| | | | | | | | | | | | Problem: When virtcol() gets a column that is not the first byte of a multi-byte character the result is unpredictable. (Christian Ludwig) Solution: Correct the column to the first byte of a multi-byte character. Change the utf-8 test to new style. https://github.com/vim/vim/commit/0c0590d9827cb07a33c1552cb3558b94bddcb4dc Closes #6269
* vim-patch:8.0.0307Justin M. Keyes2017-03-22
| | | | | | | | | | Problem: Asan detects a memory error when EXITFREE is defined. (Dominique Pelle) Solution: In getvcol() check for ml_get_buf() returning an empty string. Also skip adjusting the scroll position. Set "exiting" in mch_exit() for all systems. https://github.com/vim/vim/commit/955f198fc546cc30a34361932d3f454a61df0efa
* vim-patch:7.4.1981 (#6192)lonerover2017-03-02
| | | | | | Problem: No testing for Farsi code. Solution: Add a minimal test. Clean up Farsi code. https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
* *: Partial string handling refactoringZyX2017-02-15
| | | | | | | | Main points: - Replace `char_u` with `char` in some cases. - Remove `str[len] = NUL` hack in some cases when `str` may be considered `const`.
* mbyte: clean up charset.c for assumed encoding=utf-8Björn Linse2016-12-07
|
* encoding: cleanup mbyte.c given fixed encoding=utf-8Björn Linse2016-11-05
| | | | | | | | | Eliminate mb_init(): Set "enc_utf" and "has_mbyte" early. Eliminate "enc_unicode" and "enc_latin1like". init_chartab() and screenalloc() are already invoked elsewhere in the initialization process. The EncodingChanged autocmd cannot be triggered. At initialization, there is no spellfiles to reload
* modeline: Handle version number overflow. #5450Florian Larysch2016-10-26
| | | | | | | | | | | Closes #5449 A file containing the string "vim" followed by a very large number in a modeline location will trigger an overflow in getdigits() which is called by chk_modeline() when trying to parse the version number. Add getdigits_safe(), which does not assert overflows, but reports them to the caller.
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* Fix error-handling of strtoimax boundary conditionsJames McCoy2016-09-02
| | | | | | | | | | | | | strtoimax is only required to set errno if there is an underflow/overflow. In those conditions, strtoimax returns INTMAX_MIN/INTMAX_MAX respectively, so that's the only time we should be checking the value of errno. Even in those conditions, errno needs to be set to a known good value before calling strtoimax to differentiate between "value is actually INTMAX_MAX/MIN" and "value over/underflows". Closes #5279
* vim-patch:7.4.1147 (#5005)prollings2016-07-10
| | | | | | | Problem: Conflict for "chartab". (Kazunobu Kuriyama) Solution: Rename the global one to something less obvious. Move it into src/chartab.c. https://github.com/vim/vim/commit/88e8f9f14434a7cd538d0c159dc432bea869a5bd
* Remove some unnecessary function attributes (#4909)oni-link2016-06-11
| | | | This removes attribute FUNC_ATTR_NONNULL_ALL for functions without a pointer parameter.
* keymap: Make replace_termcodes and friends accept length and cpo_flagsZyX2016-04-18
| | | | | | | Reasons: - One does not have to do `s[len] = NUL` to work with these functions if they do not need to replace the whole string: thus `s` may be const. - One does not have to save/restore p_cpo to work with them.
* Enabled -Wconversion in charset.chuchet2016-04-06
|
* charset.c: change return type to boolCharles Joachim2016-02-09
| | | | Co-authored-by: Wayne Rowcliffe
* vim-patch:7.4.1027watiko2016-02-01
| | | | | | | Problem: No support for binary numbers. Solution: Add "bin" to nrformats. (Jason Schulz) https://github.com/vim/vim/commit/887c1fea4a114e7170091942d0446c8882701b5b
* vim-patch:7.4.848watiko2016-02-01
| | | | | | | Problem: CTRL-A on hex number in Visual block mode is incorrect. Solution: Account for the "0x". (Hirohito Higashi) https://github.com/vim/vim/commit/5adfea1ac63e252556bccce54e92e8e10b58f592
* vim-patch:7.4.782watiko2016-02-01
| | | | | | | Problem: Still a few problems with CTRL-A and CTRL-X in Visual mode. Solution: Fix the reported problems. (Christian Brabandt) https://github.com/vim/vim/commit/5d1bc78a2b9fbe3e3112afcde7c80eb19d5989f4