aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
Commit message (Collapse)AuthorAge
...
* 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
* vim-patch:7.4.654Jurica Bradaric2016-01-22
| | | | | | | | | Problem: glob() and globpath() cannot include links to non-existing files. (Charles Campbell) Solution: Add an argument to include all links with glob(). (James McCoy) Also for globpath(). https://github.com/vim/vim/commit/a245bc79b4c6b83a4b5b6cdb95c4d2165762a20b
* Merge #3916 "Add support for binary numbers".Justin M. Keyes2016-01-21
|\
| * Fix lint issuesJason Schulz2016-01-15
| |
| * Add support for binary numbersJason Schulz2016-01-15
| |
* | 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
* Fix Windows code in command_line_execute()Rui Abreu Ferreira2015-12-04
|
* 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.
* Enable focus events in cmdline and terminal modesJoe Hermaszewski2015-11-23
| | | | | | | | | | | | | This change adds switch cases for K_FOCUSGAINED and K_FOCUSLOST to the input handling functions in ex_getln.c and terminal.c. The handling is identical to what's found in edit.c (just calling apply_autocmds). If one enters cmdline-mode by feeding `:` and sends a focuslost event (by leaving the window for example) the text `<FocusLost>` will be inserted into the command line. There is similar behaviour in terminal mode. This patch corrects this behavior to fire the apropriate autocmd instead. Fixes #3714
* ex_getln: Extract command_line_handle_key from command_line_executeThiago de Arruda2015-10-26
|
* ex_getln: Convert `cmdline_{not_,}changed` labels into functionsThiago de Arruda2015-10-26
|
* ex_getln: refactor command line mode to use the `state_enter` loopThiago de Arruda2015-10-26
| | | | Split `getcmdline()` into command_line_{enter,check,execute}`
* ex_getln: Extract local variables from getcmdline() and fix code styleThiago de Arruda2015-10-26
| | | | | | | | Begin refactoring getcmdline() into a state that can be managed by the `state_enter()`: - Move local variables into a local CommandLineState structure - Fix code style in the entire function.
* main: Extract `normal_check` from `main_loop`Thiago de Arruda2015-10-26
| | | | | | The new function contains logic that must be executed after handling input in normal mode and also before the first main loop iteration. Also rename `main_loop` to `normal_enter` and move it to normal.c
* vim-patch:7.4.793Johan Klokkhammer Helsing2015-10-18
| | | | | | | Problem: Can't specify when not to ring the bell. Solution: Add the 'belloff' option. (Christian Brabandt) https://github.com/vim/vim/commit/165bc69d1b7f70ca9d5b657f35d0584ecb7b5183
* ex_getln: Fix memory leak when overwriting history itemZyX2015-10-08
|
* *: Fix lint errors found in new code in previously ignored filesZyX2015-10-08
|
* ex_getln: Return something from hist_type2char without assertsZyX2015-10-08
| | | | | Otherwise QuickBuild shows a warning that control may reach end of non-void function.
* *: Make ShaDa code use VimL values for additional_\* dataZyX2015-10-08
|
* shada: Initial support for merging historyZyX2015-10-08
| | | | Currently only merges history when reading ShaDa file. No tests yet.
* viminfo: First version of ShaDa file dumpingZyX2015-10-08
| | | | | | | | | | | | | | | | | | | | What works: 1. ShaDa file dumping: header, registers, jump list, history, search patterns, substitute strings, variables. 2. ShaDa file reading: registers, global marks, variables. Most was not tested. TODO: 1. Merging. 2. Reading history, local marks, jump and buffer lists. 3. Documentation update. 4. Converting some data from &encoding. 5. Safer variant of dumping viminfo (dump to temporary file then rename). 6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for reference).
* tui: Don't use 'pastetoggle' for automatic pastingThiago de Arruda2015-10-01
| | | | | | | Add a new special key that can be used by UIs to toggle the 'paste' option and use it in the TUI instead of the user's 'pastetoggle' value. Close #2843 #2092
* path.c: Fix memory leak in expand_wildcards().oni-link2015-09-09
| | | | | | A file that matches with one of the patterns in 'wildignore' is ignored when using expand_wildcards(). After removing ignored files, the array of (file name) matches can be empty. But an empty array is never freed.
* event: Refactor async event processingThiago de Arruda2015-08-13
| | | | | | | | | | - Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys.
* loop: Simplify loop.c and move some code to input.cThiago de Arruda2015-08-13
| | | | | | - Declare poll timer in Loop structure instead of a loop_poll_events local variable. - Move deferred event management to input.c
* event loop: New abstraction layer with refactored time/signal APIThiago de Arruda2015-07-17
| | | | | | | | | | - Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
* Remove char_u: add_pathsep()Mark Bainter2015-05-06
|
* vim-patch:7.4.542Felipe Morales2015-04-28
| | | | | | | | | | Problem: Using a range for window and buffer commands has a few problems. Cannot specify the type of range for a user command. Solution: Add the -addr argument for user commands. Fix problems. (Marcin Szamotulski https://code.google.com/p/vim/source/detail?name=v7-4-542
* Fix warnings: ex_getln.c: getexmodeline(): HI.Eliseo Martínez2015-04-27
| | | | | | | | | Problem : Dead increment @ 1795. Diagnostic : Harmless issue. Rationale : Line was necessary before (indent was used by the following while loop), but now that loop is removed, assignment is indeed dead. Resolution : Remove line.
* Fix warnings: ex_getln.c: init_history(): Nonnull attr passed null: HI.Eliseo Martínez2015-04-27
| | | | | | | | | | | Problem : Argument with 'nonnull' attribute passed null @ 4227. Diagnostic : Harmless issue. Rationale : It's true we're calling memset with NULL pointer, but it's also true we're doing it with zero size. We just thought that would work and do nothing (it was a way of avoiding to add a guard). It doesn't work, though, as memset requires nonnull arguments. Resolution : Add guard to avoid null argument.
* ex_getln: Fixes for some problems with getexmodeline()oni-link2015-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problems with line-input editing commands in Ex mode ('nvim -e' or 'Q' in normal mode): CTRL_U: Only after the next keystroke the complete line change is shown if the indentation was not 0. : asdfCTRL_U CTRL_T: Memory reallocation with ga_grows() before a memmove(), but pointers into the memory are not updated. :set sw=40 :CTRL_T ... Should complain about a memory error. CTRL_D: Trying to reduce an indentation of 0. :set sw=1 :CTRL_D Segfault Helped-by: Scott Prager <splinterofchaos@gmail.com>
* Replace vim_isspace() with ascii_isspace() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Merge #2491: Fix xfree of static value from vim_getenv() refactor.Eliseo Martínez2015-04-23
|\ | | | | | | Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
| * Fix xfree of static value in expand_shellcmd()Mark Bainter2015-04-23
| | | | | | | | | | | | | | | | The refactoring of vim_getenv() to remove the mustfree arg included reworking calling functions. expand_shellcmd was also using that to track its usage of the variable within the function, resulting in #2487. This change addresses that scenario and cleans up some of the function for style.
* | Fix warnings: ex_getln.c: init_history(): NP dereference: FP.Eliseo Martínez2015-04-23
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem : Dereference of null pointer @ 4199. Diagnostic : False positive. Rationale : Suggested error path implies that newlen == 0 and newlen > hislen, which implies hislen < 0, which is impossible (hislen is always between 0 and 10000). Resolution : Refactor code. Asserting oldlen >= 0 should have sufficed, but for some reason analyzer doesn't follow implications in that case. Asserting newlen != 0 || newlen <= hislen works. But the chance has been taken to do extensive refactoring of this function, as it was difficult to understand as it was. As a result of refactoring, assert is not needed anymore, as we don't call clear_hist_entry() in refactored version. Refactor : - Rework algorithm: * Drop guard for OOM case, which can't happen now. * Drop empty/growing/shrinking cases. Simplify to always doing the same. * Perform circular array reordering in all cases (before, it only did when shrinking). * Work in batches through memcpy/memset, instead of one entry at a time, as it did before. - Inline variable declarations. - Replace `ssize_t` by `int`. - Introduce oldlen as entry value of hislen. - Add a lot of comments. Helped-by: Scott Prager <splinterofchaos@gmail.com> Helped-by: oni-link <knil.ino@gmail.com>
* Merge #2418: Remove char_u (4)Eliseo Martínez2015-04-19
|\ | | | | | | | | | | Reviewed-by: Scott Prager <splinterofchaos@gmail.com> Reviewed-by: Michael Reed <m.reed@mykolab.com> Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
| * Refactor get_env() to respect const qualifierMark Bainter2015-04-18
| | | | | | | | | | | | Without the casts*, the compiler rightly warns about the os_getenv losing the qualifier. This refactor adds a variable to manage this properly, and renames the original variables to increase clarity.
| * Remove char_u: vim_getenv()Mark Bainter2015-04-17
| |
* | clipboard: cleanup `valid_yank_reg` and use it for `:redir`Björn Linse2015-04-17
|/ | | | | | | This fixes missing clipboard support for `:redir` Helped-By: Michael Reed <m.reed@mykolab.com> Helped-By: Scott Prager <splinterofchaos@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.
* Enable -Wconversion: fold.c.Eliseo Martínez2015-04-07
| | | | | | | | | | | | Refactor summary: - foldinfo_T.fi_lnum: int --> linenr_T Reorder field for optimal packing. - foldAddMarker(..., markerlen): int --> size_t * foldstartmarkerlen: int --> size_t - foldDelMarker(..., markerlen): int --> size_t * foldendmarkerlen: int --> size_t Helped-by: oni-link <knil.ino@gmail.com>
* Fix problem with coverity/105568 fix.oni-link2015-04-05
| | | | | | | | | | | | | | | The original fix 3db0a40d691c103a26ef3df74528f12d89b0fa61 does not work for more than one loop iteration, because memory allocated in the previous iteration could be reused in the current iteration. Because expand_wildcards() never reads the variables *num_file and *file before the first assignment to them, the initial values for these variables can be anything. So instead of calling expand_shellcmd() with *file = "" we set *file = NULL. That should help coverity see, that not a array-typed value is freed. Helped-by: Eliseo Martínez <eliseomarmol@gmail.com>
* Update comments for expand_wildcards functions.oni-link2015-04-05
| | | | | | | | | | | | | | | | | Be more specific in the description of mch_expand_wildcards(): This function will never free memory pointed to by its arguments. If OK is returned, *file will always point to allocated memory. *num_file is set to the number of pointers in *file. If FAIL is returned *file is set to NULL and *num_file to 0. If gen_expand_wildcards() returns FAIL, no memory allocation in this function needs to be undone. If expand_wildcards() returns FAIL, no memory allocation in this function needs to be undone. Helped-by: Eliseo Martínez <eliseomarmol@gmail.com> Helped-by: Michael Reed <m.reed@mykolab.com>
* vim-patch:7.4.324David Bürgin2015-03-30
| | | | | | | Problem: In Ex mode, cyrillic characters are not handled. (Stas Malavin) Solution: Support multi-byte characters in Ex mode. (Yukihiro Nakadaira) https://github.com/vim/vim/releases/tag/v7-4-324
* 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
* coverity/105568: Free of array-typed value: FP.Eliseo Martínez2015-03-22
| | | | | | | | | | | | | | Problem : Free of array-typed value @ 3628. Diagnostic : False positive. Rationale : expand_shell_cmd() is called with a mock value for file (*file = (char_u **)""). That means we want file to be filled with a new value. We can't use *file = NULL because that means we don't want file to be filled. Now, coverity incorrectly thinks that sentinel value is the one we are freeing up at some other later point, which is not the case. Resolution : Assert that, when we are freeing *file, its value is different than the sentinel one.
* ui: Refactor so that busy state won't be the defaultThiago de Arruda2015-03-18
| | | | | | | | | | | Even though assuming nvim is busy most times is simpler, it has a problem: A lot of unnecessary busy_start/busy_stop notifications are sent to the UI. That's because in the majority of scenarios almost no time is spent between `event_poll` calls. This restores the normal behavior which is to call busy_start only when nvim is going to perform some task that can take a significant amount of time. Also improve the usage of buffering in the TUI when changing the cursor state.