Created
October 22, 2022 17:27
-
-
Save hem-brahmbhatt/7f8f946554e9ae28e7273505873af537 to your computer and use it in GitHub Desktop.
Print or log to a file in lua using standard lib
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Log the pattern matching result to a file | |
| logfile = io.open("/tmp/nvim.log", "a") | |
| io.output(logfile) | |
| for _, ignored_buffer in ipairs(config.buffers.ignored_buffers or {}) do | |
| io.write("bufname: "..bufname.."\n") | |
| io.write("ignored-buffer-regex: "..ignored_buffer.."\n") | |
| io.write("match: ", string.match(bufname, ignored_buffer) and "yes" or "no", "\n") | |
| io.write("\n") | |
| if string.match(bufname, ignored_buffer) then | |
| ignored = true | |
| end | |
| end | |
| io.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment