Skip to content

Conversation

adamyi
Copy link

@adamyi adamyi commented Jul 7, 2020

No description provided.

@adamyi
Copy link
Author

adamyi commented Jul 7, 2020

It seems that the failed tests are unrelated to this cl, but in prettier and clang-format. The ocamlformat vroom tests passed :)

Copy link
Contributor

@dbarnett dbarnett left a comment

Choose a reason for hiding this comment

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

Thanks! And thanks for bearing with me on delays getting it reviewed!

let l:fname = expand('%:p')
if !empty(l:fname)
let l:cmd += ['--name', l:fname]
let l:fname_pattern = '"' . escape(l:fname, '\') . '"'
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider defining this closer to the usage. Currently it looks really fishy doing all this escaping and concatenation without any hints what it's used for until much further down.

let l:matchidx = 1
while 1
let l:tokens = matchlist(v:exception,
\ '\vFile ' . l:fname_pattern . ', line (\d+), characters (\d+)-\d+:\n(.*)\n', 0, l:matchidx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the double indirection matching the output using (1) a pattern built from (2) a dynamic variable, could you just do a looser match for anything that looks like "filename or " and skip any that don't match? This seems like it could be brittle if e.g. paths may be absolute/relative, or have any trivial extra characters like "./".

ar1ja pushed a commit to ar1ja/vim-codefmt that referenced this pull request Jan 15, 2022
Signed-off-by: Ari Archer <truncateddinosour@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants