Closed SevereOverfl0w closed 6 years ago
Surely g:fireplace_pprint_max_right_margin
would make more sense as &columns
(or maybe &columns - 1
), no?
I matched the default width of clojure.pprint/pprint
. I (personally) feel like a width of &columns
on my screen might be a little wide for reading, but I'm not sure if fipp/pretty printers will collapse in a sane way despite that.
Happy to make the change if you're certain though. Is a special value like -1
or 'calculate-columns'
the way to do it?
Comparison of &columns and 72 on a reflection of java.io.File.
My read width expands far past the &columns. Having said that, I've pushed a patch which makes the change as requested.
Let's name the option g:fireplace_print_right_margin
, to more closely mirror the API. Use get(g:, 'fireplace_print_right_margin', &columns)
with no global default to achieve the correct behavior with no need for a sentinel value like "&columns"
.
Instead of hard coding a list of pprint options in the nrepl adapter, try something like this:
for [k, v] in items(options)
let msg[tr(k, '_', '-')] = v
endfor
This should enable cleaning up some of the other msg
mutating code to boot.
I've made the changes requested. nrepl adapter is much nicer.
Haven't fully audited this but I spy a spurious echo
.
Oops, thought I'd pushed over that. Gone.
I can't get this to work. It's using the load-file
middleware, which appears to not support pretty print?
Load file delegates to eval, so it should work. Obligatory, do you have cider 0.15 loaded?
On 26 Jul 2017 05:59, "Tim Pope" notifications@github.com wrote:
I can't get this to work. It's using the load-file middleware, which appears to not support pretty print?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tpope/vim-fireplace/pull/301#issuecomment-317947864, or mute the thread https://github.com/notifications/unsubscribe-auth/AF2h2i7rEK6CbiguQ0cYpyne6uhct_jLks5sRse-gaJpZM4ORrQd .
So, this is strange. It didn't work on my first evaluation, so I added echo msg
to the nrepl adapter, and restarted vim, at which point it did work.
I've now deleted the echo msg
, and it still works.
I have no idea why, have you ever seen something like this?
This works/breaks across restarts of the JVM, I'm guessing that CIDER may need to be a little more forceful about being in front of load-file as well as eval.
CIDER has accepted my PR fixing the non-deterministic pretty print. It will be in 0.15.1, or you can build from master.
0.15.1 is now released, so this PR can be tested.
Looking at :Eval
, this seems trivial to add there. Any reason to not include that in this PR?
I've pushed a commit which adds support for :Eval
, I've been using this locally for a while and not seen any problems.
I'm currently using this on pretty large data structures, very happy with the results. Would be awesome to have this good work in master :slightly_smiling_face:
I just pulled latest but I'm not seeing pprint'd structures with cpp
or Eval
. Do I need to activate it? Not seeing anything in the source 🤔 Using cider 0.16.0.
I'm using the branch and fork mentioned in this PR, it's not merged yet. Just voicing my support and testing for it :)
On Fri, 13 Apr 2018, 00:53 Trevor Hartman, notifications@github.com wrote:
I just pulled latest but I'm not seeing pprint'd structures with cpp or Eval. Do I need to activate it? Not seeing anything in the source 🤔 Using cider 0.16.0.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tpope/vim-fireplace/pull/301#issuecomment-380978438, or mute the thread https://github.com/notifications/unsubscribe-auth/AATPXVUnMs452S5-NA_qtwQwQfUtFtpOks5tn-jigaJpZM4ORrQd .
@Olical it's merged!
I got it working mysteriously after restarting vim several times and messing around with my init.vim
. /shrug
This is amazing. 💯
The default is the same as what CIDER.el uses, and seems sensible. I got significantly better results using fipp than clojure.pprint
This could be extended to other evaluations quite easily too, I think
:Eval
would benefit, but I only matched the suggestion you made in #262