Fork me on GitHub
#parinfer
<
2017-08-02
>
shaunlebron00:08:53

error markers aren’t working for some reason, maybe someone else will see the problem? https://github.com/oakmac/atom-parinfer/pull/84

henrik04:08:52

I like VSCode, it’s very snappy, but stuff like protorepl and parinfer is keeping me in Atom for now.

dominicm06:08:05

Fight the good fight. Make sure your editor stays in the ring!

mattly16:08:58

I gave VSCode a shot but couldn't get the repl connecting to my boot project, so gave up

mattly16:08:05

I really want to like it

dominicm16:08:53

Form a coalition and build your own!

shaunlebron05:08:44

error markers are working now

shaunlebron05:08:59

will move on to migrating atom-parinfer config to the settings UI so people can enable smart mode more easily

shaunlebron05:08:44

smart mode isn’t very smart about pasting

shaunlebron05:08:07

i’m tempted to make it run indent mode on paste

shaunlebron05:08:28

copying lines at the end of a function and pasting it in the middle of the function causes subsequent lines to get dedented

shaunlebron05:08:31

indent mode would prevent that

shaunlebron06:08:13

when I’m correcting indentation, I am sometimes annoyed that I can’t disconnect a line from its children

shaunlebron06:08:39

so I think Indent Mode still has its place

dominicm06:08:22

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?

cfleming08:08:11

Cutting and pasting is very problematic with parinfer in general.

cfleming08:08:42

Indent mode only works if the editor is smart about adjusting indentation, and paren mode only works if the pasted text is balanced.

cfleming08:08:15

(assuming you’re pasting multi-line text)

shaunlebron12:08:59

how can an editor be smart about adjusting indentation when pasting?

shaunlebron12:08:19

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

shaunlebron12:08:05

I’m fine with recommending switching to indent mode to paste for now

shaunlebron12:08:21

I’ll think about whether the modes should be renamed to reflect when users should be in them

shaunlebron13:08:08

smart mode -> write mode indent mode -> paste mode paren mode -> (not named, only used when opening unbalanced files)

dominicm16:08:43

@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?

shaunlebron16:08:01

it can throw you back into smart mode if you pasted it at the correct indentation

shaunlebron16:08:41

but as a vim user, I paste whole lines and adjust indentation after

shaunlebron16:08:09

the “adjust indentation after” has to happen in indent mode

shaunlebron16:08:10

I’m not convinced there is enough data in a paste operation to find the correct indentation level

shaunlebron16:08:24

modes suck, but I don’t see a better solution here

mattly16:08:23

the way that I've come to think of it when working in emacs is, "I'm splicing the clipboard at this point"

shaunlebron16:08:20

can you elaborate? I don’t understand what that means

mattly16:08:04

so I've typically copied one or more expressions

mattly16:08:20

let's say it's x (a b) y

mattly16:08:58

and I want to splice that into (foo i j |k)

mattly17:08:19

where | is the cursor

mattly17:08:51

maybe the individual symbols are on different lines

mattly17:08:25

but my expectation is always the same, I'm going to end up with (foo i j x (a b) y k)

shaunlebron17:08:41

thanks for that example

mattly17:08:03

the combo of parinfer & smartparens I use in emacs does this like 95% of the time

shaunlebron17:08:13

the structure has to be preserved since you’ve consciously pasted some valid structure into another

shaunlebron17:08:16

(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
  ...)

shaunlebron17:08:21

maybe pasting should apply paren mode only if the form is balanced

shaunlebron17:08:10

and indent mode otherwise

mattly17:08:54

one of the problems I've had with this combo of evil + parinfer + smartparens is that I have a situation like:

mattly17:08:37

and out of habit I leave insert-mode to paste, and it cleans up the "trailing" whitespace on that line

mattly17:08:46

so then I end up with:

mattly17:08:39

and I then I have to fix it with either indenting or slurping

mattly17:08:17

though I think this is more a problem of using evil-mode than anything with parinfer

shaunlebron17:08:53

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

dominicm17:08:33

And you think you can implement that on vim? 😆

shaunlebron17:08:07

ha, I meant atom with vim bindings

shaunlebron17:08:14

maybe not by overriding native paste, but as a custom “safe paste” operation that can be bound

shaunlebron17:08:14

anxious to hear other ideas here

mattly18:08:15

it's a tough problem

mattly18:08:41

I think there are a handful of different use cases and it's hard to divine intentions