Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
This repository was archived by the owner on Nov 26, 2025. It is now read-only.

Adding line causes repeatable freeze in neovim #91

Description

@kpence

If I open a file with this in my nvim:

const std = @import("std");

const Register = struct {
    string: []const u8,
    value: packed union {
        u16: u16,
        split_u8s: packed struct {
            high: u8,
            low: u8,
        },
    },
    fn create(new_string: []const u8) Self {
        return .{
            new_string,
            .{
                .u16 = 0
            },
        };
    }
};

pub fn main() !void {
    const stdout = std.io.getStdOut().writer();
    stdout.writeAll("Hello world");
}

And then add the following line:

@@ -1,6 +1,7 @@
 const std = @import("std");
 
 const Register = struct {
+    const Self = @This;
     string: []const u8,
     value: packed union {
         u16: u16,

This causes my nvim to freeze.

Here is my .vimrc

syntax on
filetype plugin indent on

" Obligatory settings
set autoindent
set cindent
set sw=4
set ts=4
set et
set number
set clipboard=unnamed

" vim plugins
" let g:zig_fmt_autosave = 0
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-surround'
Plug 'ziglang/zig.vim'
call plug#end()

This is my nvim version:

$ nvim --version
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions