File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ func (c *client) withRPCClient(f func(*rpc.Client) error) error {
111111 if err != nil {
112112 log .Println (err )
113113 log .Println ("Fall back to localhost" )
114- rc , err = fallbackLocal ()
114+ rc , err = c . fallbackLocal ()
115115 if err != nil {
116116 return err
117117 }
@@ -124,8 +124,9 @@ func (c *client) withRPCClient(f func(*rpc.Client) error) error {
124124 return nil
125125}
126126
127- func fallbackLocal () (* rpc.Client , error ) {
127+ func ( c * client ) fallbackLocal () (* rpc.Client , error ) {
128128 port , err := server .ServeLocal ()
129+ server .LineEndingOpt = c .lineEnding
129130 if err != nil {
130131 return nil , err
131132 }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ type Clipboard struct{}
99
1010func (_ * Clipboard ) Copy (text string , _ * struct {}) error {
1111 <- connCh
12- return clipboard .WriteAll (lemon .ConvertLineEnding (text , lineEndingOpt ))
12+ return clipboard .WriteAll (lemon .ConvertLineEnding (text , LineEndingOpt ))
1313}
1414
1515func (_ * Clipboard ) Paste (_ struct {}, resp * string ) error {
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ import (
1212
1313var connCh = make (chan net.Conn , 1 )
1414
15- var lineEndingOpt string
15+ var LineEndingOpt string
1616
1717func Serve (c * lemon.CLI ) error {
1818 port := c .Port
1919 allowIP := c .Allow
20- lineEndingOpt = c .LineEnding
20+ LineEndingOpt = c .LineEnding
2121 ra , err := iprange .New (allowIP )
2222 if err != nil {
2323 return err
You can’t perform that action at this time.
0 commit comments