aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
Commit message (Collapse)AuthorAge
...
* vim-patch:7.4.524 #2559David Bürgin2015-05-09
| | | | | | | | | Problem: When using ":ownsyntax" spell checking is messed up. (Issue 78) Solution: Use the window-local option values. (Christian Brabandt) https://github.com/vim/vim/commit/v7-4-524 See also https://code.google.com/p/vim/issues/detail?id=78
* Remove char_u: FullName_save()Mark Bainter2015-05-06
|
* vim-patch:7.4.659 + testMichael Reed2015-05-01
| | | | | | | | | | Problem: When 'ruler' is set the preferred column is reset. (Issue 339) Solution: Don't set curswant when redrawing the status lines. https://code.google.com/p/vim/source/detail?r=v7-4-659 Helped-by: David Bürgin <676c7473@gmail.com> Based on #2347 by @pvinis
* Remove obsolete vi options #2553David Bürgin2015-05-01
| | | | | | | | | | | | | | | | | | | | | | These options were never implemented in Vim. They are documented under |missing-options| in runtime/doc/vi_diff.txt: 'autoprint' 'beautify' 'flash' 'graphic' 'hardtabs' 'mesg' 'novice' 'open' 'optimize' 'redraw' 'slowopen' 'sourceany' 'w300' 'w1200' 'w9600' References #2548.
* vim-patch:7.4.711David Bürgin2015-04-27
| | | | | | | Problem: Missing change in one file. Solution: Also change option.c https://github.com/vim/vim/releases/tag/v7-4-711
* 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
|
* 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: get_mess_lang()Mark Bainter2015-04-18
|
* Remove char_u: set_helplang_default()Mark Bainter2015-04-18
|
* Remove char_u: vim_setenv()Mark Bainter2015-04-18
|
* Remove char_u: vim_getenv()Mark Bainter2015-04-17
|
* 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.
* Add new highlight groups TermCursor/TermCursorNCMarco Hinz2015-04-09
| | | | | | | These highlight groups replace the old mechanism of setting: - {g,b}:terminal_focused_cursor_highlight - {g,b}:terminal_unfocused_cursor_highlight
* 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>
* vim-patch:7.4.336 #2299David Bürgin2015-04-02
| | | | | | | Problem: Setting 'history' to a big value causes out-of-memory errors. Solution: Limit the value to 10000. (Hirohito Higashi) https://github.com/vim/vim/tree/v7-4-336
* vim-patch:7.4.502 #2282David Bürgin2015-03-29
| | | | | | | | Problem: Language mapping also applies to mapped characters. Solution: Add the 'langnoremap' option, when on 'langmap' does not apply to mapped characters. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-502
* terminal: New module that implements a terminal emulatorThiago de Arruda2015-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit integrates libvterm with Neovim and implements a terminal emulator with nvim buffers as the display mechanism. Terminal buffers can be created using any of the following methods: - Opening a file with name following the "term://[${cwd}//[${pid}:]]${cmd}" URI pattern where: - cwd is the working directory of the process - pid is the process id. This is just for use in session files where a pid would have been assigned to the saved buffer title. - cmd is the command to run - Invoking the `:terminal` ex command - Invoking the `termopen` function which returns a job id for automating the terminal window. Some extra changes were also implemented to adapt with terminal buffers. Here's an overview: - The `main` function now sets a BufReadCmd autocmd to intercept the term:// URI and spawn the terminal buffer instead of reading the file. - terminal buffers behave as if the following local buffer options were set: - `nomodifiable` - `swapfile` - `undolevels=-1` - `bufhidden=hide` - All commands that delete buffers(`:bun`, `:bd` and `:bw`) behave the same for terminal buffers, but only work when bang is passed(eg: `:bwipeout!`) - A new "terminal" mode was added. A consequence is that a new set of mapping commands were implemented with the "t" prefix(tmap, tunmap, tnoremap...) - The `edit` function(which enters insert mode) will actually enter terminal mode if the current buffer is a terminal - The `put` operator was adapted to send data to the terminal instead of modifying the buffer directly. - A window being resized will also trigger a terminal resize if the window displays the terminal.
* buffer: Move b_p_ma(modifiable) checks into the MODIFIABLE macroThiago de Arruda2015-03-25
|
* doc: Remove refs to 'compatible' and friendsMichael Reed2015-03-24
| | | | | | | Also remove some MS-DOS references on lines already being touched. Based on this commit: https://github.com/justinmk/neovim/commit/e4db01ca8707c34dc808d7f6378aa3aba9002a2d
* 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
* misc2.c: Move emsg* functions to message.c #2152Michael Reed2015-03-19
| | | | Clean up said functions and some outdated comments while we're at it.
* ui: Replace cursor_{on,off} by busy_{stop,start}Thiago de Arruda2015-03-15
| | | | | | | | | | | | | | | | | | | | | | | | Switching cursor off is only necessary in two occasions: - When redrawing to avoid terminal flickering - When the editor is busy The first can now be handled by the TUI, so most calls to ui_cursor_off can be removed from the core. So, before this commit it was only necessary to switch the cursor off to notify the user that nvim was running some long operation. Now the cursor_{on,off} functions have been replaced by busy_{stop,start} which can be handled in a UI-specific way(turning the cursor off or showing a busy indicator, for example). To make things even more simpler, nvim is always busy except when waiting for user input or other asynchronous events: It automatically switches to a non-busy state when the event loop is about to be entered for more than 100 milliseconds. `ui_busy_start` can be called when its not desired to change the busy state in the event loop (As its now done by functions that perform blocking shell invocations).
* Remove redundant castsAnton Ovchinnikov2015-03-09
|
* set_init_1: mb_init() on fallback encoding (utf8) #2106Floris van Liere2015-03-07
| | | | | | | | | | | | Explanation: Running `:set encoding=utf-8` _after_ startup correctly initializes multibyte; but mb_init() was _not_ called during startup if locale detection (enc_locale()) failed. This wasn't a problem in Vim because the Vim default encoding (latin1) does not require mb_init(). But Nvim defaults to utf8, so mb_init() is required. closes #1271 closes #1672
* Macro cleanup: HAVE_SANDBOXMichael Reed2015-03-05
|
* illumos requires the use of limits.h for things like INT_MAX #2049Mike Zeller2015-02-26
|
* Simpler handling for "always-on"/"always-off" options. #2002Florian Walch2015-02-22
| | | | | 'compatible' and 'edcompatible' are forced to be off. 'ttyfast' is forced to be on.
* 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: Passing-by: Remove dead code (MACOS_CONVERT).Eliseo Martínez2015-02-18
| | | | MacOS (pre Mac OS X) is not supported anymore.
* cleanup: Remove unused functions and builtin termcapsThiago de Arruda2015-02-16
|
* 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 'edcompatible' #1911Michael Reed2015-02-16
| | | | Closes #1902
* Remove 'ttyfast'Michael Reed2015-02-08
| | | | | | | | refs #1045 #1051 This was enabled by default a while ago (#1051), and has apparently not created any issues. The amount of actual code related to it is tiny, so it has been removed.
* Add EndOfBuffer hl group for ~ lines after the last line in buffersMarco Hinz2015-02-02
| | | | | | | | This makes it possible to highlight the lines starting with ~ at the end of buffers and other elements highlighted using NonText. As proposed by mhinz at https://groups.google.com/forum/#!topic/vim_dev/p3de1iU1GXI/discussion
* vim-patch:7.4.462Pavel Platto2015-01-20
| | | | | | | | | Problem: Setting the local value of 'backupcopy' empty gives an error. (Peter Mattern) Solution: When using an empty value set the flags to zero. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?r=v7-4-462
* Remove long_u: buffer_defs.h: Refactor long_u.Eliseo Martínez2015-01-19
|
* Remove long_u: option.c: Refactor long_u.Eliseo Martínez2015-01-19
|
* Remove long_u: option.c: Enable -Wconversion.Eliseo Martínez2015-01-19
|
* Macro cleanup: PROTOMichael Reed2015-01-14
| | | | | | Regarding dict_lookup() in eval.c: both definitions are the same, the only difference being the spacing between the indirection operator and the indentation level.
* 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.
* Remove long_u: term: Enable -Wconversion.Eliseo Martínez2015-01-10
|
* Change 'history' default to 50.Florian Walch2015-01-04
| | | | | Default as of Vim 7.4.336 (not yet ported). Runtime files already mention this new default value.
* vim-patch:7.4.538Florian Walch2014-12-24
| | | | | | | | Problem: Tests fail with small features plus Python. Solution: Disallow weird combination of options. Do not set "fdm" when folding is disabled. https://code.google.com/p/vim/source/detail?r=v7-4-538
* vim-patch:7.4.438Florian Walch2014-12-23
| | | | | | | Problem: Cached values for 'cino' not reset for ":set all&". Solution: Call parse_cino(). (Yukihiro Nakadaira) https://code.google.com/p/vim/source/detail?r=v7-4-438
* vim-patch:7.4.456Marco Hinz2014-12-20
| | | | | | | | Problem: 'backupcopy' is global, cannot write only some files in a different way. Solution: Make 'backupcopy' global-local. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-456
* Use ARRAY_SIZE where Coccinelle wasn't able to do itFelipe Oliveira Carvalho2014-12-18
|
* Define and use the ARRAY_SIZE macroFelipe Oliveira Carvalho2014-12-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A similar macro is defined in the Linux kernel [1]. To refactor the code I used a slightly modified Coccinelle script I found in [2]. ```diff // Use the macro ARRAY_SIZE when possible // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/array.html // Options: -I ... -all_includes can give more complete results @@ type T; T[] E; @@ - (sizeof(E)/sizeof(*E)) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(E[...])) + ARRAY_SIZE(E) @@ type T; T[] E; @@ - (sizeof(E)/sizeof(T)) + ARRAY_SIZE(E) @n@ identifier AS,E; @@ - #define AS(E) ARRAY_SIZE(E) @@ expression E; identifier n.AS; @@ - AS(E) + ARRAY_SIZE(E) ``` `spatch --in-place --sp-file array_size.cocci -I src/ -I build/include/ -I build/src/nvim/auto/ src/nvim/*.c` [1] http://lxr.free-electrons.com/source/include/linux/kernel.h#L54 [2] http://www.emn.fr/z-info/coccinelle/rules/#macros
* Fix warnings: option.c: makeset()/put_setnum(): Various (3): FP.Eliseo Martínez2014-12-17
| | | | | | | | | | | | | | | | | | | | | | | | Problems : Dereference of null pointer @ 6251. Dereference of null pointer @ 6267. Dereference of null pointer @ 6351. Diagnostic : False positive. Rationale : Problems occur if varp is null after `varp = get_varp_scope(p, opt_flags);`. That can only happen if option is hidden. Those are options that can be set (for backwards compatibility reasons) but that do nothing (see `:h hidden-options`, `:h missing-options`). In particular, even if setting them is allowed, value is not stored, so these options have no real value. So, suggested error paths should not occur, as checks comparing option value and default value should discard them. Resolution : We could just `assert(varp)` before line 6235 `varp_local = varp;`. That was tried and worked. But we prefer modifying the code to explicitly skip hidden options. A redundant `!istermoption(p)` is removed too (it's already checked by for loop condition).