Commit Graph

28202 Commits

Author SHA1 Message Date
Justin M. Keyes
59d117ec99 build: enable lintlua for test/ dir
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable stylua for entire `test/` directory.
- Exclude these high-churn files until this issue is resolved: https://github.com/JohnnyMorganz/StyLua/issues/829
  ```
  test/functional/ui/decorations_spec.lua  | 3560 ++++++++++++++++++++++++++++++++++++----------------
  test/functional/ui/float_spec.lua        | 5826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
  test/functional/ui/multigrid_spec.lua    | 1349 ++++++++++++++------
  ```
- Make surgical changes to these files (or add `stylua: ignore` in some
  small scopes) to improve the result:
  ```
  test/functional/vimscript/msgpack_functions_spec.lua | 1414 +++++++++++++++------
  test/functional/api/buffer_spec.lua                  | 1389 +++++++++++----------
  test/functional/api/vim_spec.lua                     | 2740 +++++++++++++++++++++++-----------------
  ```
- These "high churn" files are NOT excluded because the changes are
  largely an improvement:
  ```
  test/functional/plugin/lsp_spec.lua      | 2198 ++++++++++++++++++---------------
  test/functional/plugin/shada_spec.lua    | 4078 +++++++++++++++++++++++++++++++++++-------------------------
  test/functional/ui/cmdline_spec.lua      | 1199 +++++++++++-------
  test/functional/ui/popupmenu_spec.lua    | 1267 +++++++++++--------
  test/functional/ui/messages_spec.lua     | 1643 +++++++++++++++---------
  ```
- TODO: how to check "all directories"? With `GLOB_DIRS *` and `/.deps/` (or
  `.deps/`) in `.styluaignore`, Lua code in `.deps/` is still checked...
2024-01-03 02:09:28 +01:00
dundargoc
b3eda5e73f docs: small fixes
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Co-authored-by: HiPhish <hiphish@posteo.de>
Co-authored-by: JD Rudie <rudiejd@miamioh.edu>
2024-01-02 22:00:06 +01:00
dundargoc
735aa4c4c8 refactor: remove redundant struct names
A struct can be anonymous if only its typedef is used.
2024-01-02 21:59:12 +01:00
Justin M. Keyes
3f35c69b23
refactor(api): redundant ml_mfp check #26059
buf_ensure_loaded already checks `(buf->b_ml.ml_mfp != NULL)`. #25823

TODO:
- #10070 #13201 All buffer-related API functions except
  `nvim_buf_is_loaded` (and `nvim_buf_is_valid`?) should always call
  `buf_ensure_loaded`. Because the _common case_ is that plugins expect
  the buffer to "just work"—and for the uncomon, performance-sensitive
  case, the script can check `nvim_buf_is_loaded` to avoid implicitly
  loading a buffer.
