aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/options.lua
Commit message (Collapse)AuthorAge
* refactor(options): replace `p_force_(on|off)` with `immutable` (#26209)Famiu Haque2023-11-28
| | | | | | | Problem: We use the `p_force_on` and `p_force_off` variables to check if a variable is immutable and what its default value is. This is not only hacky and unintuitive, but also is limited to only boolean options. Solution: Replace `p_force_on` and `p_force_off` with an `immutable` property for options, which indicates if an option is immutable. Immutable options cannot be changed from their default value. Ref: #25672.
* refactor(sign): move legacy signs to extmarksLuuk van Baal2023-11-17
| | | | | | | | | | | | | | | | | | | | Problem: The legacy signlist data structures and associated functions are redundant since the introduction of extmark signs. Solution: Store signs defined through the legacy commands in a hashmap, placed signs in the extmark tree. Replace signlist associated functions. Usage of the legacy sign commands should yield no change in behavior with the exception of: - "orphaned signs" are now always removed when the line it is placed on is deleted. This used to depend on the value of 'signcolumn'. - It is no longer possible to place multiple signs with the same identifier in a single group on multiple lines. This will now move the sign instead. Moreover, both signs placed through the legacy sign commands and through |nvim_buf_set_extmark()|: - Will show up in both |sign-place| and |nvim_buf_get_extmarks()|. - Are displayed by increasing sign identifier, left to right. Extmark signs used to be ordered decreasingly as opposed to legacy signs.
* feat(tui): add 'termsync' option (#25871)Gregory Anders2023-11-14
| | | | | | | The 'termsync' option enables a mode (provided the underlying terminal supports it) where all screen updates during a redraw cycle are buffered and drawn together when the redraw is complete. This eliminates tearing or flickering in cases where Nvim redraws slower than the terminal redraws the screen.
* fix(defaults): set 'fsync' #26034Ploum2023-11-14
| | | | | | | | Problem: 'nofsync' may lose data if the system has a hard shutdown. #9888 Solution: Change default to 'fsync'. This may be revisited in the future when 'nofsync' can be made safer.
* vim-patch:9.0.2103: recursive callback may cause issues on some archs (#26013)zeertzjq2023-11-13
| | | | | | | | | | | | | | | | | | | | | | | Problem: recursive callback may cause issues on some archs Solution: Decrease the limit drastically to 20 Recursive callback limit causes problems on some architectures Since commit 47510f3d6598a1218958c03ed11337a43b73f48d we have a test that causes a recursive popup callback function to be executed. However it seems the current limit of 'maxfuncdepth' option value is still too recursive for some 32bit architectures (e.g. 32bit ARM). So instead of allowing a default limit of 100 (default value for 'maxfuncdepth'), let's reduce this limit to 20. I don't think there is a use case where one would need such a high recursive callback limit and a limit of 20 seems reasonable (although it is currently hard-coded). closes: vim/vim#13495 closes: vim/vim#13502 https://github.com/vim/vim/commit/2076463e383901cef44685aaf4b63e4306444f9e Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:1b08d2cd0789 (#25993)zeertzjq2023-11-12
| | | | | | | | | runtime(doc): clarify when formatoptions applies closes: vim/vim#13503 https://github.com/vim/vim/commit/1b08d2cd0789fd9aaae148a64ff46342730022d7 Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:9.0.2095: statusline may look different than expected (#25941)zeertzjq2023-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: statusline may look different than expected Solution: do not check for highlighting of stl and stlnc characters statusline fillchar may be different than expected If the highlighting group for the statusline for the current window |hl-StatusLine| or the non-current window |hl-StatusLineNC| are cleared (or do not differ from each other), than Vim will use the hard-coded fallback values '^' (for the non-current windows) or '=' (for the current window). I believe this was done, to make sure the statusline will always be visible and be distinguishable from the rest of the window. However, this may be unexpected, if a user explicitly defined those fillchar characters just to notice that those values are then not used by Vim. So, let's assume users know what they are doing and just always return the configured stl and stlnc values. And if they want the statusline to be non-distinguishable from the rest of the window space, so be it. It is their responsibility and Vim shall not know better what to use. fixes: vim/vim#13366 closes: vim/vim#13488 https://github.com/vim/vim/commit/6a650bf696f1df3214b3d788947447c5bbf1a77d Co-authored-by: Christian Brabandt <cb@256bit.org>
* vim-patch:8ebdbc9e6d80 (#25816)zeertzjq2023-10-29
| | | | | | | | | | runtime(doc): all secure options should note this restriction in the documentation (vim/vim#13448) Problem: Not all secure options document their status Solution: Describe secure context :set restrictions in each help entry https://github.com/vim/vim/commit/8ebdbc9e6d80b707c2b2d923e702dc86bf902923 Co-authored-by: dkearns <dougkearns@gmail.com>
* vim-patch:partial:5985879e3c36 (#25780)zeertzjq2023-10-26
| | | | | | | | | | | | | runtime(doc): Fix typos in several documents (vim/vim#13420) * Fix typos in several documents * Update runtime/doc/terminal.txt https://github.com/vim/vim/commit/5985879e3c36383155f84649fa42d06813a1893e Skip runtime/doc/indent.txt: not ported yet Co-authored-by: h_east <h.east.727@gmail.com> Co-authored-by: K.Takata <kentkt@csc.jp>
* vim-patch:9.0.2065: EXPAND flag set for filetype option (#25779)zeertzjq2023-10-26
| | | | | | | | | | | | | | | | | | | | | | | | Problem: EXPAND flag set for filetype option Solution: Remove P_EXPAND flag from the 'filetype' option Remove P_EXPAND flag from the 'filetype' option Problem: P_EXPAND flag is erroneously set for 'filetype' option Solution: Remove the P_EXPAND flag This flag is used by string options that accept file path values. See :help set_env. This appears to have been included in d5e8c92 and resulted from an incorrect implementation of 'filetype' completion. See vim/vim#12900 for a small discussion. related: vim/vim#12900 closes: vim/vim#13416 https://github.com/vim/vim/commit/3932072ab435eb171ab55b2a2c0185358cd0d7bf Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* feat(complete): support f flag for complete buffer partglepnir2023-10-21
|
* vim-patch:9.0.2035: [security] use-after-free with wildmenu (#25687)zeertzjq2023-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: [security] use-after-free with wildmenu Solution: properly clean up the wildmenu when exiting Fix wildchar/wildmenu/pum memory corruption with special wildchar's Currently, using `wildchar=<Esc>` or `wildchar=<C-\>` can lead to a memory corruption if using wildmenu+pum, or wrong states if only using wildmenu. This is due to the code only using one single place inside the cmdline process loop to perform wild menu clean up (by checking `end_wildmenu`) but there are other odd situations where the loop could have exited and we need a post-loop clean up just to be sure. If the clean up was not done you would have a stale popup menu referring to invalid memory, or if not using popup menu, incorrect status line (if `laststatus=0`). For example, if you hit `<Esc>` two times when it's wildchar, there's a hard-coded behavior to exit command-line as a failsafe for user, and if you hit `<C-\><C-\><C-N>` it will also exit command-line, but the clean up code would not have hit because of specialized `<C-\>` handling. Fix Ctrl-E / Ctrl-Y to not cancel/accept wildmenu if they are also used for 'wildchar'/'wildcharm'. Currently they don't behave properly, and also have potentially memory unsafe behavior as the logic is currently not accounting for this situation and try to do both. (Previous patch that addressed this: vim/vim#11677) Also, correctly document Escape key behavior (double-hit it to escape) in wildchar docs as it's previously undocumented. In addition, block known invalid chars to be set in `wildchar` option, such as Ctrl-C and `<CR>`. This is just to make it clear to the user they shouldn't be set, and is not required for this bug fix. closes: vim/vim#13361 https://github.com/vim/vim/commit/8f4fb007e4d472b09ff6bed9ffa485e0c3093699 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* refactor(options): make `did_set_shada` a normal option callbackFamiu Haque2023-10-17
|
* vim-patch:9.0.2030: no max callback recursion limit (#25655)zeertzjq2023-10-15
| | | | | | | | | | | | | | | Problem: no max callback recursion limit Solution: bail out, if max call recursion for callback functions has been reached. This checks the 'maxfuncdepth' setting and throws E169 when a callback function recursively calls itself. closes: vim/vim#13337 closes: vim/vim#13339 https://github.com/vim/vim/commit/47510f3d6598a1218958c03ed11337a43b73f48d Co-authored-by: Christian Brabandt <cb@256bit.org>
* docs: restore accidentally removed line in :h 'ignorecase' (#25651)zeertzjq2023-10-15
|
* vim-patch:2bbd0d30eebd (#25637)zeertzjq2023-10-14
| | | | | | | | | | | | | | | | | | | runtime(doc): Improve command-line completion docs (vim/vim#13331) * Improve command-line completion docs Add more details about 'ignorecase' and its effect on cmdline completion. Make sure keys used in wildmenu are properly documented and linked in the keys' documentation entries, and in `:h index` for proper cross-referencing, as wildmenu popup is slightly different from insert-mode popup menu. * Fix docs typos https://github.com/vim/vim/commit/2bbd0d30eebdea66c0da3895e83d999ed6ad83fb Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:9.0.2009: cmdline-completion for comma-separated options wrong ↵zeertzjq2023-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#25569) Problem: cmdline-completion for comma-separated options wrong Solution: Fix command-line expansions for options with filenames with commas Fix command-line expansions for options with filenames with commas Cmdline expansion for option values that take a comma-separated list of file names is currently not handling file names with commas as the commas are not escaped. For such options, the commas in file names need to be escaped (to differentiate from a comma that delimit the list items). The escaped comma is unescaped in `copy_option_part()` during option parsing. Fix as follows: - Cmdline completion for option values with comma-separated file/folder names will not start a new match when seeing `\\,` and will instead consider it as one value. - File/folder regex matching will strip the `\\` when seeing `\\,` to make sure it can match the correct files/folders. - The expanded value will escape `,` with `\\,`, similar to how spaces are escaped to make sure the option value is correct on the cmdline. This fix also takes into account the fact that Win32 Vim handles file name escaping differently. Typing '\,' for a file name results in it being handled literally but in other platforms '\,' is interpreted as a simple ',' and commas need to be escaped using '\\,' instead. Also, make sure this new logic only applies to comma-separated options like 'path'. Non-list options like 'set makeprg=<Tab>' and regular ex commands like `:edit <Tab>` do not require escaping and will continue to work. Also fix up documentation to be clearer. The original docs are slightly misleading in how it discusses triple slashes for 'tags'. closes: vim/vim#13303 related: vim/vim#13301 https://github.com/vim/vim/commit/54844857fd6933fa4f6678e47610c4b9c9f7a091 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* fix(path): restore space separation in 'path' (#25571)zeertzjq2023-10-10
| | | Removing this behavior causes more inconsistencies and bugs.
* docs: miscellaneous doc and type fixes (#25554)Maria José Solano2023-10-10
|
* feat(ui-ext): make 'mousehide' into proper ui_option (#25532)Jaehoon Hwang2023-10-09
|
* fix: gf fails on "foo/bar.txt:1:2" on WindowsLeonardo Mello2023-10-06
| | | | | | | | | | | | | | | Problem: On Windows, "gf" fails on a filepath that has a line:column suffix. Example: E447: Can't find file "src/app/core/services/identity/identity.service.ts:64:23" Solution: - Remove ":" from 'isfname' on Windows. Colon is not a valid filename character (except for the drive-letter). - Handle drive letters specially in file_name_in_line(). Fixes #25160
* vim-patch:20f48d5b2ddbzeertzjq2023-10-03
| | | | | | | | runtime(doc): mention how to disable folding in diff mode (vim/vim#13242) https://github.com/vim/vim/commit/20f48d5b2ddb9fdc29e83f0da6f31f895eaeab47 Co-authored-by: dundargoc <33953936+dundargoc@users.noreply.github.com>
* feat(completion): support completing more string optionszeertzjq2023-10-01
|
* vim-patch:9.0.1958: cannot complete option valueszeertzjq2023-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: cannot complete option values Solution: Add completion functions for several options Add cmdline tab-completion for setting string options Add tab-completion for setting string options on the cmdline using `:set=` (along with `:set+=` and `:set-=`). The existing tab completion for setting options currently only works when nothing is typed yet, and it only fills in with the existing value, e.g. when the user does `:set diffopt=<Tab>` it will be completed to `set diffopt=internal,filler,closeoff` and nothing else. This isn't too useful as a user usually wants auto-complete to suggest all the possible values, such as 'iblank', or 'algorithm:patience'. For set= and set+=, this adds a new optional callback function for each option that can be invoked when doing completion. This allows for each option to have control over how completion works. For example, in 'diffopt', it will suggest the default enumeration, but if `algorithm:` is selected, it will further suggest different algorithm types like 'meyers' and 'patience'. When using set=, the existing option value will be filled in as the first choice to preserve the existing behavior. When using set+= this won't happen as it doesn't make sense. For flag list options (e.g. 'mouse' and 'guioptions'), completion will take into account existing typed values (and in the case of set+=, the existing option value) to make sure it doesn't suggest duplicates. For set-=, there is a new `ExpandSettingSubtract` function which will handle flag list and comma-separated options smartly, by only suggesting values that currently exist in the option. Note that Vim has some existing code that adds special handling for 'filetype', 'syntax', and misc dir options like 'backupdir'. This change preserves them as they already work, instead of converting to the new callback API for each option. closes: vim/vim#13182 https://github.com/vim/vim/commit/900894b09a95398dfc75599e9f0aa2ea25723384 Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
* vim-patch:5277cfaf8afe (#25397)zeertzjq2023-09-28
| | | | | runtime(doc): mention mouse scrolling in scrollbind-quickadj (vim/vim#13190) https://github.com/vim/vim/commit/5277cfaf8afe847b7d4dcde6057fbecb001ab64e
* refactor(options)!: graduate some more shortmess flagsbfredl2023-09-25
| | | | | | | | A lot of updated places in the docs were already incorrect since long since they did not reflect the default behaviour. "[dos format]" could've been argued being better for discoverability but that ship has already sailed as it is no longer displayed by default.
* docs: remove "f" from default 'shortmess' valueGregory Anders2023-09-24
| | | | | | | The "f" flag was removed in f7da4722570617bd8927e7aa533fa9a608c45bba. The value of the "f" flag is no longer listed in the 'shortmess' description and it cannot be disabled, so having it in the default value is pointless and confusing.
* fix(ui): always use stl/stlnc fillchars when drawing statusline (#25267)tj-moody2023-09-24
|
* refactor(options)!: graduate shortmess+=f flagbfredl2023-09-23
| | | | | | | Not everything needs to be crazy overconfigurable. Also fixes a warning in latest clang which didn't approve of the funky math switch statement in append_arg_number
* vim-patch:9.0.1921: not possible to use the jumplist like a stack (#25278)zeertzjq2023-09-21
| | | | | | | | | | | | | | | | | | | | | | | | Problem: not possible to use the jumplist like a stack Solution: Add the 'jumpoptions' setting to make the jumplist a stack. Add an option for using jumplist like tag stack related: vim/vim#7738 closes: vim/vim#13134 ported from NeoVim: - https://neovim.io/doc/user/motion.html#jumplist-stack - neovim/neovim@39094b3 - https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior Based on the feedback in the previous PR, it looks like many people like this option. https://github.com/vim/vim/commit/87018255e3ad0f4dfa03e20318836d24af721caf Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com> Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
* docs: misc #24561Justin M. Keyes2023-09-20
| | | | fix #24699 fix #25253
* docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
|
* docs: fix typos and other small fixes (#25005)dundargoc2023-09-14
| | | | | | | Co-authored-by: nuid64 <lvkuzvesov@proton.me> Co-authored-by: Mike Smith <10135646+mikesmithgh@users.noreply.github.com> Co-authored-by: XTY <xty@xty.io> Co-authored-by: Empa <emanuel@empa.xyz> Co-authored-by: kyu08 <49891479+kyu08@users.noreply.github.com>
* docs: various clarifications (#24876)zeertzjq2023-08-26
|
* feat(defaults): treat "•" as a list item prefix #24623Justin M. Keyes2023-08-09
| | | | | | | | Problem: Nvim docs use "•" as a list item prefix but `gw{motion}` doesn't format such lists by default. Solution: Change the 'comments' option to include "fb:•" by default.
* docs(options): fix mistakes (#24568)zeertzjq2023-08-05
|
* docs(options): take ownership of options.txt (#24528)Lewis Russell2023-08-04
| | | | | | | | | | | | | | * docs(options): take ownership of options.txt - `src/nvim/options.lua` is now the source of truth - generate runtime/lua/vim/_meta/options.lua * fixup! zeer comments * fixup! zeer comments (2) * fixup! re-enable luacheck * fixup! regen
* refactor(defaults): do not use C specific default values for options (#22500)Gregory Anders2023-06-06
| | | | | | | | | | The options 'path', 'include', and 'define' all use C-specific default values. This may have made sense a long time ago when Vim was mostly used just for writing C, but this is no longer the case, and we have ample support for filetype specific configuration. Make the default values of these options empty and move the C-specific values into a filetype plugin where they belong. Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* defaults: shortmess+=C #23907Justin M. Keyes2023-06-05
| | | | | | | | | Problem: Completion messages such as "scanning tags" are noisy and generally not useful on most systems. Most users probably aren't aware that this is configurable. Solution: Set `shortmess+=C`.
* vim-patch:9.0.0640: cannot scroll by screen line if a line wrapsLuuk van Baal2023-05-02
| | | | | | | | | | | | | | | | | Problem: Cannot scroll by screen line if a line wraps. Solution: Add the 'smoothscroll' option. Only works for CTRL-E and CTRL-Y so far. https://github.com/vim/vim/commit/f6196f424474e2a9c160f2a995fc2691f82b58f9 vim-patch:9.0.0641: missing part of the new option code Problem: Missing part of the new option code. Solution: Add missing WV_SMS. https://github.com/vim/vim/commit/bbbda8fd81f6d720962b67ae885825bad9be4456 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:9.0.1374: function for setting options not used consistentlyLewis Russell2023-04-28
| | | | | | | | Problem: Function for setting options not used consistently. Solution: Use a function for 'encoding' and terminal options. (Yegappan Lakshmanan, closes vim/vim#12099) https://github.com/vim/vim/commit/c727b19e9f1df36e44321d933334c7b4961daa54
* vim-patch:9.0.1369: still some "else if" constructs for setting optionsLewis Russell2023-04-28
| | | | | | | | Problem: Still some "else if" constructs for setting options. Solution: Add a few more functions for handling options. (Yegappan Lakshmanan, closes vim/vim#12090) https://github.com/vim/vim/commit/c6ff21e876af0e3ad59664dd0f69359c4b6e9f1d
* vim-patch:9.0.1359: too many "else if" statements in handling optionsLewis Russell2023-04-28
| | | | | | | | Problem: Too many "else if" statements in handling options. Solution: Add more functions for handling option changes. (Yegappan Lakshmanan, closes vim/vim#12060) https://github.com/vim/vim/commit/5da901bb68717b2baff6e971c1517219b6ee3a67
* vim-patch:9.0.1353: too many "else if" statements to handle option valuesLewis Russell2023-04-28
| | | | | | | | Problem: Too many "else if" statements to handle option values. Solution: Add more functions to handle option value changes. (Yegappan Lakshmanan, closes vim/vim#12058) https://github.com/vim/vim/commit/6d611de58c8e324491415da8e79c6bd3faa3e848
* vim-patch:9.0.1345: too many "else if" statements for handling optionsLewis Russell2023-04-28
| | | | | | | | Problem: Too many "else if" statements for handling options. Solution: Add more functions to handle options. (Yegappan Lakshmanan, closes vim/vim#12051) https://github.com/vim/vim/commit/8ad862a1f9d6f4128de856ccfabbeb7546d33b98
* vim-patch:9.0.1330: handling new value of an option has a long "else if" chainLewis Russell2023-04-28
| | | | | | | Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes vim/vim#12015) https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e
* refactor(defaults)!: change default 'commentstring' value to empty (#22862)zeertzjq2023-04-02
|
* fix(shell): on Windows :make does not echo #22728Enan Ajmain2023-03-19
| | | | | | | | | | | | | | Problem: On Windows, :make does not display the output of the program it runs. The cause is the default 'shellpipe'. On Linux, nvim uses `tee` to redirect the output to both stdout and the error file. In Windows, for both cmd.exe and powershell, the output is only redirected to the error file. Solution: - On Windows, change the 'shellpipe' default to "2>&1| tee". - Nvim includes `tee` in its Windows package. - Document recommended defaults for powershell. Fixes #12910
* feat(options)!: deprecate paste, remove pastetoggle (#22647)ii142023-03-13
| | | | | we cannot remove 'paste'. It is very common in plugins and configs. 'pastetoggle' can and should be removed though, it's a total waste of everyone's time because it generates bug reports and doesn't work well, and is useless because bracketed-paste works better.
* feat(edit)!: remove old c implementation of hebrew keymapbfredl2023-02-28
| | | | | | | This feature has long been obsolete. The 'keymap' option can be used to support language keymaps, including hebrew and hebrewp (phonetic mapping). There is no need to keep the old c code with hardcoded keymaps for some languages.