Commit Graph

337 Commits

Author SHA1 Message Date
299331490e API: nvim_buf_set_lines: handle 'nomodifiable' #10910 2019-09-01 22:04:20 -07:00
0e3b9ea74d includes 2019-08-07 14:21:23 +02:00
c0993ed343 lua: support getting UTF-32 and UTF-16 sizes of replaced text 2019-08-06 20:24:36 +02:00
b0e26199ec lua: add {old_byte_size} to on_lines buffer change event 2019-08-06 17:01:47 +02:00
64cdf9f78a api/lua: add on_detach to nvim_buf_attach 2019-06-15 13:19:12 +02:00
f5c56f03bb api: allow nvim_buf_attach from lua using callbacks 2019-06-04 13:45:20 +02:00
52215f5752 doc/API: document indexing behavior #10058
close #10058
2019-05-26 16:15:20 +02:00
f35d233e07 API/nvim_set_keymap: minor cleanup
ref #9924
2019-05-12 13:04:48 +02:00
fbf2c414ad API: nvim_set_keymap, nvim_del_keymap #9924
closes #9136

- Treat empty {rhs} like <Nop>

- getchar.c: Pull "repl. MapArg termcodes" into func
  The "preprocessing code" surrounding the replace_termcodes calls needs
  to invoke replace_termcodes, and also check if RHS is equal to "<Nop>".
  To reduce code duplication, factor this out into a helper function.

  Also add an rhs_is_noop flag to MapArguments; buf_do_map_explicit
  expects an empty {rhs} string for "<Nop>", but also needs to distinguish
  that from something like ":map lhs<cr>" where no {rhs} was provided.

- getchar.c: Use allocated buffer for rhs in MapArgs
  Since the MAXMAPLEN limit does not apply to the RHS of a mapping (or
  else an RHS that calls a really long autoload function from a plugin
  would be incorrectly rejected as being too long), use an allocated
  buffer for RHS rather than a static buffer of length MAXMAPLEN + 1.

- Mappings LHS and RHS can contain literal space characters, newlines, etc.

- getchar.c: replace_termcodes in str_to_mapargs
  It makes sense to do this; str_to_mapargs is, intuitively, supposed to
  take a "raw" command string and parse it into a totally "do_map-ready"
  struct.

- api/vim.c: Update lhs, rhs len after replace_termcodes
  Fixes a bug in which replace_termcodes changes the length of lhs or rhs,
  but the later search through the mappings/abbreviations hashtables
  still uses the old length value. This would cause the search to fail
  erroneously and throw 'E31: No such mapping' errors or 'E24: No such
  abbreviation' errors.

- getchar: Create new map_arguments struct
  So that a string of map arguments can be parsed into a more useful, more
  portable data structure.

- getchar.c: Add buf_do_map function
  Exactly the same as the old do_map, but replace the hardcoded references
  to the global `buf_T* curbuf` with a function parameter so that we can
  invoke it from nvim_buf_set_keymap.

- Remove gettext calls in do_map error handling
2019-05-12 11:44:48 +02:00
400ee59247 API: fix cursor position when lines are added #9961
Restore code removed in #9674.
2019-05-07 09:17:37 +02:00
eabe7d95f8 doc: UI 2019-04-22 20:56:16 +02:00
fbaee922d1 doc [ci skip]
closes #9719
2019-03-26 19:55:33 +01:00
f5d5da3917 buffer: use aucmd_prepbuf() instead of switch_to_win_for_buf() 2019-03-05 15:05:23 +01:00
c70c8b607f doc [ci skip] #9478
- Lua
- developer guidelines
- MAINTAIN.md
- TUI: cleanup
- TUI: mention Windows terminfo builtins
- cleanup if_pyth, redirect python-bindeval tag

Helped-by: Björn Linse <bjorn.linse@gmail.com>
Helped-by: erw7 <erw7.github@gmail.com>
2019-01-26 20:38:14 +01:00
857a7312d0 doc (#9288)
- misc
- doc: `:help config`. closes #9329
- cleanup test/README.md
2018-12-09 01:31:34 +01:00
32405de7df API: rename nvim_buf_clear_highlight to nvim_buf_clear_namespace
We want a single function to clear all namespaced buffer objects. This
will later include extmarks.
2018-11-29 15:15:04 +01:00
01dbf0951b api: implement object namespaces
Namespaces is a lightweight concept that should be used to group
objects for purposes of bulk operations and introspection. This is
initially used for highlights and virtual text in buffers, and is
planned to also be used for extended marks. There is no plan use them
for privileges or isolation, neither to introduce nanespace-level
options.
2018-11-24 11:01:37 +01:00
b96730bc3b doc: API 2018-11-05 22:45:49 +01:00
c40f992e10 api: simplify nvim_buf_get_offset function 2018-11-01 22:00:40 +01:00
281da0dd59 api: implement nvim_buf_get_offset_for_line
Like line2byte, but works for any buffer, and uses zero-based
indexing (API conventions).
2018-11-01 15:05:05 +01:00
3d84cf6ff4 api: make nvim_buf_set_virtual_text handle invalid chars
Clients are supposed to supply only valid text, but if it is
invalid, translate it rather than messing up the screen
2018-10-13 16:37:17 +02:00
45f53b370b buffer: add support for virtual text annotations 2018-09-17 10:41:29 +02:00
10bb11e8d1 API: update docs WRT behaviours/methods for unloaded buffers #7688 2018-07-25 15:07:13 +10:00
8ff0872cf7 API: add nvim_buf_is_loaded() #7688 2018-07-25 15:07:13 +10:00
40e2d6b59b API: buf_get_lines, buf_line_count handle unloaded buffers #7688 2018-07-25 15:07:13 +10:00
1999919c31 doc 2018-07-18 13:38:06 +02:00
ZyX
eaf2a25f12 *: Replace b_changedtick with new always-inline functions
Ref #8474
2018-06-22 00:44:31 +03:00
b94b59e4e8 refactor: buf_collect_lines (#8509)
Move redundant common logic into a function.
2018-06-09 09:32:49 +02:00
333679ad0e Add empty options dict to buf_attach 2018-05-23 22:07:27 +02:00
0bee3925ab Send changedtick as first event if buffer contents weren't requested 2018-05-23 22:07:27 +02:00
e7451f8a91 Some renamings and doc changes 2018-05-23 22:07:27 +02:00
2106bada5b Enable -Wconversion 2018-05-23 22:07:27 +02:00
6bdcbef2f5 The grand renaming 2018-05-23 22:07:27 +02:00
37b8e95fd6 Lint 2018-05-23 22:07:27 +02:00
8bcc011959 Make separate functions to start/stop live updates 2018-05-23 22:07:27 +02:00
71816e584c Adjust FUNC_API_SINCE for nvim_buf_live_updates 2018-05-23 22:07:27 +02:00
bafae1c427 Add argument to not send a buffers content when updates are enabled
Add a test.
2018-05-23 22:07:27 +02:00
edcc73e766 API: Implement buffer updates
Originally written by @phodge in
https://github.com/neovim/neovim/pull/5269.
2018-05-23 22:07:27 +02:00
137eedb4ed API: nvim_get_commands(): return Dictionary 2018-05-12 07:29:21 +02:00
cb6672853a API: nvim_get_commands(): builtin is irrelevant for buffer-local
builtin commands are never buffer-local, so we can return empty for that
case.
2018-05-12 07:29:21 +02:00
738bffea2c API: nvim_get_commands(): more attributes
Support more :command attributes:
  -bang
  -bar
  -register
2018-05-11 13:50:00 +02:00
9fa7727ce0 API: nvim_get_commands(): always return keys
- Always return all keys, with at least NIL value.
- Require `opts` param to be {"builtin":false}
- Validate `opts` param
2018-05-11 13:20:43 +02:00
25b6304840 API: nvim_get_commands() 2018-05-11 13:20:19 +02:00
7170de1971 api: Make nvim_set_option() update :verbose set ...
Make `:verbose set ...` show when an option was last modified by an
API client or Lua script/chunk. In the case of an API client, the
channel ID is displayed.
2018-05-03 21:05:20 -05:00
ZyX
5660482406 api/buffer: Fix PVS/V547: use correct border for lnum
Should actually be silencing that for the sake of the case when `long` is 
actually not 64-bit. But it appears that Vim had already defined maximal line 
number. And even declared that exact value invalid, so no need in silencing.
2018-04-02 00:41:00 +03:00
06994e0e21 Fix warning about conversion on mingw64 2018-01-18 21:30:03 +08:00
ac87d9de69 Fix an off-by-one error in the documentation of nvim_buf_clear_highlight (#7853) 2018-01-15 21:45:10 +01:00
ad9c2d3cb9 doc
closes #7622
2017-12-10 17:13:22 +01:00
280943d9b9 doc: API (generated) 2017-11-06 04:51:34 +01:00
73fabf4f15 doc: nvim_buf_add_highlight(): zero-indexed lines 2017-11-06 01:56:04 +01:00