Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tjdevries
Copy link
Contributor

@tjdevries tjdevries commented Dec 7, 2020

   To set a boolean toggle:
        In vimL:
            `set number`

        In Lua:
            `vim.opt.number = true`

    To set an array of values:
        In vimL:
            `set wildignore=*.o,*.a,__pycache__`

        In Lua, there are two ways you can do this now. One is very similar to
        the vimL way:
            `vim.opt.wildignore = '*.o,*.a,__pycache__'`

        However, vim.opt also supports a more elegent way of setting
        list-style options, but using lua tables:
            `vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`

    To replicate the behavior of |:set+=|, use: >

        -- vim.opt supports appending options via the "+" operator
        vim.opt.wildignore = vim.opt.wildignore + { "*.pyc", "node_modules" }

        -- or using the `:append(...)` method
        vim.opt.wildignore:append { "*.pyc", "node_modules" }
<

    To replicate the behavior of |:set^=|, use: >

        -- vim.opt supports prepending options via the "^" operator
        vim.opt.wildignore = vim.opt.wildignore ^ { "new_first_value" }

        -- or using the `:prepend(...)` method
        vim.opt.wildignore:prepend { "new_first_value" }
<
    To replicate the behavior of |:set-=|, use: >

        -- vim.opt supports removing options via the "-" operator
        vim.opt.wildignore = vim.opt.wildignore - { "node_modules" }

        -- or using the `:remove(...)` method
        vim.opt.wildignore:remove { "node_modules" }
<
    To set a map of values:
        In vimL:
            `set listchars=space:_,tab:>~`

        In Lua:
            `vim.opt.listchars = { space = '_', tab = '>~' }`

@tjdevries tjdevries added the lua stdlib label Dec 7, 2020
@tjdevries
Copy link
Contributor Author

I have more writing to do, I'll ping you when I'm ready @bfredl (unless you have any major complaints about the idea generally).

Also, can I make new file actually? vim.opt is getting quite large... but i figured I should ask your permission 😆

@bfredl
Copy link
Member

bfredl commented Dec 7, 2020

yes you can. Don't worry about copy pasta the magic file include code for now, I will make that part fully general one day.

@weilbith
Copy link
Contributor

weilbith commented Feb 3, 2021

@tjdevries any plans to continue this cool feature in near future?

@tjdevries
Copy link
Contributor Author

Yes, I would like to work on it soon :) but if anyone wants to take it over, I can just do code review as well!

@tjdevries
Copy link
Contributor Author

@bfredl this is probably ready to review.

One thing I had a question on is that for nvim_buf_get_option it will error if the buffer option has not yet been set (which I think is a fine behavior), but it appears that nvim_win_get_option does not do that for global-local type variables. Is that intended? It makes very weird things happen though, so it's difficult to make vim.opt work correctly in this case.

I will add some more docs and tests later as well.

@bfredl
Copy link
Member

bfredl commented Mar 17, 2021

@tjdevries hmm are you sure? I get that both error out for string options at least. Do you have any specific options that misbehave?

@tjdevries
Copy link
Contributor Author

@bfredl scrolloff was acting very weird.

@tjdevries
Copy link
Contributor Author

@bfredl can you review this and tell me what I'm not thinking of for options?

Probably some stuff having to do with defaults? Might need to use vim.api.nvim_get_option_info(opt_name).default or something to handle those?

Anyone else if you have comments / questions, please add them now :) I would like to finish this PR off at some point

@andrephilipsson
Copy link

While trying out the new features introduced in this pull request it seems like I have stumbled upon a bug where options don't seem to load correctly.

Steps to reproduce:

-- init.lua
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = -1
  • When opening a file directly with: nvim test.lua the options seems to be loaded.
  • But when opening a file with nvim then :e test.lua the options don't seem to be loaded.

The strange thing is that the exact opposite is happening when using vim.o:

-- init.lua
vim.o.expandtab = true
vim.o.tabstop = 2
vim.o.shiftwidth = 2
vim.o.softtabstop = -1
  • Opening a file directly with: nvim test.lua the options don't load.
  • While opening a file with: nvim then :e test.lua the options seem to load.

This doesn't seem to effect files which has set expandtab etc. in their corresponding ftplugin file (for example python files). I assume that this is due to the fact that those files are the last ones to be sourced.

The vim.o part seems to be affecting the current master build as well, but I thought that it might be enough to mention it here and not open an issue.

