aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
Commit message (Collapse)AuthorAge
...
* Fix warnings: message.c: copy_hotkeys_and_msg: Garbage value: FP. #2062Eliseo Martínez2015-02-26
| | | | | | | | | | | | | | Problem : Branch condition evaluates to a garbage value @ 2868. Diagnostic : False positive. Rationale : Array has_hotkey, declared at 2812, is initialized by console_dialog_alloc (only the needed number of elements). That same number of elements is used by copy_hotkeys_and_msg. Suggested path error is impossible, because it involves a different number of elements in those functions. Resolution : Above condition is cumbersome to prove through assertions. Thus, we prefer to just initialize the array to all-false at declaration point before calling console_dialog_alloc.
* 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
* coverity/13683: Out-of-bounds access: RI.Eliseo Martínez2015-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Out-of-bounds access @ 3730. Diagnostic : Real issue. Rationale : str is constructed step by step, str_l growing each time. str_m is the maximum length of str. So, at every step, avail is computed to see if the piece to be added fits in. If not, piece is truncated to a max of `avail`, so that str stays in bounds. Such blocks where pieces are added are of the form `if (str_l < str_m)`. It then follows that once one of those pieces exhausts available space on str, no other such block should be entered. Formally: str_l < strl_m && avail = str_m - str_l && x >= avail --> str_l + x >= str_m Now, suggested error path successively enters blocks where str is exhausted. We're not sure if coverity just fails to follow above implications, or, on the contrary, it's aware of them, but it's signaling the more complex possibility of implications not being fulfilled because of possible arithmetic overflows. We opt then to assume this last case, as the possibility is in fact there. Resolution : Refactor code so that tracked condition doesn't depend on arithmetic implications. Check for overflow.
* ui: Remove/adapt some old code for a big UI refactorThiago de Arruda2015-02-16
| | | | | | | | | | | | | - Remove abstract_ui global, now it is always active - Remove some terminal handling code - Remove unused functions - Remove HAVE_TGETENT/TERMINFO/TERMIOS/IOCTL #ifdefs - Remove tgetent/terminfo from version.c - Remove curses/terminfo dependencies - Only start/stop termcap when starting/exiting the program - msg_use_printf will return true if there are no attached UIs( messages will be written to stdout) - Remove `ex_winpos`(implement `:winpos` with `ex_ni`)
* Remove nonnullret deadcode: home_replace_save.Eliseo Martínez2015-01-27
|
* Macro cleanup: MiscellaneousMichael Reed2015-01-14
| | | | | | These were found with -Wunused-macros. There are many more macros which triggered that warning, but they were primarily part of larger sets of macros so leave them alone.
* Ignore compatible modeJoel Teichroeb2014-12-13
|
* docs: Remove VAX remnantsMichael Reed2014-12-09
|
* Fix warnings: message.c: msg_attr_keep(): Np dereference: FP.Eliseo Martínez2014-12-06
| | | | | | | | Problem : Dereference of null pointer @ 179. Diagnostic : False positive. Rationale : Error occurs if `s` paramater is null, which should not happen. Resolution : Declare parameter as non null.
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c
* ui: Extract mouse.c/mouse.hThiago de Arruda2014-11-27
|
* 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.
* ui: Remove ui_inchar/ui_char_availThiago de Arruda2014-11-27
| | | | | | | | | Also: - Remove NO_CONSOLE_INPUT/NO_CONSULE preprocessor conditionals - Remove ctrl_c_interrupts variable, check for mapped_ctrl_c directly in process_interrupts() - Move ui_inchar profiling to input_poll which is where Nvim blocks for input.
* event: No longer process K_EVENT automaticallyThiago de Arruda2014-11-21
| | | | | | | Two new functions, `event_enable_deferred()`/`event_disable_deferred()` have to be called by code that is capable of handling asynchronicity. User-dialog states like "press ENTER to continue" or the swap file confirmation no longer will generate K_EVENT.
* Fix warnings: message.c: vim_vsnprintf(): Dead assignment (2): HI.Eliseo Martínez2014-11-11
| | | | | | | | | | | | | | | | | | | Problem : Dead assignment @ 3323. Dead assignment @ 3587. Diagnostic : Harmless issues. Rationale : - 3323: Assignment is in fact dead. But, in addition to that, `length_modifier` is assigned default value `\0` when declared and is untouched in path leading to signaled point. So, maintaining assignment adds nothing to code. - 3587: Assignment is in fact dead. It could be thought that `precision_specified` has to be 1 in order to flag `precision` as having a valid value. But that doesn't seem to be the case, as there are places in the code where `precision` gets assigned a default value, even if `precision_specified` is 0. So, maintaining assignment adds nothing to code. Resolution : Remove dead assignments.
* Fix warnings: message.c: delete_first_msg(): Np dereference: FP.Eliseo Martínez2014-11-11
| | | | | | | | | | | Problem : Dereference of null pointer @ 693. Diagnostic : False positive. Rationale : Error condition occurs if `delete_first_msg` is entered two consecutive times, the firt of which sets leaves history empty. But, in that case, second entrance should leave at the `return FAIL`, and thus cannot reach the pointer dereference. Resolution : Assert history will be empty after first entrance.
* memory: xstrchrnul and xmemscan.Scott Prager2014-09-30
|
* events: Refactor how event deferral is handledThiago de Arruda2014-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove all *_set_defer methods and the 'defer' flag from rstream/jobs - Added {signal,rstream,job}_event_source functions. Each return a pointer that represent the event source for the object in question(For signals, a static pointer is returned) - Added a 'source' field to the Event struct, which is set to the appropriate value by the code that created the event. - Added a 'sources' parameter to `event_poll`. It should point to a NULL-terminated array of event sources that will be used to decide which events should be processed immediately - Added a 'source_override' parameter to `rstream_new`. This was required to use jobs as event sources of RStream instances(When "focusing" on a job, for example). - Extracted `process_from` static function from `event_process`. - Remove 'defer' parameter from `event_process`, which now operates only on deferred events. - Refactor `channel_send_call` to use the new lock mechanism What changed in a single sentence: Code that calls `event_poll` have to specify which event sources should NOT be deferred. This change was necessary for a number of reasons: - To fix a bug where due to race conditions, a client request could end in the deferred queue in the middle of a `channel_send_call` invocation, resulting in a deadlock since the client process would never receive a response, and channel_send_call would never return because the client would still be waiting for the response. - To handle "event locking" correctly in recursive `channel_send_call` invocations when the frames are waiting for responses from different clients. Not much of an issue now since there's only a python client, but could break things later. - To simplify the process of implementing synchronous functions that depend on asynchronous events.
* move defines from vim.hBrandon Coleman2014-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buffer.h: buflist_getfile() flags buflist_new() flags buf_freeall() flags do_buffer() flags charset.h: chartab[] flags edit.h: in_cinkeys() flags change_indent() flags beginline() flags insertchar() flags nv_mousescroll() flags eval.c AUTOLOAD_CHAR eval.h: enum for vimvars[] ex_cmds.h: do_ecmd read_viminfo flags ex_cmds2.h: check_changed() flags do_source() flags ex_cmds_defs.h: BAD_* flags ex_docmd.h: VALID_PATH VALID_HEAD EXMODE_* do_cmdline() flags added include ex_getln.c *_ESC_CHARS definitions ex_getln.h: history table flags - used by add_to_history() fileio.h: readfile() flags event_T definition getchar.h: ins_typebuf() flags KEYLEN_* globals.h: NO_SCREEN NO_BUFFERS SEA_* defines current_SID flags hlf_T enum HL_FLAGS do_profiling() flags schar_T sattr_T indent.h: set_indent() flags macros.h: BINARY_FILE_IO flags mbyte.h: MB_BYTE2LEN* ENC_* memfile.h: mf_sync() flags misc1.h: open_line() flags message.h: do_dialog() flags vim_dialogyesno() flags DLG_BUTTON_* normal.h: find_ident_under_cursor() flags ops.h: do_put() flags operator ID's option.h: buf_copy_options() flags OPT_* flags os_unix.h: mch_nodetype() flags quickfix.h: skip_vimgrep_pat() flags regexp.h: vim_regcomp() flags values for reg_do_extmatch search.h: do_search() flags search_regcomp() flags findmatchlimit() flags syntax.h: HL_* flags HL_FOLD is used in buffer_defs.h but nvim compiles just fine with the defines in syntax.h tag.h: do_tag() flags find_tags() flags term.h: TBUFSZ flags MOUSE flags ui.h: jump_to_mouse() flags window.h: file_name_in_line() flags win_split() flags MIN_LINES MIN_COLUMNS Remove VimClipboard which should have been removed with PR #921.
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|
* move stdarg.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* remove stdbool.h include from vim.h and globals.hBrandon Coleman2014-07-09
|
* Replaced most TRUE/FALSE macros in arabic, mbyte and spell. #645Klemen Košir2014-07-08
|
* 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
* events: Refactor how events are queued for processingThiago de Arruda2014-06-18
| | | | | | | | | | | | | | | | | | To make it possible reuse `event_poll` recursively and in other blocking function calls, this changes how deferred/immediate events are processed: - There are two queues in event.c, one for immediate events and another for deferred events. The queue used when pushing/processing events is determined with boolean arguments passed to `event_push`/`event_process` respectively. - Events pushed to the immediate queue are processed inside `event_poll` but after the `uv_run` call. This is required because libuv event loop does not support recursion, and processing events may result in other `event_poll` calls. - Events pushed to the deferred queue are processed later by calling `event_process(true)`. This is required to "trick" vim into treating all asynchronous events as special keypresses, which is the least obtrusive way of introducing asynchronicity into the editor. - RStream instances will now forward the `defer` flag to the `event_push` call.
* Remove unnecessary comments and unnecessary returnFelipe Oliveira Carvalho2014-06-16
|
* No OOM in msg_show_console_dialog()Felipe Oliveira Carvalho2014-06-16
|
* Replace vim_strncpy calls: message.cDouglas Schneider2014-06-13
|
* spelling fixes #827Will Stamper2014-06-12
|
* text: remove useless arg from mb_string2cellsNicolas Hillegeer2014-06-08
| | | | | | | | | | | | | | | | | | mb_string2cells was always called like mb_string2cells(..., -1) so that was the only codepath that was tested. @tarruda was the first to try to input an actual length, after which valgrind detected that funny business was going on. It's not even possible to do the right thing with the current text codec infrastructure: they all assume to be working with C strings. Meaning that if there is no NUL-terminator, they will happily keep on reading past the end of Pascal strings. Ergo, passing the length parameter is moot. The condition in the for-loop was wrong as well (but that's no longer relevant). Also change the return value to size_t, by analogy with strlen. ref: https://github.com/neovim/neovim/commit/677d30d7966dd2766bbf20665791c568dacc427a
* Remove USE_CR and tag_fgets. #808Justin M. Keyes2014-06-06
| | | | These features are only used by legacy Mac OS.
* Remove remaining declarations with new script: finddeclarations.plZyX2014-06-02
|
* 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.
* Remove FEAT_FLOATHinidu2014-05-28
| | | | Support for floating point variables
* Remove FEAT_EVALHinidu2014-05-28
| | | | Support for VimScript, :let, :if, etc.
* Replace alloc() with xmalloc() and remove immediate OOM checksFelipe Oliveira Carvalho2014-05-19
|
* Introduce nvim namespace: Fix unmasked strings.h issue.Eliseo Martínez2014-05-15
| | | | | | | | | | | | | | | | | | | | | | | | | Problem: Now that nvim/strings.h is correctly namespaced, an issue that had been masked until now arises: When compiling, we get a lot of errors because of everywhere the functions in nvim/strings.h are used, there's no include to import them. But, how could this compile and work previously, then? It turns out that: - In every such case, we are also including vim.h, which in turn includes os_unix_defs.h. - os_unix_defs.h includes <string.h> and also <strings.h> in some systems (e.g. OSX). - Build had been modified previously to (even when importing system headers), prefer equally-named local ones. That was in fact done as a previous attempt to solve the same issue we are trying to solve another way now. So, we were including our "strings.h" as a side-effect of including <strings.h> through "vim.h" --> "os_unix_defs.h". Solution: Correctly include "nvim/strings.h" in every file needing it.
* Introduce nvim namespace: Fix project-local includes.Eliseo Martínez2014-05-15
| | | | Prepend 'nvim/' in all project-local (non-system) includes.
* Introduce nvim namespace: Move files.Eliseo Martínez2014-05-15
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.