Commit Graph

28 Commits

Author SHA1 Message Date
Tristan Konolige
bf0f745861
lua: allow deepcopy of functions (#12136) 2020-04-19 01:04:37 +02:00
Hirokazu Hata
e35ff7371f
lua: add vim.tbl_len() #11889 2020-03-01 23:38:43 -08:00
Hirokazu Hata
e2ed8053bf
lua: move test helper function, map and filter, to vim.shared module 2020-02-18 17:43:10 +09:00
Hirokazu Hata
c230c7d1a6
lua: if second argument is vim.empty_dict(), vim.tbl_extend uses empty_dict() instead of {} 2020-02-14 19:35:46 +09:00
Hirokazu Hata
417fc6ccf7
lua: vim.deepcopy uses empty_dict() instead of {} for empty_dict()
fix: https://github.com/neovim/nvim-lsp/issues/94
2020-02-13 11:55:43 +09:00
Chris LaRose
c6ff23d7a0 terminal: absolute CWD in term:// URI #11289
This makes it possible to restore the working directory of :terminal
buffers when reading those buffers from a session file.

Fixes #11288

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2020-01-26 00:24:42 -08:00
Justin M. Keyes
9231684986
doc [ci skip] #11656 2020-01-12 23:41:55 -08:00
Björn Linse
ea4127e9a7 lua: metatable for empty dict value 2020-01-01 19:26:29 +01:00
Ashkan Kiani
70b6061666
Add vim.startswith and vim.endswith (#11248) 2019-12-01 05:32:55 -08:00
Justin M. Keyes
fd5710ae9a
doc + extmarks tweaks #11421
- nvim_buf_get_extmarks: rename "amount" => "limit"
- rename `set_extmark_index_from_obj`
2019-11-25 01:08:02 -08:00
Ashkan Kiani
b78fdd7ce5 Merge branch 'master' into lsp-followup 2019-11-24 02:29:23 -08:00
Ashkan Kiani
d0d38fc36e Lua: vim.env, vim.{g,v,w,bo,wo} #11442
- Add vim variable meta accessors: vim.env, vim.{g,v,w,bo,wo}
- Redo gen_char_blob to generate multiple blobs instead of just one
  so that multiple Lua modules can be inlined.
- Reorder vim.lua inclusion so that it can use previously defined C
  functions and utility functions like vim.shared and vim.inspect things.
- Inline shared.lua into nvim, but also keep it available in runtime.
2019-11-24 02:28:48 -08:00
Ashkan Kiani
b984f613c1 Extend list_extend to take start/finish. 2019-11-20 17:09:21 -08:00
Ashkan Kiani
00dc12c5d8 lua LSP client: initial implementation (#11336)
Mainly configuration and RPC infrastructure can be considered "done". Specific requests and their callbacks will be improved later (and also served by plugins). There are also some TODO:s for the client itself, like incremental updates.

Co-authored by at-tjdevries and at-h-michael, with many review/suggestion contributions.
2019-11-13 21:55:26 +01:00
Justin M. Keyes
a0d992785f Lua: Use vim.validate() instead of assert() 2019-11-10 23:43:49 -08:00
Justin M. Keyes
7aa4042d3b Lua: vim.validate() 2019-11-10 23:43:49 -08:00
Hirokazu Hata
678a51b1da Lua: vim.validate()
We often want to do type checking of public function arguments.

- test: Rename utility_function_spec.lua to vim_spec.lua
- .luacov: Map lua module names
2019-11-10 22:50:24 -08:00
Hirokazu Hata
c2fc4255f9
runtime: Use module pattern with vim/shared.lua
It's a bit cumbersome for us to add an export target every time we define a new function.
It's also cumbersome to care about the order of definition when creating a new function by referring to other functions in the module.
2019-10-23 10:50:42 +09:00
Hirokazu Hata
996a057fb9 lua/stdlib: adjust some validation messages #11271
close #11271
2019-10-26 00:27:01 -07:00
Justin M. Keyes
af946046b9 test: Rename meth_pcall to pcall_err
- Rename `meth_pcall`.
- Make `pcall_err` raise an error if the function does not fail.
- Add `vim.pesc()` to treat a string as literal where a Lua pattern is
  expected.
2019-09-06 17:19:07 -07:00
Justin M. Keyes
4769deb36a
doc #10017
- gen_vimdoc.py: fancy "bullet"
- rework `:help channel-callback`
- rename `:help buffered` to `:help channel-buffered`
2019-05-25 10:00:41 +02:00
Justin M. Keyes
5b04a4fa09 lua/shared: share trim() impl 2019-05-20 23:46:56 +02:00
Justin M. Keyes
5c13f368c6 lint 2019-05-19 21:26:33 +02:00
Justin M. Keyes
fab81cfb04 lua/shared: share more stuff
Leave trim() in vim.lua, because gen_vimdoc.py needs at least one
function in there, else it gets confused...
2019-05-19 18:31:40 +02:00
Justin M. Keyes
e4c2d85c77 lua/shared: share deepcopy() with test/*
deepcopy() was duplicated in test/helpers.lua
2019-05-19 17:58:54 +02:00
Justin M. Keyes
e628c011bf gen_vimdoc.py: support lua/shared.lua module [ci skip] 2019-05-19 17:30:20 +02:00
Justin M. Keyes
9d7aaf7149 lua/shared: move table util funcs to vim.shared
Use `tbl_` prefix for all table-util functions. Specify in the function
docstring if it expects a list-like or map-like table.
2019-05-18 21:07:30 +02:00
Justin M. Keyes
bba75eb184 lua/stdlib: Introduce vim.shared
This is where "pure functions" can live, which can be shared by Nvim and
test logic which may not have a running Nvim instance available.

If in the future we use Nvim itself as the Lua engine for tests, then
these functions could be moved directly onto the `vim` Lua module.

closes #6580
2019-05-18 15:48:13 +02:00