This might just be me doing something wrong or misunderstanding how things work. If that's the case, please enlighten me! 😃

@bfredl
Copy link
Member

bfredl commented Mar 29, 2021

@andrephilipsson I think I know what the issue is. for a buffer option (which is not global-local) it will be necessary for vim.opt to call both nvim_buf_set_option (for the first buffer) and nvim_set_option (default value for any buffer after the first).

@tjdevries
Copy link
Contributor Author

@andrephilipsson & @bfredl

Does new code do what you think? (you'll need to pull --rebase or whatever probably cause I force pushed to get latest code underneath the branch)

@andrephilipsson
Copy link

@tjdevries it works the way I would expect it to now. 😃

elseif is_window_option(info) then
vim.api.nvim_win_set_option(0, self._name, value)

if not set_local and not info.global_local then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC only needed for buf options, not window options (as windows, unlike buffers, proliferate by subdivision)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a good way to test this? I'd like to write a functional test for this... but tbh I don't even know if I 100% understand the behavior.

You think just setting the option, :vsplit and then see the options in new buffer?

@bfredl
Copy link
Member

bfredl commented Apr 15, 2021

As we discussed on the chat a while ago I think vim.opt of this PR should be renamed vim.o and the old vim.o could be renamed vim.go or something (global option). The only reason vim.o got such such a short name was for convenience in init.lua, and as this is the new recommended init.lua api it should use that convention.

@smolck
Copy link
Contributor

smolck commented May 29, 2021

@famiu Hmm so I have no idea if this will work (haven't updated to latest master yet so haven't tried out vim.opt), but I would think the following would be equivalent to the second (string-concatenation) version you gave:

vim.opt.guicursor = {
    ['n-v-c'] = 'block',
    ['i-ci-ve'] = 'ver25',
    ['r-cr'] = 'hor20',
    o = 'hor50',
    a = 'blinkwait700-blinkoff400-blinkon250-Cursor/lCursor',
    sm = 'block-blinkwait175-blinkoff150-blinkon175',
}

But if that doesn't work then I'm not sure.

@famiu
Copy link
Member

famiu commented May 29, 2021

@famiu Hmm so I have no idea if this will work (haven't updated to latest master yet so haven't tried out vim.opt), but I would think the following would be equivalent to the second (string-concatenation) version you gave:

vim.opt.guicursor = {
    ['n-v-c'] = 'block',
    ['i-ci-ve'] = 'ver25',
    ['r-cr'] = 'hor20',
    o = 'hor50',
    a = 'blinkwait700-blinkoff400-blinkon250-Cursor/lCursor',
    sm = 'block-blinkwait175-blinkoff150-blinkon175',
}

But if that doesn't work then I'm not sure.

That's what I first tried, that doesn't work either.

@nanotee
Copy link
Contributor

nanotee commented May 29, 2021

@famiu I had a look at the implementation for vim.opt and get_option_type() considers 'guicursor' to be an ARRAY instead of a MAP

@famiu
Copy link
Member

famiu commented May 29, 2021

@famiu I had a look at the implementation for vim.opt and get_option_type() considers 'guicursor' to be an ARRAY instead of a MAP

Changing it to an array fixed it. Thanks!

liubang added a commit to liubang/nvimrc that referenced this pull request May 29, 2021
nanoxd added a commit to nanoxd/dotfiles that referenced this pull request May 30, 2021
vim.opt was introduced for the lua API that greatly improves setting options:
neovim/neovim#13479 (comment)
yochem added a commit to yochem/dotfiles that referenced this pull request May 30, 2021
hydeik added a commit to hydeik/dotfiles that referenced this pull request May 31, 2021
khuedoan added a commit to khuedoan/dotfiles that referenced this pull request May 31, 2021
khuedoan added a commit to khuedoan/dotfiles that referenced this pull request May 31, 2021
MPDR200011 added a commit to MPDR200011/dotfiles that referenced this pull request Jun 1, 2021
last-partizan pushed a commit to last-partizan/neovim that referenced this pull request Jun 11, 2021
* lua: Add vim.opt

* fixup: cleaning

* fixup: comments

* ty clason

* fixup: comments

* this is the last commit. period.
yujinyuz pushed a commit to yujinyuz/dotfiles that referenced this pull request Jun 13, 2021
bfredl added a commit to bfredl/neovim that referenced this pull request Jul 2, 2021
This release represents ~4000 commits since v0.4.4, the previous
non-maintenance release. Highlights include builtin support for LSP, new APIs
for extended marks (with byte resolution tracking of changes) and buffer
decorations, as well as vast improvements to lua as a plugin and configuration
language. Experimental support for tree-sitter as a syntax engine is also
included, building on the new core APIs for byte tracking and decorations.

FEATURES:

New API functions:
  nvim_exec: execute multiline vim script blocks
  nvim_get_hl_id_by_name: Gets a highight definition by name
  nvim_exec_lua: new name for nvim_execute_lua
  nvim_notify: Notify the user with a message
  nvim_get_runtime_file: Find files in runtime directories
  nvim_get_all_options_info: Get option information for all options
  nvim_get_option_info: Get option information for one option
  nvim_echo: Echo a message with highlights
  nvim_open_term: Open a virtual terminal in a buffer
  nvim_chan_send: send data to a channel. (like chansend() but supports lua strings)
  nvim_set_decoration_provider: callback driven decoration API for a namespace

  nvim_buf_set_text: Set/replace a character range in a buffer
  nvim_buf_delete: Delete the buffer. |:bwipeout|
  nvim_buf_get_extmark_by_id: Returns position for a given extmark id.
  nvim_buf_get_extmarks: get extmarks in traversal order.
  nvim_buf_set_extmark: Creates or updates an extmark.

  nvim_buf_del_extmark: Removes an extmark.
  nvim_buf_call: call a function with buffer as temporary current buffer

  nvim_win_hide: Closes the window and hide the buffer it contains |:hide|
  nvim_win_call: Calls a function with window as temporary current window.

New UI events:
  redraw.screenshot
  redraw.win_viewport

Lua:
  767cd8b neovim#12235 startup: add init.lua as an alternative user config
  687eb0b neovim#14686 feat(startup): Source runtime/plugin/**/*.lua at startup
  neovim#14686 runtime: allow lua in various runtime search paths such as
         syntax/ ftdetect/ indent/ ftplugin/ compiler/ colors/
  43956de neovim#13479 lua: Add vim.opt and fix scopes of vim.o
  1407899 neovim#12268 lua: Add buffer, window and tab accessors
  be662fe lua: vim.wait implementation
  2b663c0 neovim#14213 viml: embed Lua syntax highlighting
  901dd79 feat: add completion to ':lua'
  82688973 lua: complete methods in metatables
  3421485 runtime: propagate lua parsing errors while using "require"
  aaca2c1 neovim#13276 feat(lua): improve error message to make it actionable
  c60c737 startup: handle autoload and lua packages during startup
  3ccdbc5 neovim#12536 lua: add vim.register_keystroke_callback
  971a191 lua: Add ability to pass lua functions directly to vimL
  91e41c8 neovim#12401 lua: add vim.highlight.range
  f2894bf neovim#12279 lua: Add highlight.on_yank
  ae5bd04 neovim#11969 lua: add tbl_deep_extend
  ea4127e lua: metatable for empty dict value
  dab40f4 Add v:lua.func() vimL syntax for calling lua
  678a51b Lua: vim.validate()
  474d0bc lua: vim.rpcrequest, vim.rpcnotify, vim.NIL
  8ee7c94 lua: add vim.fn.{func} for direct access to vimL function
  d0d38fc neovim#11442 Lua: vim.env, vim.{g,v,w,bo,wo}

Tree-sitter:
  Note: tree-sitter is considered experimental for 0.5. There's remaining
  bugs for buffer parsing, as well as known performance issues for
  large files and injected (nested) languages.

  e933426 neovim#10124 Tree-sitter API for lua
  440695c tree-sitter: implement query functionality and highlighting prototype
  8bea39f feat(treesitter): allow injections to be configured through directives
  929f194 feat(treesitter): add offset predicate for language injection
  cd75d32 neovim#14200 feat: treesitter checkhealth
  1a63102 feat(treesitter): add language tree
  d3f5440 treesitter: runtime queries
  3c5141d neovim#13008 treesitter: add string parser
  9437327 treesitter: use new on_bytes interface
  e4b5efa treesitter: use decoration provider API
  d6209a7 fix: Add a test and it is so pretty
  836c310 feat(ts): bump tree-sitter to v0.20.0

LSP client:
  00dc12c neovim#11336 lua LSP client: initial implementation
  d5aaad1 neovim#11430 Followup improvements to LSP
  ee7ac46 neovim#11578 LSP: Use async completion for omnifunc.
  070bd3e neovim#11604 LSP: shrink API, improve docs
  25afa10 neovim#11669 Merge 'LSP: differentiate diagnostic underline by severity'
  e956ea7 neovim#11777 LSP: show diagnostic in qf/loclist
  dd8b29c neovim#11838 LSP: set InitializeParams.rootPath value
  0c5d2ff neovim#11837 Merge 'LSP: fixes, improve test visibility'
  ca86993 neovim#11638 LSP: implement documentHighlight
  220a2b0 LSP/references: Add context to locations returned by server
  ccb038d LSP/completion: add textEdit support
  da6f38a neovim#12313 LSP: Add workspace.applyEdit client capabilities
  f559e52 neovim#11607 LSP: Add textDocument/codeAction support
  0d83a1c neovim#12638 LSP: Feature/add workspace folders
  fd507e2 neovim#13641 LSP: window/showMessageRequest
  e467d29 LSP: Move workspace/configuration handler from nvim-lspconfig to core
  2bdd553 feat(lsp): Add codelens support

UI:
  f8134f2 screen.c: remove fold_line special case
  c146edd experimental support for per-window color schemes
  a1508c9 nvim__screenshot (dump TUI state to file)
  08fe100 terminal: enable pass through indexed colors to TUI in rgb mode
  5a85699 tests/ui: make screen.lua use "linegrid" representation internally
  8fe19d9 screen: make ui_compositor aware of the intended size of a float
  54ce101 extmark: add new flexible "decorations" abstraction
  4781333 decorations: allow virt_text overlay at any column
  bdebe85 decorations: use extmark column adjustments for buffer highlights
  7b48831 decorations: Allow highlights beyond end of line hl_eol
  425bc43 decorations: add additional styling of virt_text overlays
  edb5864 floats: z-index
  243820e floats: add borders (MS-DOS MODE)
  5b6edc8 feat(float): add rounded borders preset
  4a36ec6 neovim#14310 float: add "solid" border style

vim patches:
  around ~1000 vim patches and runtime updates got merged. Hooray!
  Changes include improvements to quickfix, prompt buffers, incsearch,
  display of search counts, and much much more.

various features and changes:
  858c056 neovim#12809 Support for :perl, :perlfile, :perldo and perleval()
  bc86f76 api/buffer: add "on_bytes" callback to nvim_buf_attach
  19b6237 jobstart now supports env/clear_env
  ef7c6b9 Support specifying "env" option for termopen()
  7c4f349 neovim#13287 switch from travis to github actions
  24db59c feat: implement BufModified autocmd
  b83d822 implement Scroll autocommand
  8caf841 Lower "closed by the client" message level to INFO
  7de276b bump libvterm to 0.1.4
  097ec71 neovim#14096 aarch64/linux: fix build by updating LuaJIT
  bd5f0e9 neovim#12531 support autoread using tui focus tracking
  8a12760 neovim#12382 Add v:event.visual during `TextYankPost`
  802f842 api(nvim_open_win): add "noautocmd" option

FIXES:
  2144455 BugFix(clipboard): Fix block paste not working properly
  01493e7 neovim#14413 api: fix nvim_exec() silencing behaviour
  9699f3b fix(doc): Add '/site' to stdpath('data') example in `:help 'rtp'`
  581b2bc screen: fix problem with p_ch
  eae4b1e luaref: fix leaks for global luarefs
  409b271 fix: segfault when pasting in term with empty buffer
  cf6c23f neovim#14273 fix plenty of errors discovered by clang
  21035cf neovim#14500 fix plenty of errors discovered by coverity
  bca1913 neovim#13987 tui: fix possibility of evaluating uninitialized variables
  9f23359 fix_cursor: do not change line number when edit will not impact cursor row
  33f92fe fix(pty): Always use $TERM from the job's env dict
  6249059 checkhealth: fix terminfo problems on Windows
  397be5d neovim#12811 UI: fix cursor not displayed after hiding and un-hiding
  87afc90 screen.c: fix an issue with wrap and folds
  b419e39 screen.c: fix last character on foldtext
  2ea3127 neovim#13688 screen.c: fix display of signcolumn=auto in diffs
  c2d288e Fix screen terminal family issues
  314b222 neovim#14127 Fix click on foldcolumn with vsplit
  e65d0e5 vim.fn: throw error when trying to use API function
bfredl added a commit that referenced this pull request Jul 2, 2021
This release represents ~4000 commits since v0.4.4, the previous
non-maintenance release. Highlights include builtin support for LSP, new APIs
for extended marks (with byte resolution tracking of changes) and buffer
decorations, as well as vast improvements to lua as a plugin and configuration
language. Experimental support for tree-sitter as a syntax engine is also
included, building on the new core APIs for byte tracking and decorations.

FEATURES:

New API functions:
  nvim_exec: execute multiline vim script blocks
  nvim_get_hl_id_by_name: Gets a highight definition by name
  nvim_exec_lua: new name for nvim_execute_lua
  nvim_notify: Notify the user with a message
  nvim_get_runtime_file: Find files in runtime directories
  nvim_get_all_options_info: Get option information for all options
  nvim_get_option_info: Get option information for one option
  nvim_echo: Echo a message with highlights
  nvim_open_term: Open a virtual terminal in a buffer
  nvim_chan_send: send data to a channel. (like chansend() but supports lua strings)
  nvim_set_decoration_provider: callback driven decoration API for a namespace

  nvim_buf_set_text: Set/replace a character range in a buffer
  nvim_buf_delete: Delete the buffer. |:bwipeout|
  nvim_buf_get_extmark_by_id: Returns position for a given extmark id.
  nvim_buf_get_extmarks: get extmarks in traversal order.
  nvim_buf_set_extmark: Creates or updates an extmark.

  nvim_buf_del_extmark: Removes an extmark.
  nvim_buf_call: call a function with buffer as temporary current buffer

  nvim_win_hide: Closes the window and hide the buffer it contains |:hide|
  nvim_win_call: Calls a function with window as temporary current window.

New UI events:
  redraw.screenshot
  redraw.win_viewport

Lua:
  767cd8b #12235 startup: add init.lua as an alternative user config
  687eb0b #14686 feat(startup): Source runtime/plugin/**/*.lua at startup
  #14686 runtime: allow lua in various runtime search paths such as
         syntax/ ftdetect/ indent/ ftplugin/ compiler/ colors/
  43956de #13479 lua: Add vim.opt and fix scopes of vim.o
  1407899 #12268 lua: Add buffer, window and tab accessors
  be662fe lua: vim.wait implementation
  2b663c0 #14213 viml: embed Lua syntax highlighting
  901dd79 feat: add completion to ':lua'
  82688973 lua: complete methods in metatables
  3421485 runtime: propagate lua parsing errors while using "require"
  aaca2c1 #13276 feat(lua): improve error message to make it actionable
  c60c737 startup: handle autoload and lua packages during startup
  3ccdbc5 #12536 lua: add vim.register_keystroke_callback
  971a191 lua: Add ability to pass lua functions directly to vimL
  91e41c8 #12401 lua: add vim.highlight.range
  f2894bf #12279 lua: Add highlight.on_yank
  ae5bd04 #11969 lua: add tbl_deep_extend
  ea4127e lua: metatable for empty dict value
  dab40f4 Add v:lua.func() vimL syntax for calling lua
  678a51b Lua: vim.validate()
  474d0bc lua: vim.rpcrequest, vim.rpcnotify, vim.NIL
  8ee7c94 lua: add vim.fn.{func} for direct access to vimL function
  d0d38fc #11442 Lua: vim.env, vim.{g,v,w,bo,wo}

Tree-sitter:
  Note: tree-sitter is considered experimental for 0.5. There's remaining
  bugs for buffer parsing, as well as known performance issues for
  large files and injected (nested) languages.

  e933426 #10124 Tree-sitter API for lua
  440695c tree-sitter: implement query functionality and highlighting prototype
  8bea39f feat(treesitter): allow injections to be configured through directives
  929f194 feat(treesitter): add offset predicate for language injection
  cd75d32 #14200 feat: treesitter checkhealth
  1a63102 feat(treesitter): add language tree
  d3f5440 treesitter: runtime queries
  3c5141d #13008 treesitter: add string parser
  9437327 treesitter: use new on_bytes interface
  e4b5efa treesitter: use decoration provider API
  d6209a7 fix: Add a test and it is so pretty
  836c310 feat(ts): bump tree-sitter to v0.20.0

LSP client:
  00dc12c #11336 lua LSP client: initial implementation
  d5aaad1 #11430 Followup improvements to LSP
  ee7ac46 #11578 LSP: Use async completion for omnifunc.
  070bd3e #11604 LSP: shrink API, improve docs
  25afa10 #11669 Merge 'LSP: differentiate diagnostic underline by severity'
  e956ea7 #11777 LSP: show diagnostic in qf/loclist
  dd8b29c #11838 LSP: set InitializeParams.rootPath value
  0c5d2ff #11837 Merge 'LSP: fixes, improve test visibility'
  ca86993 #11638 LSP: implement documentHighlight
  220a2b0 LSP/references: Add context to locations returned by server
  ccb038d LSP/completion: add textEdit support
  da6f38a #12313 LSP: Add workspace.applyEdit client capabilities
  f559e52 #11607 LSP: Add textDocument/codeAction support
  0d83a1c #12638 LSP: Feature/add workspace folders
  fd507e2 #13641 LSP: window/showMessageRequest
  e467d29 LSP: Move workspace/configuration handler from nvim-lspconfig to core
  2bdd553 feat(lsp): Add codelens support

UI:
  f8134f2 screen.c: remove fold_line special case
  c146edd experimental support for per-window color schemes
  a1508c9 nvim__screenshot (dump TUI state to file)
  08fe100 terminal: enable pass through indexed colors to TUI in rgb mode
  5a85699 tests/ui: make screen.lua use "linegrid" representation internally
  8fe19d9 screen: make ui_compositor aware of the intended size of a float
  54ce101 extmark: add new flexible "decorations" abstraction
  4781333 decorations: allow virt_text overlay at any column
  bdebe85 decorations: use extmark column adjustments for buffer highlights
  7b48831 decorations: Allow highlights beyond end of line hl_eol
  425bc43 decorations: add additional styling of virt_text overlays
  edb5864 floats: z-index
  243820e floats: add borders (MS-DOS MODE)
  5b6edc8 feat(float): add rounded borders preset
  4a36ec6 #14310 float: add "solid" border style

vim patches:
  around ~1000 vim patches and runtime updates got merged. Hooray!
  Changes include improvements to quickfix, prompt buffers, incsearch,
  display of search counts, and much much more.

various features and changes:
  858c056 #12809 Support for :perl, :perlfile, :perldo and perleval()
  bc86f76 api/buffer: add "on_bytes" callback to nvim_buf_attach
  19b6237 jobstart now supports env/clear_env
  ef7c6b9 Support specifying "env" option for termopen()
  7c4f349 #13287 switch from travis to github actions
  24db59c feat: implement BufModified autocmd
  b83d822 implement Scroll autocommand
  8caf841 Lower "closed by the client" message level to INFO
  7de276b bump libvterm to 0.1.4
  097ec71 #14096 aarch64/linux: fix build by updating LuaJIT
  bd5f0e9 #12531 support autoread using tui focus tracking
  8a12760 #12382 Add v:event.visual during `TextYankPost`
  802f842 api(nvim_open_win): add "noautocmd" option

FIXES:
  2144455 BugFix(clipboard): Fix block paste not working properly
  01493e7 #14413 api: fix nvim_exec() silencing behaviour
  9699f3b fix(doc): Add '/site' to stdpath('data') example in `:help 'rtp'`
  581b2bc screen: fix problem with p_ch
  eae4b1e luaref: fix leaks for global luarefs
  409b271 fix: segfault when pasting in term with empty buffer
  cf6c23f #14273 fix plenty of errors discovered by clang
  21035cf #14500 fix plenty of errors discovered by coverity
  bca1913 #13987 tui: fix possibility of evaluating uninitialized variables
  9f23359 fix_cursor: do not change line number when edit will not impact cursor row
  33f92fe fix(pty): Always use $TERM from the job's env dict
  6249059 checkhealth: fix terminfo problems on Windows
  397be5d #12811 UI: fix cursor not displayed after hiding and un-hiding
  87afc90 screen.c: fix an issue with wrap and folds
  b419e39 screen.c: fix last character on foldtext
  2ea3127 #13688 screen.c: fix display of signcolumn=auto in diffs
  c2d288e Fix screen terminal family issues
  314b222 #14127 Fix click on foldcolumn with vsplit
  e65d0e5 vim.fn: throw error when trying to use API function
@IzhakJakov
Copy link
Contributor

IzhakJakov commented Sep 10, 2022

How to toggle set and unset in LUA❓

For example in vimscript

  • set number!
  • set spell!
  • set list!

BTW, I know it is possible to do something like lua vim.wo.number = not(vim.wo.number), just wondering if there is a nicer way to do it.

@clason
Copy link
Member

clason commented Sep 10, 2022

No, that is it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.