aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hardcopy.c
Commit message (Collapse)AuthorAge
* vim-patch:7.4.1702Michael Ennen2016-12-01
| | | | | | | | Problem: Using freed memory when parsing 'printoptions' fails. Solution: Save the old options and restore them in case of an error. (Dominique) https://github.com/vim/vim/commit/4afc7c5d4a73340831077a02bfe1f74935e7f4a1
* hardcopy.c: Fix -Wmaybe-uninitialized warning.Justin M. Keyes2016-10-08
|
* 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
* vim-patch:7.4.1552James McCoy2016-07-08
| | | | | | | Problem: ":colorscheme" does not use 'packpath'. Solution: Also use in "start" and "opt" directories in 'packpath'. https://github.com/vim/vim/commit/7f8989dd8a627af2185df381195351a913f3777f
* *: Fix new linter errorsZyX2016-05-01
| | | | Originally there were 128 new errors, so I thought this is a good idea to fix all of them. Of course, this commit also fixes many suppressed errors.
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|
* *: Make set_vim_var_\* functions have proper argument typesZyX2016-04-18
|
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* Remove unnecessary includes for errno.hRui Abreu Ferreira2015-11-25
|
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* Remove char_u: add_pathsep()Mark Bainter2015-05-06
|
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Fix a couple uninitialized variable warnings in the release build.John Szakmeister2015-04-18
| | | | | | Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com> Reviewed-by: Marco Hinz <mh.codebro@gmail.com> Reviewed-by: Björn Linse <bjorn.linse@gmail.com>
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* refactor: split some more functions from misc1.cbobtwinkles2015-03-24
| | | | | | | | | | | This commit pulls the some environment-variable handling functions out of misc1.c and in to os/env.c. Previously submited as #1231, this is the start of a patch series that does that work based on a more up-to-date master branch. Major tasks accomplished: - move functions and fix includes - fix clint/clang analysis warnings - correct documentation comments
* Merge pull request #2118 from rev112/fix_redundant_castJohn Szakmeister2015-03-13
|\ | | | | Remove redundant casts
| * Remove redundant castsAnton Ovchinnikov2015-03-09
| |
* | version: don't use NVIM_VERSION_* directly outside version.cBjörn Linse2015-03-08
|/ | | | This avoids recompiles after commiting.
* refactor: Remove term modules and termcap optionsThiago de Arruda2015-02-21
| | | | | | | | | | | | | | | - Removed term.c, term.h and term_defs.h - Tests for T_* values were removed. screen.c was simplified as a consequence(the best strategy for drawing is implemented in the UI layer) - Redraw functions now call ui.c functions directly. Updates are flushed with `ui_flush()` - Removed all termcap options(they now return empty strings for compatibility) - &term/&ttybuiltin options return a constant value(nvim) - &t_Co is still available, but it mirrors t_colors directly - Remove cursor tracking from screen.c and the `screen_start` function. Now the UI is expected to maintain cursor state across any call, and reset it when resized. - Remove unused code
* Enable -Wconversion: ui.c.Eliseo Martínez2015-02-18
| | | | | | | | | | | | | | | Refactoring summary: - ui_write(): len: int --> size_t * parse_abstract_ui_codes(): len: int --> size_t * string_convert(): lenp: int * --> size_t * - string_convert_ext(): lenp : int * --> size_t * unconvlenp: int * --> size_t * * utf8len_tab_zero: char[] --> uint8_t[] * iconv_string(): slen : int --> size_t unconvlenp: int * --> size_t * resultlenp: int * --> size_t * - mch_print_text_out(): len: int --> size_t * out_pos: int --> size_t
* syntax: Refactor to store all term and gui attributes independentlyThiago de Arruda2015-02-16
| | | | | Now the attrentry_T structure will store all attributes in separate fields for cterm and rgb UIs.
* coverity/13762: Out-of-bounds read: RI.Eliseo Martínez2015-02-11
| | | | | | | | | | | | Problem : Out-of-bounds read @ 2213. Diagnostic : Real issue. Rationale : Error occurs if cmap == ARRAY_SIZE(prt_ps_mbfonts), but code takes the `if (prt_out_mbyte)` branch. That's it, if a matching encoding is found but not a matching charset. In that case, the first matching encoding is used. Resolution : Remember the value of cmap for the first matching encoding. Reset cmap to that value if first matching encoding is going to be used.
* hardcopy.c: Factor out float usageMichael Reed2015-01-24
|
* "halfway a line" is a very confusing phraseJack Danger Canty2015-01-22
| | | | | | | | | If you Google for this phrase found in the Vim documentation you'll find almost exclusively hits from the Vim documentation. I think changing "halfway a line" to "halfway through a line" makes more sense. There seems to be an pervasive odd use of the word 'halfway' in the original docs which I'm updating everywhere.
* Fix bad assert.Eliseo Martínez2015-01-14
| | | | | | | Problem : Assert can fail for legal values. Modulo-arithmetic of unsigned types can make so that n * 100 > n, but n has overflowed. Solution : Use alternative form of expression.
* Cleanup: Rename getdigits() family functions.Eliseo Martínez2015-01-11
|
* Cleanup: Refactor getdigits().Eliseo Martínez2015-01-11
| | | | | | | | | | | | | | | | Problem : getdigits() currently returns a long, but at most places, return value is casted (unsafely) into an int. Making casts safe would introduce a lot of fuss in the form of assertions checking for limits. Note : We cannot just change return type to int, because, at some places, legitimate long values are used. For example, in diff.c, for line numbers. Solution : Introduce new functions: - get_digits() : Gets an intmax_t from a string. - get_int_digits() : Wrapper for ints. - get_long_digits() : Wrapper for longs. And replace getdigits() invocations by the appropiate wrapper invocations.
* Cleanup: Refactor option_table_T.number: long --> int.Eliseo Martínez2015-01-11
|
* Cleanup: Refactor prt_{fg,bg,new_bg}col: int --> uint32_t.Eliseo Martínez2015-01-11
|
* Cleanup: Remove local var bg_color@prt_get_attr().Eliseo Martínez2015-01-11
|
* Cleanup: Fix bad assert.Eliseo Martínez2015-01-11
| | | | | Assert will fail on first loop iteration (in that case, prtpos.bytes_printed is 0).
* Remove long_u: hardcopy: Refactor long_u.Eliseo Martínez2015-01-10
| | | | | | | | | | | | | | | | - <color_related_stuff>: long_u --> uint32_t Everywhere long_u was used to hold a color value. Color values are supposed to be 32 bits at most. Supported architectures have 32 bits ints, so we could have used plain ints. But this wouldn't be future-proof, and would be wasteful if a future architecture has ints bigger than 32 bits. So, uint32_t is perfect to achieve optimal packing no matter the architecture. - bytes_to_print/bytes_printed: long_u --> size_t Seems like the correct thing, and gets rid of some casts.
* Remove long_u: hardcopy: Enable -Wconversion.Eliseo Martínez2015-01-10
|
* Use ARRAY_SIZE where Coccinelle wasn't able to do itFelipe Oliveira Carvalho2014-12-18
|
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c
* ui: Remove ui_delay, ui_breakcheck and ui_set_shellsizeThiago de Arruda2014-11-27
| | | | | These functions only used to call another os_* function, so remove them and replace all occurences in the project.
* coverity/13765,13766,13767,13768: Fix memory leaks in hardcopy.coni-link2014-11-16
| | | | | | | | The function mch_print_begin() returns early in case of an error, but without freeing allocated memory. To fix this, use stack allocation instead of heap allocation for the variables res_prolog, res_encoding, res_cidfont and res_cmap.
* Fix warnings: hardcopy.c: mch_print_text_out(): Bad free: FP + RI.Eliseo Martínez2014-11-11
| | | | | | | | | | | | | | | | | | Problem : Bad free @ 3058. Diagnostic : False positive uncovering a real issue. Rationale : Signaled error occurs if p gets assigned `(char_u*)""` at line 3009 and then is freed at line 3058. But that cannot happen because of the last guard condition before `free` (`*p != NUL`). So, signaled error is a false positive. Now, examining this code more carefully reveals a real issue: not freeing an empty string may not be always correct, as an empty (but allocated) string could also be returned in `p = string_convert(&prt_conv, p, &len);` if passed '&len' points to 0). Which would in fact be a memory leak. Resolution : Remove the exceptional case. Make p always point to allocated memory, and always free it, when `prt_do_conv` is on.
* version: update user-facing version indicatorsJustin M. Keyes2014-10-07
| | | | | | | - VIM_VERSION_LONG and VIM_VERSION_LONG_DATE do not affect plugins, they are only cosmetic. - Vim-related version identifiers will be preserved for plugin compatibility (has("patchXXX") and v:version).
* Remove EBCDIC: Remove IF_EB macrosPavel Platto2014-08-02
|
* Remove EBCDIC: Clean up commentsPavel Platto2014-08-02
|
* Extract `tempfile` module from fileioPavel Platto2014-07-14
| | | | | | | Though this module is relatively small it has very clear boundaries. The last argument for extracting `tempfile` was the errors which I got when I was writing unittests for it: `cimport './src/nvim/fileio.h'` does not work for some reason.
* Refactor vim_tempnamePavel Platto2014-07-14
| | | | | | | | | - temp_count is uint32_t now instead of long because it supposed to be at most 999999999 (comment on line 5227) temporary files. The most probably it was a long for compatibility with systems where int is 16-bit. - Use "nvim" as prefix for temp folder name instead of "v" - Remove unused parameter from vim_tempname
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move locale.h include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* ga_growsize should be >= 1Felipe Oliveira Carvalho2014-06-30
| | | | | | | | | | | I know it could be 0 sometimes. Running the tests with `assert(gap->ga_growsize > 0)` in ga_grow() crashes nvim while running the tests. - Add a setter for ga_growsize that checks whether the value passed is >=1 (log in case it's not) - log when ga_grow() tries to use a ga_growsize that's not >=1 - use GA_EMPTY_INIT_VALUE is many places
* Replace vim_strncpy calls: hardcopy.cDouglas Schneider2014-06-13
|
* Add automatic generation of headersZyX2014-06-02
| | | | | | | | | | | | | | | | | - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.