Code Monkey home page Code Monkey logo

Comments (5)

rktjmp avatar rktjmp commented on May 28, 2024

Can you try the source-cmd branch?

https://github.com/rktjmp/hotpot.nvim/tree/source-cmd

It will ask you if you want to delete the cache file for now, I will have to patch a "no confirm" argument into that later.

It also makes some assumptions that what you're sourcing is under a "fnl" folder so we can guess the module name for the require call (needed so hotpot knows to do work).

The :Fnl* commands sort of operate outside of the main hotpot setup (they dont create cache files and wont patch the macro searcher (perhaps an oversight)) so I was probably over zealous when linking :source to :Fnlfile.

from hotpot.nvim.

iagoleal avatar iagoleal commented on May 28, 2024

Just tested the branch and it seems to be working as expected.
Thank you very much!

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 28, 2024

Sorry took me a moment to put this in the main branch.

from hotpot.nvim.

avegancafe avatar avegancafe commented on May 28, 2024

I know this is an issue from a long time ago, but for some reason source $MYVIMRC when changing macros.fnl for example doesn't trigger a recompile, but sourceing the file directly does. Is that known behavior?

from hotpot.nvim.

rktjmp avatar rktjmp commented on May 28, 2024

Does :messages show anything?

but sourceing the file directly does

Do you mean :source some/fnl/file.fnl or :source ~/.config/nvim/init.lua (manually expanding the $ var)?

What is $MYVIMRCs value?

:source will "unload" the module by setting packages.loaded[modname] = nil but it wont go any deeper than that, and only if it can guess the mod name. So for $MYVIMRC it may not be able to guess the mod name as it looks for something under fnl/.

I would bet that the child modules are not getting unloaded, so they are never reloaded, so the changes are never picked up.

You may want to write a small function that just nukes anything under a certain module namespace to ensure all your config mods are unloaded:

;; may not be functional
;; assumes you have your config under "fnl/my/config/..."
(each [_i mod (ipairs package.loaded)]
  (if (string.match mod "^my.config")
    (tset package.loaded mod nil)))
(vim.cmd.source $MYVIMRC) ;; probably need vim.expand or something here for the var

from hotpot.nvim.

Related Issues (20)

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.