- Update documentation to clarify the above semantics.
2024-01-02 12:33:41 -08:00
Mathias Fußenegger
91d76ac941
docs(lsp): add supports_method to vim.lsp.client docs (#26852) 2024-01-02 18:52:29 +01:00
Mathias Fußenegger
5dc0bdfe98
docs(glob): add glob module (#26853) 2024-01-02 14:32:43 +01:00
zeertzjq
2bf68df289
vim-patch:10b4f75d4c03 (#26846)
runtime(dist/ft): improve filetype detection for *.v (V/Verilog/Coq)

Patch provided by Dan Alt

closes: vim/vim#13793

10b4f75d4c

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02 19:06:43 +08:00
Christian Clason
e98bef259a vim-patch:34d15155fc45
runtime(menu): regenerate synmenu

34d15155fc

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-02 11:43:18 +01:00
Christian Clason
b8df4b2dff vim-patch:b16fc9805535
runtime(sh): Update sh syntax and add local keyword for bash (vim/vim#13806)

add `local` in shStatement

b16fc98055

Co-authored-by: Lucien Grondin <grondilu@yahoo.fr>
2024-01-02 11:43:18 +01:00
Christian Clason
99f1530a4f vim-patch:d08059ab48b8
runtime(ruby): Update ftplugin and omni-complete (vim/vim#13805)

d08059ab48

Co-authored-by: dkearns <dougkearns@gmail.com>
2024-01-02 11:43:18 +01:00
luukvbaal
3299797150
fix(drawline): consider position in linebuf for foldcolumn (#26803) 2024-01-02 17:59:23 +08:00
Mathias Fussenegger
e0112aa1d2 refactor(lsp): fix remaining luals warnings in lsp.rpc 2024-01-02 10:49:14 +01:00
TheLeoP
3f788e73b3
feat(lsp): support connect via named pipes/unix domain sockets (#26032)
Closes https://github.com/neovim/neovim/issues/26031

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
2024-01-02 10:08:36 +01:00
Evgeni Chasnovski
4ee656e4f3
feature(diagnostic): add vim.diagnostic.count() (#26807)
feat(diagnostic): add `vim.diagnostic.count()`

Problem: Getting diagnostic count based on the output of
  `vim.diagnostic.get()` might become costly as number of diagnostic
  entries grows. This is because it returns a copy of diagnostic cache
  entries (so as to not allow users to change them in place).
  Getting information about diagnostic count is frequently used in
  statusline, so it is important to be as fast as reasonbly possible.

Solution: Add `vim.diagnostic.count()` which computes severity
  counts without making copies.
2024-01-01 15:03:50 -06:00
Gregory Anders
164f1ea06d refactor(health): refactor provider healthchecks
* Prefer pure Lua functions over vim.fn
* Split up provider healthchecks into separate modules to help manage
  complexity
2024-01-01 20:12:37 +01:00
dundargoc
b49d4e18a6 refactor: remove redundant NOLINT comments 2024-01-01 19:57:44 +01:00
Christian Clason
f69658bc35
feat(treesitter): highlight Lua files by default (#26824) 2024-01-01 15:37:07 +01:00
Jongwook Choi
bcd111bd12 ci: write the correct cherry-picked commit id when backporting
Problem: Commits backport-merged to release branches are cherry-picked
from the original commits in the PR from a fork repository, NOT the
actual commit that are merged to neovim/neovim (HEAD). Therefore the
commit reference in the commit message `cherry picked from commit ...`
usually refers to a commit that does NOT exist in the repository,
given that our preferred way of merging PR (rebasing, squashing, etc.)
would rewrite commits.

Solution: Turn on new feature 'detect_merge_method' of backport-action
workflow.
2024-01-01 15:17:56 +01:00
Anatolii Sakhnik
7d17ab5b6f
fix(l10n): update Ukrainian translations (#26819) 2024-01-01 12:22:11 +01:00
Jaehwang Jung
3faace1995 docs: clarify on_bytes arguments
based on extmark_splice doc
2024-01-01 12:20:19 +01:00
dundargoc
7cb29a572b build: ensure make clean doesn't remove source files
Adding a file to `OUTPUT` in `add_custom_command` marks that file as
`GENERATED` in cmake, and will thus be removed when running the `clean`
target. As cmake doesn't have a good way to mark that certain files
should not be removed, we instead "lie" to it by omitting the files we
want to keep from `OUTPUT`. This hack only works as long as there aren't
any other files that depend on the generated files we want to keep,
which currently seems to be the case. If this assumption changes in the
future, then we need to separate the parts that are generated and the
parts that are not as to prevent an infinite dependency chain.
2024-01-01 11:04:41 +01:00
altermo
6fa0f303d7 fix(builtin): parameter mismatch between winsaveview and winrestview 2023-12-31 14:10:53 +00:00
zeertzjq
6f6abd8c02 refactor(tui): remove code that is no longer necessary 2023-12-31 04:56:35 +08:00
Paul "LeoNerd" Evans
b4ef913400 Handle mouse buttons 6/7 (often used for horizontal scrolling) 2023-12-31 04:56:35 +08:00
Paul "LeoNerd" Evans
ffe96c6c1c Ignore key_mouse unless it is exactly \e[M because some terminfos relate to different encoding modes (thanks Ninji) 2023-12-31 04:56:35 +08:00
Christian Clason
b9cf388045 test(functional): remove faulty pending check
Problem: `functional/vimscript/api_functions_spec` skips a test if the
runtime files are not generated, but this check was broken in a
refactor.

Solution: Since runtime files are now generated for all test targets, do
not skip this test.
2023-12-30 18:09:16 +01:00
dundargoc
d51b615747 refactor: fix luals warnings 2023-12-30 17:40:53 +01:00
dundargoc
bf0be0f63e build: various improvements
- Use `#pragma once` for `cmake.config/config.h.in`
- Remove unused variable `CACHED_GENERATED_DIR`
- Reorganize and sort variables
- Introduce `STYLUA_DIRS` variable to ensure the `formatlua` and
  `lintlua-stylua` operates on the same files.
- Adjust variable scope to avoid using hacky directory properties.
- Add more necessary runtime files as test dependencies
2023-12-30 14:22:25 +01:00
dundargoc
c89292fcb7 refactor: follow style guide 2023-12-30 12:45:38 +01:00
Christian Clason
d634cd5b0b vim-patch:d96f25bd69c1
runtime(fortran): update syntax and documentation (vim/vim#13784)

* Update Fortran section of indent.txt
* Small addition to fortran syntax

* Update Fortran section of syntax.txt

* Runtime (Fortran)

Fix regression

* Combine two expressions

d96f25bd69

Co-authored-by: Ajit-Thakkar <142174202+Ajit-Thakkar@users.noreply.github.com>
2023-12-30 10:53:31 +01:00
luukvbaal
dd00b6b442
refactor(drawline): remove maybe_wlv argument for foldcolumn (#26798)
Problem:  fill_foldcolumn() has an optional winlinevars_T argument.
Solution: Increment wlv->off at callsite.
2023-12-30 09:57:57 +08:00
bfredl
c5e9acca64
Merge pull request #26758 from luukvbaal/drawline
refactor(drawline): avoid writing foldopen before writing foldclosed
2023-12-29 22:13:39 +01:00
dundargoc
9aed26079c ci: add workflow_dispatch to optional.yml workflow
This makes it convenient to test optional.yml on release branch.
2023-12-29 20:01:20 +01:00
Luuk van Baal
fe2ca7eabf refactor(drawline): avoid writing foldopen before writing foldclosed 2023-12-29 13:27:26 +01:00
Christian Clason
1ef60ea651 vim-patch:715a8058895f
runtime(cucumber): Updates to indent and syntax

715a805889

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
Christian Clason
51c22b9321 vim-patch:244f01658f9c
runtime(markdown): Fix folding of code blocks

244f01658f

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
Christian Clason
7709597a1d vim-patch:a907c9199216
runtime(sass): Provide sass_recommended_style option

a907c91992

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
Christian Clason
419f038727 vim-patch:fda02d03c0cf
runtime(gitcommit): Updates to ftplugin and syntax

fda02d03c0

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
Christian Clason
1d71e1d987 vim-patch:757714c0cba7
runtime(git): Make diffs foldable

757714c0cb

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
Christian Clason
ffb97af887 vim-patch:48ddc6a6f86f
runtime(git): Add small ftplugin

48ddc6a6f8

Co-authored-by: Tim Pope <code@tpope.net>
2023-12-29 00:54:09 +01:00
zeertzjq
aecbc3f832
vim-patch:9.0.2189: Wrong display with 'briopt=sbr' and 'nobreakindent' (#26785)
Problem:  Wrong display when 'breakindentopt' contains "sbr" and
          'showbreak' and 'nobreakindent' are set.
Solution: Always reset wlv->need_showbreak regardless of the values of
          'breakindent' and 'showbreak', as they aren't checked when
          setting wlv->need_showbreak (zeertzjq)

closes: vim/vim#13785

7e4f62a257
2023-12-29 06:44:14 +08:00
dundargoc
31d7007bf7 docs: convert BACKERS.md to backers.txt
There is no reason for this file to be in project root, which is crowded
as is. This also fits nicely part of the ongoing work towards gathering
as much of the documentation as possible into one place.
2023-12-28 22:41:01 +01:00
zeertzjq
2b9d3869f8
fix(drawline): don't use temporary "v" variable when not needed (#26777) 2023-12-28 19:26:59 +08:00
xvzc
53a3e6ac87
docs(eval): add parameter type for vim.fn.mode() (#26776) 2023-12-28 19:13:46 +08:00
Christian Clason
320c77fa52 vim-patch:d1cea036467c
runtime(elixir): missing undo_ftplugin for indentkeys

fixup after vim/vim#13771

d1cea03646

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-12-28 10:42:09 +01:00
Christian Clason
ecbfff7306 vim-patch:7e2741100737
runtime(elixir): fix indentation (vim/vim#13771)

7e27411007

Co-authored-by: George Guimarães <george.guimaraes@gmail.com>
2023-12-28 10:42:09 +01:00
Christian Clason
44c7833193 vim-patch:a03647acc313
runtime(mermaid): Syntax fix (vim/vim#13774)

* runtime(mermaid): Fix arrow syntax
* runtime(mermaid): Disable syntax for identifier to avoid false match
* runtime(mermaid): Add some C++ type syntax highlight
* runtime(mermaid): Update last change time in header

a03647acc3

Co-authored-by: KSR-Yasuda <31273423+KSR-Yasuda@users.noreply.github.com>
2023-12-28 10:42:09 +01:00
Christian Clason
aece3a7f5f vim-patch:00b470052b71
runtime(diff): Update default links (vim/vim#13776)

Problem: Current default links for `diffAdded`, `diffChanged`, and
              `diffRemoved` do not address the diff nature of the filetype.
Solution: Use `DiffAdd`, `DiffChange`, and `DiffDelete`.

closes: vim/vim#13759

00b470052b

Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2023-12-28 10:42:09 +01:00
dundargoc
714b075197
docs: small fixes (#26651)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: WillLillis <wlillis@umass.edu>
2023-12-28 10:28:48 +08:00
JD
46ceefb52b
fix(clipboard): make getreg() accurate for clipboard registers (#26740)
Problem:  getreg("*") / getreg("+") disagree with :registers.
Solution: Avoid falling back to unnamed register if provider fails.
2023-12-28 09:57:13 +08:00