aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/if_cscope.c
Commit message (Collapse)AuthorAge
...
* vim-patch:8.0.0160: EMSG() is sometimes used where it should be IEMSG()James McCoy2018-01-02
| | | | | | | Problem: EMSG() is sometimes used for internal errors. Solution: Change them to IEMSG(). (Dominique Pelle) And a few more. https://github.com/vim/vim/commit/de33011ec623fd562419dede6bf465b5b9881a20
* vim-patch:8.0.0420: text garbled when the system encoding differs from ↵James McCoy2017-12-17
| | | | | | | | | | 'encoding' Problem: When running :make the output may be in the system encoding, different from 'encoding'. Solution: Add the 'makeencoding' option. (Ken Takata) https://github.com/vim/vim/commit/2c7292dc5bbf155fe2192d417363b8c085759cad
* Merge #7633 'Retry fgets on EINTR'Justin M. Keyes2017-11-26
|\ | | | | closes #7632
| * io: retry fgets on EINTR (#7632)Matt Widmann2017-11-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The calls to `fgets` in `src/nvim/if_cscope.c` (and elsewhere) can show communication errors to the user if a signal is delivered during its system calls. For plugins that proxy subprocess output into cscope requests, a `SIGCHLD` might *always* interfere with calls into `fgets`. To see this in a debugger, put a breakpoint on `cs_reading_emsg` and watch signals come in (with lldb, using `process handle --notify true --pass true`). Next, run a subcommand from neovim that calls through cscope when it returns. A tag picker plugin, like vim-picker and fzy, with `cscopetag` and `cscopetagorder=0` set, reproduced this reliably. The breakpoint will hit after a `SIGCHLD` is delivered, and `errno` will be set to 4, `EINTR`. The caller of `fgets` should retry when `NULL` is returned with `errno` set to `EINTR`.
* | input: only change mode of input fd if there is an input fdBjörn Linse2017-11-25
|/
* fix lint errorlonerover2017-08-04
|
* vim-patch:8.0.0081lonerover2017-08-04
| | | | | | | Problem: Inconsistent function names. Solution: Rename do_cscope to ex_cscope. Clean up comments. https://github.com/vim/vim/commit/d4db7719bdfbc54df396eac08d8cbb2389feacf4
* if_cscope: Fix truncation of formated outputoni-link2017-05-13
| | | | | | | snprintf() has to truncate the string written to buffer buf for maximal size_t value. Increase buffer size to fix this.
* *: Add comment to all C filesZyX2017-04-19
|
* *: Use const char * in set_one_cmd_contextZyX2017-03-29
| | | Also renames functions added in master and renamed here.
* vim-patch:8.0.0068 (#6243)Daniel Hahler2017-03-11
| | | | | | | | Problem: Checking did_throw after executing autocommands is wrong. (Daniel Hahler) Solution: Call aborting() instead, and only when autocommands were executed. https://github.com/vim/vim/commit/21662be2211675824df1771c7f169948ede40c41
* *: 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`.
* fix cscope test failurerover2017-02-10
|
* lintJames McCoy2016-10-09
|
* if_cscope: Fix conversion warnings when char defaults to unsignedJames McCoy2016-10-09
| | | | | | | | | | | | | | | | | | | | | | | ../src/nvim/if_cscope.c: In function 'cs_read_prompt': ../src/nvim/if_cscope.c:1771:47: warning: comparison is always true due to limited range of data type [-Wtype-limits] while ((ch = (char)getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0]) ^~ ../src/nvim/if_cscope.c:1804:14: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (ch == EOF) { ^~ ../src/nvim/if_cscope.c:1816:14: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] ch = EOF; ^~~ ../src/nvim/if_cscope.c:1821:12: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (ch == EOF) ^~ Since EOF is -1, it will be converted to a large unsigned value to compare with unsigned char and never match. Use an int to store the return from getc so we can safely compare it and, once known to be valid, cast it to char when storing it into buf. Signed-off-by: James McCoy <jamessan@jamessan.com>
* Merge #5254 from KillTheMule/vim-7.4.1952Justin M. Keyes2016-09-18
|\ | | | | vim-patch:7.4.{1952, 1990, 2033, 2284}
| * LintKillTheMule2016-08-26
| |
| * vim-patch:7.4.1990KillTheMule2016-08-26
| | | | | | | | | | | | | | | | | | Problem: Cscope items are not sorted. Solution: Put the new "a" command first. (Ken Takata) https://github.com/vim/vim/commit/80632db65e8f5f775dadbbc10c5ba6c173ebb24f All changes applied manually.
| * vim-patch:7.4.1952KillTheMule2016-08-26
| | | | | | | | | | | | | | | | | | Problem: Cscope interface does not support finding assignments. Solution: Add the "a" command. (ppettina, closes vim/vim#882) https://github.com/vim/vim/commit/b12e7ef956e0b0344778b7ef93d41f4b4ed2a670 All changes applied manually.
* | 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
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* Linting.KillTheMule2016-04-23
|
* vim-patch:7.4.822KillTheMule2016-04-23
| | | | | | | | | | Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt) https://github.com/vim/vim/commit/cde885473099296c4837de261833f48b24caf87c Applied manually. Files that do not exst anymore: gui.c gui_w16.c gui_w32.c if_xcmdsrv.c os_unix.c
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|
* cscope: Fix mismatched types in ':cscope show' outputMike Wadsten2016-04-10
| | | | | | | | Type long on 32-bit systems is typically 32 bits, but PRId64 is 64 bits. This mismatch leads to bad output or segfaults on :cs show. Fixes #4537
* cs_print_tags_priv: Clean up function.oni-link2016-01-21
| | | | | | * Style changes * Variable removal * Comment update
* cs_print_tags_priv: Clear first output line to screen endoni-link2016-01-21
| | | | | | | | | Using `:cscope find s <cword>` with the cursor on a very short word like `key` does not output the first line on the screen correctly: Output is `Cscope tag: keyrd>` instead of `Cscope tag: key`. To fix this, clear the screen line after the first line was printed.
* coverity/133892: Resource leakoni-link2016-01-21
| | | | | | | Variable tbuf going out of scope leaks the storage it points to. We don't have to use the copy tbuf of a match. Because matches are always in ctags style, we can operate on them directly.
* coverity/133858: Out-of-bounds accessoni-link2016-01-21
| | | | | | Allocating insufficient memory for the terminating NUL of the string. False positive, we allocating more memory than we need.
* coverity/13753: Dereference null return valueoni-link2016-01-21
| | | | | | | | Dereferencing a pointer that might be null(ptag) when calling strlen(). False positive. A match always contains a tab, so ptag is never null. Because matches are always in ctags style, we can rewrite the code to not use strtok().
* Windows: Include <fcntl.h> for file constants.Seth Jackson2016-01-17
| | | | | | This header is required by POSIX for the constants (O_RDONLY, etc.) but we were only including it on Unix systems as a side effect of including <unistd.h>.
* misc: UNIX => Unix #4022Seth Jackson2016-01-16
| | | | | | | | | | Although UNIX is a registered trademark of The Open Group, it doesn't really matter whether we refer to these systems as UNIX, Unix, or Unix-like. So, for consistency, refer to them collectively as Unix. Related: http://www.greens.org/about/unix.html http://www.unixica.com/html/unixunix.html
* Windows: Bring back code branch for if_cscope.Rui Abreu Ferreira2016-01-01
| | | | | The Vim code for windows in if_cscope.c/.h was removed during the refactor, added missing code for error_closing().
* Merge pull request #3879 from sethjackson/open-osfhandleJustin M. Keyes2015-12-26
|\ | | | | Windows: Fix cast in if_cscope.c
| * Windows: Fix cast in if_cscope.c.Seth Jackson2015-12-21
| |
* | Windows: Remove unused function #3878Seth Jackson2015-12-22
|/ | | | The only call site was removed in 902ad8d.
* 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.
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* Enable -Wconversion: if_cscope.c #3068cztchoice2015-09-23
| | | | | Helped-by: Gustaf Lindstedt <gustaflindstedt@gmail.com> Helped-by: Wander Nauta <info@wandernauta.nl>
* os/os_defs.h cleanup: Remaining signal stuffMichael Reed2015-08-27
| | | | | | | | | | | | RETSIGTYPE, SIGRETURN, and SIGDEFARG are always defined the same, so inline them for simplicity; SIGDUMMYARG, however, is unused, so remove it. Even if these things don't work on windows, the signal handler in if_cscope.c is already wrapped with '#idef UNIX', as is its only call site. Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
* rstream/wstream: Unify structures and simplify APIThiago de Arruda2015-07-17
| | | | | | | | | | | | | - Simplify RStream/WStream API and make it more consistent with libuv. - Move into the event loop layer(event subdirectory) - Remove uv_helpers module. - Simplify job/process internal modules/API. - Unify RStream and WStream into a single structure. This is necessary because libuv streams can be readable and writable at the same time(and because the uv_helpers.c hack to associate multiple streams with libuv handle was removed) - Make struct definition public, allowing more flexible/simple memory management by users of the module. - Adapt channel/job modules to cope with the changes.
* input: stream_set_blocking(): libuv implJustin M. Keyes2015-05-27
| | | | | | | | | - Create a private libuv loop instead of re-using uv_default_loop(), to avoid conflict[1] with existing watcher(s) on the fd. - Expose the global "input" fd as a getter instead of a mutable global. [1] .deps/build/src/libuv/src/unix/core.c:833: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
* input: set input stream to blocking on exitJustin M. Keyes2015-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If stdin is non-blocking, many tools (e.g. cat(1), read(1)) which assume that stdin is blocking, will break in odd ways: read: read error: 0: Resource temporarily unavailable cat: -: Resource temporarily unavailable rm: error closing file libuv puts stdin in nonblocking mode, and leaves it that way at exit (this is apparently by design). So, before this commit, this always works (because the shell clobbers O_NONBLOCK): $ nvim --cmd q $ read ...but these forms do _not_ work: $ nvim --cmd q && read $ echo foo | nvim --cmd q && read $ nvim && read After this commit, all of the above forms work. Background: https://github.com/fish-shell/fish-shell/commit/437b4397b9cf273922ce7b414bf6626845f15ad0#diff-41f4d294430cd8c36538999d62681ae2 https://github.com/fish-shell/fish-shell/issues/176#issuecomment-15800155 - bash (and other shells: zsh, tcsh, fish), upon returning to the foreground, always sets fd 0 back to blocking mode. This practice only applies to stdin, _not_ stdout or stderr (in practice these fds may be affected anyways). - bash/zsh/tcsh/fish do _not_ restore the non-blocking status of stdin when _resuming a job_. - We do _not_ save/restore the original flags visible to fcntl(F_[SG]ETFL), because (counterintuitively) that isn't expected. Helped-by: oni-link <knil.ino@gmail.com> Closes #2086 Closes #2377 --- Note: The following implementation of stream_set_blocking() was discarded, because it resulted in a failed libuv assertion[1]: int stream_set_blocking(int fd, bool blocking) { uv_pipe_t stream; uv_pipe_init(uv_default_loop(), &stream, 0); uv_pipe_open(&stream, fd); int retval = uv_stream_set_blocking((uv_stream_t *)&stream, blocking); uv_close((uv_handle_t *)&stream, NULL); return retval; } [1] .deps/build/src/libuv/src/unix/core.c:833: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
* Remove char_u: message:smsg_attr()Michael Reed2015-05-13
|
* Remove char_u: message:smsg()Michael Reed2015-05-13
|
* Remove char_u: concat_fnames()Mark Bainter2015-05-06
|
* Enable -Wconversion: normal.c.Eliseo Martínez2015-04-27
| | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* 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.