Giter Site home page Giter Site logo

zig.vim's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zig.vim's Issues

Something about `zig fmt`

Love this plugin except for one thing I hope to be solved:

I found that each statement is always a single line after formatted:

1

Is that possible zig fmt can accept the following style result by whatever options? As I think that's important for using vertical split in Laptop screen size to edit 2 source files at the same time:)

2

For example, this is the formatted result after I copy&paste into C file, it looks much better than a long long single line:

Screen Shot 2023-03-04 at 2 55 15 PM

I mean at least have an optional configuration file for zig fmt? (enable or disable part of the format rather than encapsulate all format policies inside and can't change?)

Sorry, I'm new to zig, love to learn more:)

error on saving file

vim 8.0.1453
Installed using vim-plug

when I save a file with :w, the file is saved but first I see this error

Error detected while processing function <SNR>32_fmt_autosave[2]..zig#fmt#Format:                                                                                                              
line   23: 

This hangs until I hit a key.

Briefly there is also an error printed Unknown function: deletebufline, but this disappears after a second or so.

Remove format-on-save as the default

The plugin automatically calls zig fmt to format the code as soon as we save the file. This can be set as option rather than the default.
When developing on large files, zig fmt slows down the formatting when called from scratch. I for example use the ZLS (zig language server) to format which is much faster. I can disable this plugin for sure, but I would suggest keeping this as not the default.

weird syntax highlighting

I pulled to latest master branch here and seeing things that don't make sense to me.

  1. builtin functions the same weight & color as if and else control flow is weird and misleading

image

  1. why are defer and catch the same different color? catch and try should be the same color.

image

  1. and and or are the same as const and var which makes no sense. they are control flow statements, whereas const and var relate to storage.

image

  1. try is colored the same as pub and fn but return and break are colored different than try

image

missing indent for multi-line global statement

At a global level, writing const x = followed by a new line does not add indentation. (== doesn't affect the code.) Indentation is added correctly when the code is in a function.

Expected:

// Should indent...
const a =
    123;

pub fn main() u8 {
    // Indents as expected.
    const b =
        0;
    return b;
}

Actual:

// Should indent...
const a =
123;

pub fn main() u8 {
    // Indents as expected.
    const b =
        0;
    return b;
}

Auto semicolon

Hi, it would be nice to have auto-add semicolon end of the line when save, someone like me (a gopher) always forgot to add it :(

Shell text gets inserted into .zig file when opening it

So, when I open a .zig file, something happens with my shell. I'm using starship on top of fish, and its configuring to run pfetch when it starts up. The output of pfetch somehow gets tangled up in the .zig file if zig.vim is running. So an error appears containing the pfetch output. If I ignore it and enter the file, everything looks okay. If I make no changes and I save and exit, the pfetch output is actually saved to the file. Here's my config.fish:

1 alias ls=lsd                                                                     
2 export VISUAL=vim                                                                
3 export EDITOR=vim                                                                
4                                                                                  
5 pfetch                                                                           
6 starship init fish | source

Error when opening a .zig file. Error contains pfetch output:

Error detected while processing /home/trainraider/.local/share/nvim/plugged/zig.vim/ftplugin/zig.vim:
line   41:
E474: Unidentified byte: ^[[?7l^[[1m^[[32m ___________^@^[[32m|_          \^@  ^[[32m| ^[[37m| _____ ^[[32m|^@  ^
[[32m| ^[[37m| | | | ^[[32m|^@  ^[[32m| ^[[37m| | | | ^[[32m|^@  ^[[32m|^[[37m\__^[[37m___/ ^[[32m|^@  ^[[32m\__
_______/^@^[[0m^[[7A^[[17C^[[32m^[[1m^[[33m^[[1mtrainraider^[[1m@^[[33m^[[1mlenovo-laptop^[[0m^[[47D^[[7C^[[37m^[
[0m^@^[[17C^[[32m^[[1mos^[[0m^[[2D^[[7C^[[37mLinux Mint 20.2^[[0m^@^[[17C^[[32m^[[1mhost^[[0m^[[4D^[[7C^[[37m82B5
Lenovo Legion 5 15ARH05^[[0m^@^[[17C^[[32m^[[1mkernel^[[0m^[[6D^[[7C^[[37m5.13.0-1009-oem^[[0m^@^[[17C^[[32m^[[1
muptime^[[0m^[[6D^[[7C^[[37m2d 23h 51m^[[0m^@^[[17C^[[32m^[[1mpkgs^[[0m^[[4D^[[7C^[[37m2852^[[0m^@^[[17C^[[32m^[[
1mmemory^[[0m^[[6D^[[7C^[[37m3565M / 7315M^[[0m^@^@^[[?7h{^@ "zig_exe": "/snap/zig/4090/zig",^@ "lib_dir": "/snap
/zig/4090/lib",^@ "std_dir": "/snap/zig/4090/lib/std",^@ "global_cache_dir": "/home/trainraider/.cache/zig",^@ "v
ersion": "0.9.0-dev.952+0c091feb5"^@}^@
E474: Failed to parse ^[[?7l^[[1m^[[32m ___________^@^[[32m|_          \^@  ^[[32m| ^[[37m| _____ ^[[32m|^@  ^[[3
2m| ^[[37m| | | | ^[[32m|^@  ^[[32m| ^[[37m| | | | ^[[32m|^@  ^[[32m| ^[[37m\__^[[37m___/ ^[[32m|^@  ^[[32m\_____
____/^@^[[0m^[[7A^[[17C^[[32m^[[1m^[[33m^[[1mtrainraider^[[1m@^[[33m^[[1mlenovo-laptop^[[0m^[[47D^[[7C^[[37m^[[0m
^@^[[17C^[[32m^[[1mos^[[0m^[[2D^[[7C^[[37mLinux Mint 20.2^[[0m^@^[[17C^[[32m^[[1mhost^[[0m^[[4D^[[7C^[[37m82B5 Le
novo Legion 5 15ARH05^[[0m^@^[[17C^[[32m^[[1mkernel^[[0m^[[6D^[[7C^[[37m5.13.0-1009-oem^[[0m^@^[[17C^[[32m^[[1mup
time^[[0m^[[6D^[[7C^[[37m2d 23h 51m^[[0m^@^[[17C^[[32m^[[1mpkgs^[[0m^[[4D^[[7C^[[37m2852^[[0m^@^[[17C^[[32m^[[1mm
emory^[[0m^[[6D^[[7C^[[37m3565M / 7315M^[[0m^@^@^[[?7h{^@ "zig_exe": "/snap/zig/4090/zig",^@ "lib_dir": "/snap/zi
g/4090/lib",^@ "std_dir": "/snap/zig/4090/lib/std",^@ "global_cache_dir": "/home/trainraider/.cache/zig",^@ "vers
ion": "0.9.0-dev.952+0c091feb5"^@}^@
Press ENTER or type command to continue

Main.zig:

^[[?7l^[[1m^[[32m ___________                                                
^[[32m|_          \                                                          
^[[32m| ^[[37m| _____ ^[[32m|                                              
^[[32m| ^[[37m| | | | ^[[32m|                                              
^[[32m| ^[[37m| | | | ^[[32m|                                              
^[[32m| ^[[37m\__^[[37m___/ ^[[32m|                                        
^[[32m\_________/                                                          
^[[0m^[[7A^[[17C^[[32m^[[1m^[[33m^[[1mtrainraider^[[1m@^[[33m^[[1mlenovo-laptop^[[0m^[[47D^[[7C^[[37m^[[0    m
^[[17C^[[32m^[[1mos^[[0m^[[2D^[[7C^[[37mLinux Mint 20.2^[[0m                 
^[[17C^[[32m^[[1mhost^[[0m^[[4D^[[7C^[[37m82B5 Lenovo Legion 5 15ARH05^[[0m  
^[[17C^[[32m^[[1mkernel^[[0m^[[6D^[[7C^[[37m5.13.0-1009-oem^[[0m             
^[[17C^[[32m^[[1muptime^[[0m^[[6D^[[7C^[[37m2d 23h 57m^[[0m                  
^[[17C^[[32m^[[1mpkgs^[[0m^[[4D^[[7C^[[37m2852^[[0m                          
^[[17C^[[32m^[[1mmemory^[[0m^[[6D^[[7C^[[37m3685M / 7315M^[[0m               
                                                                             
^[[?7hconst std = @import("std");                                            
                                                                             
pub fn main() anyerror!void {                                                
    std.log.info("All your codebase are belong to us.", .{});                
}          

Disable opening and closing loclist automatically

Whenever I commit a file change(:w) in neovim. zls automatically opens a Location List at the bottom of by current buffer. I have configured my location list with lsp diagnostics but I like to keep the loclist without any distractions. But zls is very forceful about it that it opens it up when there's an error and closes it when there are 0 errors. This makes the saves take longer and gives a laggy experience. Please disable loclist by default in zls.

For Context, I am using the lastest zls (zls-git from AUR) and zig (zig-bin from AUR) on my machine and I installed zls in neovim using Mason.

Redirect `zig env` stderr to /dev/null

Here:

silent let s:env = system('zig env')

On my NixOS system, when the dynamic linker is broken (an upstream bug that I'm waiting for a fix), it outputs some garbage to stderr about not being able to do some linking but otherwise runs the command successfully. However, zig.vim breaks because it tries to parse the full output as json.

To make this more robust, we should redirect stderr to /dev/null and just parse stdout. system always executes in the context of a shell1 so we just have to use 2>/dev/null.

I know this isn't zig.vim's bug, but this would make it more robust to system issues.

Filetype plugin should not affect other buffers

In ftplugin/zig.vim expandtab, tabstop and shiftwidth are set globally which affects all buffers while it should only be relevant for zig files.

From :help ftplugin - http://vimdoc.sourceforge.net/htmldoc/usr_41.html#41.12

To make sure the filetype plugin only affects the current buffer use the
:setlocal
command to set options. And only set options which are local to a buffer (see
the help for the option to check that). When using :setlocal for global
options or options local to a window, the value will change for many buffers,
and that is not what a filetype plugin should do.

Git tag versions (perhaps match the zig version at the time?)

Hello!

Will you git tag this with versions moving forward?
(ex: git --tag v1.2.3 && git push --tags)

I've had issues in the past with vim plugins updating and breaking my workflow.

It's nice to have a git tag so that anyone can quickly see

  1. something changed
  2. the severity (major, minor, patch)

And because, y'know...

define used vim default colors for easy reusage on semantic token highlighting

Semantic token highlighting groups were recently merged in neovim and overwrite the vim defaults, which makes usage of different colors to signal things or potential fixups etc more cumbersome.

Task: Define the used colors in

highlight default link zigDecNumber zigNumber
and provide a simple table in the README, so users have a simpler job to tailor or fix their/others color schema.

Add neovim instructions

I just started using neovim, apparently it requires special instructions for plugin install. The standard instructions for installing vim plugins didn't work for me.

I had to install junegunn/vim-plug first, then I set up this plugin by adding these lines to my ~/.config/nvim/init.vim:

call plug#begin(stdpath('data') . '/plugged')
Plug 'ziglang/zig.vim'
call plug#end()

Then launched nvim, :PlugInstall, and it installed the plugin. Restarted nvim and syntax highlighting was working for my zig files.

Indentation support

Hi.
It would be nice to have indentation support in this plugin because there's some gotcha when using cindent.
Thanks.

Allow disabling default style settings

Plugins like python.vim, rust.vim etc also set the tabstop, shiftwidth, etc for the recommended styling of the language but they all have a (i.e) g:python_recommended_style variable you can set to false to disable that
I think it would be a good idea to do the same here since I (and I'm sure many others) don't like plugins changing the indentation spacing and other settings

Add highlight group for ! and ? operators

There should be a special highlight group for the error set operator (!) and the optional operator (?). I propose the names zigErrorSet and zigOptional for these highlight groups.

Ideally it would be possible to have zigErrorSet not match the logical NOT operator (!), but I am not sure how such a thing might be implemented.

zigErrorSet and zigOptional should be linked to the (currently unused) zigSpecial highlight group.

Additionally, I feel it would also make sense to create a new highlight group zigDeref for the pointer dereference operator, which could perhaps also be linked to zigSpecial.

? and ! in particular are quite important to pay attention to, so I feel it makes sense to allow them to be specially highlighted to make them more obvious when reading code.

Bad indent for anonymous field types with trailing comma

Before anything, a minimal vimrc:

set nocompatible
" set runtimepath^=/path/to/zig.vim
syntax on
filetype plugin indent on

And my neovim version:

$ nvim --version
NVIM v0.4.4
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
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

Here we have a struct declaration, with one of the fields being of type <anonymous enum>.

pub const St = struct {
    anon_field: enum {
    },
};

For some strange reason, this specific example doesn't indent properly.
If indenting the line with the }, in it (using ==), it becomes:

pub const St = struct {
    anon_field: enum {
},
};

That doesn't happen, though, if there is any non-empty line between the opening and closing brackets of the enum declaration:

pub const St = struct {
    anon_field: enum {
        some_field
    }, // indents properly
};

Some other situations:

// if there is no trailing comma, it indents properly
pub const St = struct {
    anon_field: enum {
        some_field
    }
};

// if there is any character other than a comma after the line, it also indents properly
pub const St = struct {
    anon_field: enum {
    }, // this comment prevents the indent problem
};
pub const St = struct {
    anon_field: enum {
    }, 
    // (there's a trailing whitespace on the line above)
};

// empty lines do not solve the problem
pub const St = struct {
    anon_field: enum {

},
};

// identifiers that are on the same line as the opening bracket do not solve the issue either.
pub const St = struct {
    anon_field: enum { foo, bar
},
};
pub const St = struct {
    anon_field: enum { foo, bar,
        a // it solved with this one here, though
    },
};

// it also happens with `struct` and any other type. The problem seems to be on the brackets themselves.
pub const St = struct {
    anon_field: struct {
},
};
pub const St = struct {
    anon_field: union(enum) {
},
};
pub const St = struct {
    anon_field: {
},
};

zig-cache getting created on save

When writing a zig file, a zig-cache directory gets created in the current directory, which I would prefer not to happen. I am using neovim 0.2.2.

Peculiar behavior with indentation and curly braces

Take a look at this:

image

Now I will press Enter to expand my curly braces:

image

The workaround is the following:

image

Final result:

image

Quite peculiar, don't you think?

I could be wrong, but semicolon affects closing brace's behavior somehow 🤷

zig_fmt_autosave | Trailing comma in function args raises an error

With zig_fmt_autosave enabled, the following file causes an error to be raised on save.

const std = @import("std");
test "format bug" {
    std.debug.print("Hello, World!",);
}

The error:

Error detected while processing function <SNR>17_fmt_autosave[2]..zig#fmt#Format:
line   39:
"format-bug.zig" 5L, 90C written

It seems this is a bug in the vim plugin, because if I run the zig fmt command on the same file from the command line the file is formatted correctly - that is the args of print are wrapped onto new lines because of the trailing comma.

request: revert #60

enabling --ast-check causes zig fmt to not work in many cases during development since unused variables is now a check under AstGen.

not having the code properly formatted can making solving these errors much harder than they over wise would be

#60

Suggestion: Remove `formatprg`

The primary use of gq or formatprg is to format a visual selected block or text-motion selected block. zig fmt --stdin requires the entire context of either the container you are writing or the file to be able to format reasonably. For example, one of my primary uses for gq is to wrap the text at some width, especially documentation comments. For example:

const Stage = struct {
    /// All the world’s a stage, And all the men and women merely players; They have their exits and their entrances; And one man in his time plays many parts, His acts being seven ages. At first the infant, Mewling and puking in the nurse’s arms;
    players: []const u32,
};

Now, zig fmt doesn't format the documentation comment to a fixed column size on save. But if I try to select the line I want wrapped and run gq, I get:

const Stage = struct {
<stdin>:1:5: error: unattached documentation comment
    players: []const u32,
};

On the other hand, if I select the entire context (struct definition), I run into the same issue that zig fmt doesn't care about column length.

I would suggest we remove formatprg altogether as I believe that anyone using this plugin is probably using zig fmt on save anyway.

"Lone" else lines are not properly indented

By "lone" else lines, I mean lines in if statements that only have whitespace and the else keyword. They're usually around when there is a multi-line if condition that isn't directly made up of blocks.

For an actual example on what is happening - I typed this code from top to bottom using automatic indentation:

const a = if (cond)
    val1
    else
    val2;

pub fn main() void {
    const b = if (cond)
        val1
        else
            val2;
}

What I expect to happen is the following:

const a = if (cond)
    val1
else
    val2;

pub fn main() void {
    const b = if (cond)
        val1
    else
        val2;
}

NOTE: I was previously working on this under the #59 PR, but got stuck and don't really know where to go anymore, so I'm leaving it up for anyone who may be able to tackle this in a better way.

Adding line causes repeatable freeze in neovim

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

Location list is always empty upon saving a file with an error

Whenever I save a Zig file that's in a broken state, the location list opens but doesn't contain any errors. It's always empty.

This is on macOS, version 11.2.1 using the latest version of this plugin.

$ vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar 16 2021 10:55:44)
macOS version - x86_64
Included patches: 1-2608
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           -netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl              +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua               +ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/Users/kevinsjoberg/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -L. -L/Users/kevinsjoberg/.asdf/installs/ruby/3.0.0/lib -fstack-protector-strong -L/usr/local/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit -L/Users/kevinsjoberg/.asdf/installs/lua/5.4.2/lib -llua -fstack-protector-strong -L/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE -lperl -L/Users/kevinsjoberg/.asdf/installs/python/3.9.2/lib/python3.9/config-3.9-darwin -lpython3.9 -lintl -framework CoreFoundation -lruby.3.0 -L/Users/kevinsjoberg/.asdf/installs/ruby/3.0.0/lib 

not fully compatible with v0.6.0 from 2020-04-13

presumable because zig 0.6.0 doesn't have zig env vim reports:

Error detected while processing /home/anu/.config/nvim/bundle/zig.vim/ftplugin/zig.vim: line 34: E474:Unidentified byte: Unrecognized command: env^@See `zig --help` for detailed usage information^@
E474: Failed to parse Unrecognized command: env^@See `zig --help` for detailed usage information^@
Press ENTER or type command to continue

error on saving file also causes zig's format report to not be shown

errorformat is incorrect

This plugin doesn't set the errorformat, and so multiline failures like:

/home/jason/src/my-language/src/main.zig:359:22: error: unable to resolve inferred error set
    try readDelimited(ps, ')');
        ~~~~~~~~~~~~~^~~~~~~~~
referenced by:
    macros: /home/jason/src/my-language/src/main.zig:218:20
    read: /home/jason/src/my-language/src/main.zig:494:41
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

Don't get interpreted properly. I propose a different errorformat (and I would like to make a pull request). Here is my new errorformat:

"    macros: /home/jason/src/my-language/src/main.zig:218:20
set efm=\ \ \ \ %m:\ %f:%l:%c
"/home/jason/src/my-language/src/main.zig:359:22: error: unable to resolve inferred error set
set efm+=%f:%l:%c:\ %t%.%#:\ %m
"[matches anything]
set efm+=%C%m

Cannot redo (C-r) after saving with autoformat

The redo command does not work after saving a file with autoformatting enabled

let g:zig_fmt_autosave = 1

Steps to reproduce the bug:

  1. Make a change
  2. Save file
  3. Undo change
  4. Save file
  5. Redo change

The last step does not work.

Tried on neovim v0.4.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.