From Silvan Jegen to ~martanne/devel
Matěj Cepl <mcepl@cepl.eu> wrote: > When profiling (on 100,000 calls) with this test: > > ```lua > start_t = os.clock() > for i = 1, 100000 do > _ = home .. prefix > end > end_t = os.clock() > print(end_t - start_t) > ``` > > I get on my computer this (warm): >
From Silvan Jegen to ~martanne/devel
Matěj Cepl <mcepl@cepl.eu> wrote: > On Sun Jan 19, 2025 at 12:18 PM CET, Silvan Jegen wrote: > >> References: https://github.com/martanne/vis/pull/1148#issuecomment-1792649763 > > > > With this patch applied, doing <C-x><C-o> expands the tilde character to $HOME. > > Not sure why it doesn't do the same when typing <C-x><C-f> but either way this > > LGTM! > > See the discussion on the referred GitHub pull request, I believe > this is the correct way how to do it, and certainly it is the way > it more matters to me, because <C-x><C-o> is bound to <TAB> in > `:open` prompt [1], so `~` is thus expanded there. Works for me as well! :) Thanks for the explanation!
From Silvan Jegen to ~rockorager/go-jmap-devel
"Tim Culverhouse" <tim@timculverhouse.com> wrote: > On Mon Jan 6, 2025 at 3:21 PM CST, Silvan Jegen wrote: > > Thanks for your input! I am learning a lot about the JMAP protocol, > > which was one of my motivations to look at the code :) > > I went ahead and applied this patch as is. I think the larger picture > about the API usage is still a question, but that isn't a reason to > hold up this one :) Yes, that seems reasonable! I may have more valuable input if I get around actually using the library as well.
From Silvan Jegen to ~rockorager/go-jmap-devel
"Tim Culverhouse" <tim@timculverhouse.com> wrote: > > Silvan Jegen <s.jegen@gmail.com> wrote: > > AFAICT the locking dance we have to do in the client is only necessary > > because we allow Authenticate to be called in so many places. > > > > I wonder if it wouldn't be better to just introduce a `NewClient() > > (*Client, error)` function that returns an authenticated client with a > > valid session (or an error). > > In JMAP, each request returns the state string of the session object. I've found I wasn't aware of this state string! I have read up a bit about it and from what I understand, some of the API response objects also return the session state, which then can be used to "... quickly determine if
From Silvan Jegen to ~rockorager/go-jmap-devel
Silvan Jegen <s.jegen@gmail.com> wrote: > This makes sure we don't end up Unlocking an unlocked mutex while > also covering the critical section where we access the Session's > Upload/Download URLs. AFAICT the locking dance we have to do in the client is only necessary because we allow Authenticate to be called in so many places. I wonder if it wouldn't be better to just introduce a `NewClient() (*Client, error)` function that returns an authenticated client with a valid session (or an error). This would allow us to get rid of all the locking since the session will always be there, valid and read-only.
From Silvan Jegen to ~martanne/devel
Matěj Cepl <mcepl@cepl.eu> wrote: > --- > test/lua/README.md | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/test/lua/README.md b/test/lua/README.md > index 5b9a1e6f..21a63fb5 100644 > --- a/test/lua/README.md > +++ b/test/lua/README.md > @@ -1,7 +1,7 @@ > Unit Test for Vis' Lua API > -------------------------- > > -The tests use the [busted unit testing framework](https://olivinelabs.com/busted/).
From Silvan Jegen to ~martanne/devel
Heyhey! On May 8, 2024 2:51:47 PM GMT+02:00, Randy Palamar <randy@rnpnr.xyz> wrote: >Florian Fischer <florian.fischer@muhq.space> wrote: >> Hey Randy, >> >> > I'm not against this but I'm a little confused as to how this is >> > different from ":e". Is it because the window is not usable in the >> > `FILE_OPEN` event (and/or why can't you use ":e" in your plugin)? >> >> No problem. In your defense I did not explain the issue with the straight >> forward attempt to implement the plugin in the first place.
From Silvan Jegen to ~martanne/devel
Florian Fischer <florian.fischer@muhq.space> wrote: > Change the file displayed in a window by writing the new file name > to the window's file member. > --- > v2: remove strdup call > > vis-lua.c | 3 +++ > vis.c | 11 +++++++++++ > vis.h | 2 ++ > 3 files changed, 16 insertions(+) LGTM! Cheers,
From Silvan Jegen to ~martanne/devel
Florian Fischer <florian.fischer@muhq.space> wrote: > > Florian Fischer <florian.fischer@muhq.space> wrote: > > > --- > > > vis-lua.c | 3 +++ > > > vis.c | 11 +++++++++++ > > > vis.h | 2 ++ > > > 3 files changed, 16 insertions(+) > > > > > > diff --git a/vis-lua.c b/vis-lua.c > > > index 4d783c5d..cb328b66 100644 > > > --- a/vis-lua.c > > > +++ b/vis-lua.c > > > @@ -2058,6 +2058,9 @@ static int window_newindex(lua_State *L) { > > > }
From Silvan Jegen to ~martanne/devel
Heyhey! Florian Fischer <florian.fischer@muhq.space> wrote: > --- > vis-lua.c | 3 +++ > vis.c | 11 +++++++++++ > vis.h | 2 ++ > 3 files changed, 16 insertions(+) > > diff --git a/vis-lua.c b/vis-lua.c > index 4d783c5d..cb328b66 100644 > --- a/vis-lua.c > +++ b/vis-lua.c > @@ -2058,6 +2058,9 @@ static int window_newindex(lua_State *L) {