aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
Commit message (Collapse)AuthorAge
...
* Remove all occurrences of mb_off2cellsZviRackover2018-08-13
|
* vim-patch:8.0.1433: illegal memory access after undoJan Edmund Lazo2018-08-09
| | | | | | | Problem: Illegal memory access after undo. (Dominique Pelle) Solution: Avoid the column becomes negative. (Christian Brabandt, closes vim/vim#2533) https://github.com/vim/vim/commit/95dbcbea6d85a5b79d9617ab3863458fdf0217a0
* 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.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
* use wchar_t instead of WCHAR #6998Matt Kline2018-06-18
| | | | wchar_t has better cross-platform support and seems to fix an issue on MinGW when building with `-std=c99`.
* Merge #8526 from janlazo/vim-8.0.0451Justin M. Keyes2018-06-16
|\
| * 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
* | screen: use UTF-8 representationBjörn Linse2018-06-13
|/ | | | | | | | | | | | | | Store text in ScreenLines as UTF-8, so it can be sent as-is to the UI layer. `utfc_char2bytes(off,buf)` is removed, as `ScreenLines[off]` now already contains this representation. To recover the codepoints that the screen arrays previously contained, use utfc_ptr2char (or utf_ptr2char to ignore composing chars). NB: This commit does NOT change how screen.c processes incoming UTF-8 data from buffers, cmdline, messages etc. Any algorithm that operates on UCS-4 (like arabic shaping, treatment of non-printable chars) is left unchanged for now.
* win: enable DYNAMIC_ICONVJustin M. Keyes2018-06-06
|
* mbyte: Fix PVS/V557: do not do useless jobZyX2018-04-15
| | | | I do not see how array overrun is actually possible, but still EUC encodings may do fine without a cycle.
* charset,*: Refactor transstr()ZyX2018-04-09
|
* *: Fix linter errorsZyX2017-10-30
| | | | Big function in expressions.c may be refactored, if I ever catch the idea how to split it right.
* ex_getln: Make use of new parser to color expressionsZyX2017-10-29
| | | Retires g:Nvim_color_expr callback.
* mbyte: Lint some functions which are to be copied for symbolic testsZyX2017-10-15
|
* Merge branch 'master' into colored-cmdlineZyX2017-07-31
|\
| * menu_get(): docJustin M. Keyes2017-07-28
| |
| * viml: introduce menu_get() function #6322Matthieu Coudron2017-07-28
| | | | | | | | menu_get({path}, {modes}). See :h menu_get.
* | Merge branch 'master' into colored-cmdlineZyX2017-07-15
|\|
| * mbyte: Fix crash when using multibyte chars in maparg() return (#6986)Nikolai Aleksandrovich Pavlov2017-07-09
| | | | | | | | | | | | | | | | This is a refactoring typo from #6947. Fixes #6985 Combined with #6947 where typo was made it also fixes vim/vim#1827 which was present in Neovim.
| * mbyte: Refactor mb_unescapeZyX2017-07-02
| | | | | | | | Does not alter its usages.
* | ex_getln: Add some more tests, fix some found errorsZyX2017-06-27
|/
* Merge #6460 from ZyX-I/1476-changesJustin M. Keyes2017-05-08
|\ | | | | Refactor functions which find character in a string
| * Merge branch 'master' into 1476-changesZyX2017-04-10
| |\
| * | strings: Remove vim_strbyteZyX2017-04-07
| | | | | | | | | | | | Ref #1476
* | | utf16_to_utf8: Allocate space for converted string and NULJames McCoy2017-05-03
| | | | | | | | | | | | References #6646
* | | *: Add comment to all C filesZyX2017-04-19
| |/ |/|
* | lint: fix clint errors around mb_tolower callsBjörn Linse2017-04-10
| |
* | mbyte: replace vim_tolower with mb_tolower handling locale correctlyBjörn Linse2017-04-10
| |
* | win: os_get_hostname() #5416 (#6413)Justin M. Keyes2017-04-07
|/
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* eval: Split eval.c into smaller filesZyX2017-03-29
|
* mbyte: remove dead codeBjörn Linse2017-03-22
|
* terminal: Avoid invalid cursor col (#6265)Justin M. Keyes2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch-by: oni-link <knil.ino@gmail.com> Closes #6203 https://s3.amazonaws.com/archive.travis-ci.org/jobs/206794197/log.txt References #3161 [ RUN ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393 ./test/functional/helpers.lua:187: attempt to perform arithmetic on local 'written' (a nil value) stack traceback: ./test/functional/helpers.lua:187: in function 'nvim_feed' ./test/functional/helpers.lua:329: in function 'execute' ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:206: in function <...d/neovim/neovim/test/functional/terminal/buffer_spec.lua:199> [ ERROR ] ...d/neovim/neovim/test/functional/terminal/buffer_spec.lua @ 199: terminal buffer term_close() use-after-free #4393 (199.47 ms) ==================== File /home/travis/build/neovim/neovim/build/log/ubsan.15466 ==================== = ================================================================= = ==15466==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x621000029101 at pc 0x000000ea7ba0 bp 0x7ffd5bb628c0 sp 0x7ffd5bb628b8 = READ of size 1 at 0x621000029101 thread T0 = #0 0xea7b9f in utf_head_off /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7 = #1 0xeaaf53 in mb_adjustpos /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1840:16 = #2 0xeaab48 in mb_adjust_cursor /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1825:3 = #3 0x11000d0 in normal_finish_command /home/travis/build/neovim/neovim/src/nvim/normal.c:928:5 = #4 0x1077df1 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1147:3 = #5 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26 = #6 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3 = #7 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3 = #8 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 = #9 0x447445 in _start (/home/travis/build/neovim/neovim/build/bin/nvim+0x447445) = = 0x621000029101 is located 1 bytes to the right of 4096-byte region [0x621000028100,0x621000029100) = allocated by thread T0 here: = #0 0x4f17b8 in malloc (/home/travis/build/neovim/neovim/build/bin/nvim+0x4f17b8) = #1 0xf1f374 in try_malloc /home/travis/build/neovim/neovim/src/nvim/memory.c:84:15 = #2 0xf1f534 in xmalloc /home/travis/build/neovim/neovim/src/nvim/memory.c:118:15 = #3 0xebe6a8 in mf_alloc_bhdr /home/travis/build/neovim/neovim/src/nvim/memfile.c:646:17 = #4 0xebc394 in mf_new /home/travis/build/neovim/neovim/src/nvim/memfile.c:297:12 = #5 0xed1368 in ml_new_data /home/travis/build/neovim/neovim/src/nvim/memline.c:2704:16 = #6 0xece6ab in ml_open /home/travis/build/neovim/neovim/src/nvim/memline.c:349:8 = #7 0x6438ad in open_buffer /home/travis/build/neovim/neovim/src/nvim/buffer.c:109:7 = #8 0xa6ec8d in do_ecmd /home/travis/build/neovim/neovim/src/nvim/ex_cmds.c:2489:24 = #9 0xb5a0f9 in do_exedit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6723:9 = #10 0xb791f8 in ex_edit /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:6651:3 = #11 0xb28b43 in do_one_cmd /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:2198:5 = #12 0xb077a7 in do_cmdline /home/travis/build/neovim/neovim/src/nvim/ex_docmd.c:601:20 = #13 0x10905db in nv_colon /home/travis/build/neovim/neovim/src/nvim/normal.c:4495:18 = #14 0x1077de8 in normal_execute /home/travis/build/neovim/neovim/src/nvim/normal.c:1144:3 = #15 0x16ff943 in state_enter /home/travis/build/neovim/neovim/src/nvim/state.c:58:26 = #16 0x102d8db in normal_enter /home/travis/build/neovim/neovim/src/nvim/normal.c:463:3 = #17 0xdf3398 in main /home/travis/build/neovim/neovim/src/nvim/main.c:540:3 = #18 0x2b973e8b4f44 in __libc_start_main /build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:287 = = SUMMARY: AddressSanitizer: heap-buffer-overflow /home/travis/build/neovim/neovim/src/nvim/mbyte.c:1637:7 in utf_head_off stack traceback: ./test/helpers.lua:80: in function 'check_logs' ./test/functional/helpers.lua:639: in function <./test/functional/helpers.lua:638> [----------] 9 tests from /home/travis/build/neovim/neovim/test/functional/terminal/buffer_spec.lua (2263.12 ms total)
* refactor: fix warningsJustin M. Keyes2017-02-04
|
* win: fix warningsJustin M. Keyes2017-01-19
|
* vim-patch:7.4.2028rover2017-01-01
| | | | | | | Problem: cppcheck warns for using index before limits check. Solution: Swap the expressions. (Dominique Pelle) https://github.com/vim/vim/commit/5498a41f5a62c3877fee0185adf3bf7245a9a547
* vim-patch:7.4.2019rover2017-01-01
| | | | | | | Problem: When ignoring case utf_fold() may consume a lot of time. Solution: Optimize for ASCII. https://github.com/vim/vim/commit/c4a927ca8dc383190d5df2cacd3f966698b6190c
* Move utf8len_tab definition to globals.hJames McCoy2016-11-23
| | | | | | | | | | | | | The existing code would cause utf8len_tab to be declared as non-extern when main.cpp included globals.h as well as in mbyte.c. This causes the following warning Linking C executable ../../bin/nvim /usr/bin/ld: Warning: size of symbol `utf8len_tab' changed from 256 in CMakeFiles/nvim.dir/main.c.o to 320 in CMakeFiles/nvim.dir/mbyte.c.o Moving the definition to globals.h and using INIT() ensures the array is only defined in main.cpp and other places globals.h is included see an extern declaration.
* encoding: delete non-UTF-8 implementations of multibyte functionsBjörn Linse2016-11-05
| | | | Deleted documentation was duplicated at specific utf_ implementation
* 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
* ui: Fix the call to utf_ambiguous_widthJames McCoy2016-10-11
| | | | | | | | | | | | | | | `utf_ambiguous_width` expects the Unicode character, but in 9e1c6596 I just passed the first UTF-8 byte to the function. This led to various display problems because now many multi-cell characters weren't falling into that part of the branch. Also, to better align with the existing Vim code, remove the forced cursor update. Setting the flag will cause it to happen in the next UI_CALL. Thanks to qvacua for all the help investigating the issue! Closes #5448
* vim-patch:7.4.1697James McCoy2016-09-24
| | | | | | | | | Problem: Display problems when the 'ambiwidth' and 'emoji' options are not set properly or the terminal doesn't behave as expected. Solution: After drawing an ambiguous width character always position the cursor. https://github.com/vim/vim/commit/cb0700844c1274fe8bc0ceaffaee0ad21c406f30
* vim-patch:7.4.1629James McCoy2016-09-24
| | | | | | | | | | Problem: Handling emoji characters as full width has problems with backwards compatibility. Solution: Remove ambiguous and double width characters from the emoji table. Use a separate table for the character class. (partly by Yashuhiro Matsumoto) https://github.com/vim/vim/commit/b86f10ee10bdf932df02bdaf601dffa671518a47
* vim-patch:7.4.1620James McCoy2016-09-24
| | | | | | | Problem: Emoji characters are not considered as a kind of word character. Solution: Give emoji characters a word class number. (Yashuhiro Matsumoto) https://github.com/vim/vim/commit/4077b33a8370afb3d5ae74e556a0119cf51fe294
* vim-patch:7.4.1604James McCoy2016-09-24
| | | | | | | | | Problem: Although emoji characters are ambiguous width, best is to treat them as full width. Solution: Update the Unicode character tables. Add the 'emoji' options. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/3848e00e0177abdb31bc600234967863ec487233
* 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
* mbyte.c: Move utf8/utf16 functions to mbyte.cJustin M. Keyes2016-07-30
|
* *: Fix errors from new linter checksZyX2016-06-11
|
* mbyte.c: Fix invalid memory access in utfc_ptr2char_lenoni-link2016-04-15
| | | | | | To get an UTF-8 character, utf_ptr2char() is used. But this function can read more than maxlen bytes, if an incomplete byte sequence is used(first byte specifies a length > maxlen).