Fork me on GitHub
#conjure
<
2020-05-20
>
ghosttoaster00:05:42

I swear I did like 10 times but it looks like ConjureSchool is working now!

ghosttoaster00:05:47

However I'm getting a connection error when the repl starts now...

ghosttoaster00:05:05

It seems like its trying to connect on 50783 everytime, maybe I have some old configuration...

Olical08:05:32

Yep, @U0AHJUHJN should be right. There's probably a .nrepl-port file sitting around from an old server. Glad to hear the school is working though! Let me know if you have any issues or questions!

dave01:05:33

Conjure now looks for a file called .nrepl-port in the working directory. Maybe you have a stale .nrepl-port file laying around? Usually, the nREPL server deletes that file when the process exits, but there are probably edge cases where it doesn't get a chance to do that

heefoo06:05:52

has anyone tried https://github.com/weavejester/hashpashp with conjure ? output is very awkward

; --------------------------------------------------------------------------------
; eval (current-form): (str #p "hashp test")
; (out) [31m#p[0m[32m[emtec-data-transfer.routes/eval30643:18][0m [1;35m"hashp test"[0m
"hashp test"

heefoo06:05:33

what is the reason for the strange chars in printed output ?

Olical08:05:23

@U11EL3P9U is right, this is ANSI terminal colour codes, so in a terminal they would highlight your text. Vim has no way to render these, there are plugins that attempt to turn them into highlighting such as https://www.vim.org/scripts/script.php?script_id=302 I think there's a Lua based Neovim one that @U0AHJUHJN found too? But I think your best bet is composing the Conjure log buffer with one of these. I may add some tools to strip the codes out if you don't need them, but I haven't decided yet. I'm trying to alter your output as little as possible.

Olical09:05:32

Hmm not sure about that since it'll change the filetype I think?

heefoo09:05:56

yes it changes the filetype, but it seems to work

heefoo09:05:06

it strips the color theme although

Olical09:05:44

Yeah, that's the problem, it'll remove the Clojure part. The other one I linked might work better :thinking_face:

heefoo09:05:57

; eval (current-form): (str #p "test")                                                                                                                                                         
; (out) #p[emtec-data-transfer.routes/eval30722:17] "test"                                                                                                                                     
"test" 

Olical09:05:59

Because you want to keep your filetype, just apply a conceal and highlight.

heefoo09:05:09

I will test it

heefoo10:05:52

Unfortunately i get a bunch of errors from neovim

heefoo10:05:00

E519: Option not supported: hl=8:Ignore,~:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLineNr,r:Question,
s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:Spel
lBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,0:Whitespace
,I:NormalN

heefoo10:05:00

I am not sure what exacly is going on

Olical10:05:08

Oh that sucks 😞 maybe it's not supported by nvim now.

Olical10:05:28

I have a todo item to somehow support term codes, but one option would be for me to give you an option to strip them out for now.

heefoo10:05:41

no worries

Olical10:05:49

I was hoping there would be a plugin out there that people can install if they really want this sort of thing.

heefoo10:05:07

let me check something

heefoo10:05:59

ansiesc partialy works

heefoo10:05:12

after the bunch of errors but changes the filetype too

heefoo10:05:28

I dont think it is debugable

Olical10:05:39

Maybe I should write my own 😬 I don't know if it should be a part of Conjure or not.

Olical10:05:49

Although this is the one @U0AHJUHJN tried with mixed success, he's raised a couple of issues on it.

heefoo10:05:47

strange. I already use this plugin it seems

heefoo10:05:06

there are two colorizer, i was using lilydjwg/colorizer

Olical10:05:58

I would love to find a 3rd party plugin that does this, it's a hard thing to get right and I'm worried if I do it myself I'll lose loads of time to just this feature 😅 so I think maybe an option to strip them out while recommending a good plugin to use is the best route.

heefoo10:05:29

makes sense

heefoo10:05:08

Well, it works for the log buffer

Olical10:05:28

I'm afraid you'll have to put up with the noise for a little bit if there's no working plugins out there. I'll add an option soon that will strip them out for you then I'll have to write my own plugin for it I guess 😅 ]

heefoo10:05:05

well the noise only appears on HUD now

heefoo10:05:10

so i can live with that

Olical10:05:54

Ohhh that's interesting! How promising!

Olical10:05:17

Maybe we could find a way to enable it in the HUD when I have custom Conjure autocommands implmented.

Olical10:05:31

So you could hook into "HUDWindowOpen" or whatever and then enable the highlighting in there.

heefoo10:05:34

could be the case

heefoo10:05:31

it would be tricky to apply colorizer only to the conjure-log as is

heefoo10:05:46

gosh, i haet vimscript

💯 4
heefoo10:05:29

@olical maybe the Conjure custom commands will fix the problems. Focosing on another buffer disables colors

Olical10:05:49

Oh, that plugin only highlights the current buffer?

heefoo10:05:28

Not even that. it has a variable to hightlight filetypes

heefoo10:05:46

otherwise you have to toggle it manually

heefoo10:05:47

but living your buffer it resets back to normal

dave10:05:59

That's the main issue I ran into with Colorizer. The highlighting isn't consistent. It will highlight sometimes and then the highlighting goes away when you move from split to split, etc.

heefoo10:05:08

Ok i think i found the problem.

heefoo10:05:25

there is a variable to avoid that aparently

heefoo10:05:47

By default, the colorings will be deleted if you switch to a different buffer                                                                                                                  
in the same window by using a BufLeave autocommand. However that might                                                                                                                         
unintentionally uncolor the current window, so if you experience a problem                                                                                                                     
with that, try setting the variable g:colorizer_disable_bufleave like this:                                                                                                                    
                                                                                                                                                                                               
  ¦ let g:colorizer_disable_bufleave = 1  

dave10:05:10

Whoa! That sounds very promising

heefoo10:05:17

well it works

dave10:05:57

Good find

heefoo10:05:15

but i will problably write i vimscipt function to detect the conjure log and apply the pluggin

heefoo10:05:27

I so much hate vimscript

dave10:05:27

It boggles my mind that the author thought people wouldn't want that behavior by default!

heefoo10:05:41

indeed this is peculiar

dave10:05:05

Ah, I've done something like that in my vimrc. I can show you what I've done

dave10:05:52

I'm on mobile right now so I can't link to the line numbers, but search this file for "Colorizer" and you'll find my hacks: https://github.com/daveyarwood/dotfiles/blob/master/vim/custom/500-plugins-config.vim

heefoo10:05:03

great, thanks !

heefoo11:05:21

Ok there is still a bug

heefoo11:05:51

when updating the buffer from another buffer there seems to be no way to show the colors unless you enter the log buffer

heefoo11:05:59

damn, it works but strips the theme

Olical11:05:18

Guess I'll have to do my own 😅

😲 4
dave13:05:45

i'm not totally giving up on the idea that one could tame Colorizer to work the way we want it to

dave13:05:03

there has to be something we can hook into with an autocmd to colorize the log buffer whenever it appears

dave13:05:15

like some kind of floating window on-show hook

Olical13:05:26

I think the best UX would be "conjure just does the right thing", so I kinda wanna write my own into conjure at some point

dave13:05:48

it certainly would be nice to not have to install a separate plugin for that

heefoo14:05:07

@U0AHJUHJN I tried to debug colorizer further

heefoo14:05:25

The issue is that colors won't update unless someone enters the buffer

heefoo14:05:22

Even running ColorHighlight on the logbuffer without "entering" it will not work

heefoo14:05:11

I dont write vimscript but i managed to learn enought to test it with the following function

function! Cc()
  let buffers = map(copy(getbufinfo()), 'v:val.bufnr')
  for bf in buffers
    let l:cnlog = bufname(bf)
    let matchs = matchstr(l:cnlog, ".*njure-log.*")
    if matchs == ''
    else
      let l:bufnr = bufnr('')
       execute 'noautocmd keepalt buffer' bf
       execute  'ColorHighlight'
       execute 'noautocmd keepalt buffer' l:bufnr
    endif
  endfor
endfunction

heefoo14:05:06

This detects the conjure-log buffer, runs the ColorHighlight command on it and returns to the current buffer. The spaces update but the colors dont !

dave15:05:24

i was just testing let g:colorizer_disable_bufleave and it seems to work about the same as my autocmd hackery. i think i'll use this instead because not decolorizing when you leave a buffer is what i really want 🙂

dave15:05:33

the next step is reliably colorizing

dave15:05:44

which is what i think you're on the path towards

dave15:05:02

i'll mention this on the issue i filed. i think what we really want is for colorizer to colorize automatically when a floating window appears

dave15:05:48

i also frequently notice weirdisms like this, where it seems to be preserving the colors on just certain lines/columns

heefoo16:05:13

Could it be the case that is interpreting some characters there as ansi colors ?

dave16:05:17

there aren't any, in that buffer

dave16:05:26

like, it wasn't colorized, then i flipped over to the conjure log which was colorized

dave16:05:36

then i flipped back, and just those characters are colorized now

heefoo17:05:03

The plugin seems very unstable

dave17:05:33

that's the impression i get too

dharrigan06:05:56

That's ansi formatted characters. I think this was talked about before...can't recall. I'm sure Oliver will chime in shortly 🙂

❤️ 4