error markers aren’t working for some reason, maybe someone else will see the problem? https://github.com/oakmac/atom-parinfer/pull/84
I like VSCode, it’s very snappy, but stuff like protorepl and parinfer is keeping me in Atom for now.
I gave VSCode a shot but couldn't get the repl connecting to my boot project, so gave up
I really want to like it
Form a coalition and build your own!
error markers are working now
will move on to migrating atom-parinfer config to the settings UI so people can enable smart mode more easily
smart mode isn’t very smart about pasting
i’m tempted to make it run indent mode on paste
copying lines at the end of a function and pasting it in the middle of the function causes subsequent lines to get dedented
indent mode would prevent that
when I’m correcting indentation, I am sometimes annoyed that I can’t disconnect a line from its children
so I think Indent Mode still has its place
Fight the good fight. Make sure your editor stays in the ring!
I haven't followed much of the smart mode discussion or anything. Could there be some "pasting" flag to smart mode that internally uses indent mode?
Cutting and pasting is very problematic with parinfer in general.
Indent mode only works if the editor is smart about adjusting indentation, and paren mode only works if the pasted text is balanced.
(assuming you’re pasting multi-line text)
how can an editor be smart about adjusting indentation when pasting?
yeah, I don’t think running indent mode on paste makes sense, since the user would still have to manually go back to indent mode if the editor doesn’t paste the text at the right indentation they wanted
I’m fine with recommending switching to indent mode to paste for now
I’ll think about whether the modes should be renamed to reflect when users should be in them
smart mode -> write mode indent mode -> paste mode paren mode -> (not named, only used when opening unbalanced files)
@shaunlebron my brain can never remember the different modes. So if I paste (and something magically does indent). Why can't I go back into smart mode immediately?
it can throw you back into smart mode if you pasted it at the correct indentation
but as a vim user, I paste whole lines and adjust indentation after
the “adjust indentation after” has to happen in indent mode
I’m not convinced there is enough data in a paste operation to find the correct indentation level
modes suck, but I don’t see a better solution here
the way that I've come to think of it when working in emacs is, "I'm splicing the clipboard at this point"
can you elaborate? I don’t understand what that means
so I've typically copied one or more expressions
let's say it's x (a b) y
and I want to splice that into (foo i j |k)
where |
is the cursor
maybe the individual symbols are on different lines
but my expectation is always the same, I'm going to end up with (foo i j x (a b) y k)
thanks for that example
the combo of parinfer & smartparens I use in emacs does this like 95% of the time
the structure has to be preserved since you’ve consciously pasted some valid structure into another
(let [a 1
b 2
c 3] ; <-- cut/paste this line to move it up
...)
(let [a 1
c 3]
b 2
...)
(let [a 1
c 3]
b 2 ; <-- smart mode dedents once cursor leaves line above
; (paren mode would same, but immediately)
...)
(let [a 1
c 3
b 2] ; <-- indent mode would correct the paren
...)
maybe pasting should apply paren mode only if the form is balanced
and indent mode otherwise
one of the problems I've had with this combo of evil + parinfer + smartparens is that I have a situation like:
and out of habit I leave insert-mode to paste, and it cleans up the "trailing" whitespace on that line
so then I end up with:
and I then I have to fix it with either indenting or slurping
though I think this is more a problem of using evil-mode than anything with parinfer
I almost want to do something crazy like: 1. highlight the pasted text in yellow and drop into indent mode 2. ask the user to correct the indentation (maybe give them a draggable handle bar for it) 3. have a ‘done’ button below and above the pasted text line to drop back into smart mode
And you think you can implement that on vim? 😆
ha, I meant atom with vim bindings
maybe not by overriding native paste, but as a custom “safe paste” operation that can be bound
anxious to hear other ideas here
it's a tough problem
I think there are a handful of different use cases and it's hard to divine intentions