diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-08-19 00:08:58 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-08-19 00:08:58 -0600 |
| commit | 57171e2191fa769d15d2a33db13703d239cb4acf (patch) | |
| tree | ee6f1b42c0f153c270b522a1755996f64e860a82 /plugin/fileregister.lua | |
| parent | 852bd19b8148023db10aad2d9d1e0c44bf38cac6 (diff) | |
| download | rneovim-userregs-57171e2191fa769d15d2a33db13703d239cb4acf.tar.gz rneovim-userregs-57171e2191fa769d15d2a33db13703d239cb4acf.tar.bz2 rneovim-userregs-57171e2191fa769d15d2a33db13703d239cb4acf.zip | |
add basename register
Diffstat (limited to 'plugin/fileregister.lua')
| -rw-r--r-- | plugin/fileregister.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/plugin/fileregister.lua b/plugin/fileregister.lua index a2b5621..856149a 100644 --- a/plugin/fileregister.lua +++ b/plugin/fileregister.lua @@ -9,7 +9,6 @@ -- requires 'json-lua' local userreg = require("vim.userreg") -local json = require('JSON') local api = vim.api local handler = {} @@ -23,6 +22,7 @@ end -- Stores the yanked text into the fileregister as JSON. function handler.do_yank(self, content) + local json = require('JSON') local file = self.get_file_name(); string = json:encode(content) @@ -34,6 +34,7 @@ end -- Reads the text from the file register and returns it. function handler.do_put(self) local file = self.get_file_name(); + local json = require('JSON') file = io.open(file, "r") |