summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/lua/vim/_buf.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-08-28 23:43:10 -0400
committerJustin M. Keyes <justinkz@gmail.com>2025-12-30 01:44:24 -0500
commit20e77c5d886af54d1f7b6844cffc11129f579ad9 (patch)
treee7098a90f9333fa52ae98b0bdd9d0cc82830131f /runtime/lua/vim/_buf.lua
parent03377b95523324a2a1657435f12c13a493ee5360 (diff)
build: ship "_core/*" as bytecode (built-into Nvim binary)
Problem: We want to encourage implementing core features in Lua instead of C, but it's clumsy because: - Core Lua code (built into `nvim` so it is available even if VIMRUNTIME is missing/invalid) requires manually updating CMakeLists.txt, or stuffing it into `_editor.lua`. - Core Lua modules are not organized similar to C modules, `_editor.lua` is getting too big. Solution: - Introduce `_core/` where core Lua code can live. All Lua modules added there will automatically be included as bytecode in the `nvim` binary. - Move these core modules into `_core/*`: ``` _defaults.lua _editor.lua _options.lua _system.lua shared.lua ``` TODO: - Move `_extui/ => _core/ui2/`
Diffstat (limited to 'runtime/lua/vim/_buf.lua')
-rw-r--r--runtime/lua/vim/_buf.lua23
1 files changed, 0 insertions, 23 deletions
diff --git a/runtime/lua/vim/_buf.lua b/runtime/lua/vim/_buf.lua
deleted file mode 100644
index 0631c96f77..0000000000
--- a/runtime/lua/vim/_buf.lua
+++ /dev/null
@@ -1,23 +0,0 @@
-local M = {}
-
---- Adds one or more blank lines above or below the cursor.
--- TODO: move to _defaults.lua once it is possible to assign a Lua function to options #25672
---- @param above? boolean Place blank line(s) above the cursor
-local function add_blank(above)
- local offset = above and 1 or 0
- local repeated = vim.fn['repeat']({ '' }, vim.v.count1)
- local linenr = vim.api.nvim_win_get_cursor(0)[1]
- vim.api.nvim_buf_set_lines(0, linenr - offset, linenr - offset, true, repeated)
-end
-
--- TODO: move to _defaults.lua once it is possible to assign a Lua function to options #25672
-function M.space_above()
- add_blank(true)
-end
-
--- TODO: move to _defaults.lua once it is possible to assign a Lua function to options #25672
-function M.space_below()
- add_blank()
-end
-
-return M