File tree Expand file tree Collapse file tree
web/pgadmin/static/js/components/ReactCodeMirror Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,7 +201,8 @@ export default class CustomEditorView extends EditorView {
201201 }
202202
203203 getSelection ( ) {
204- return this . state . selection . ranges . map ( ( range ) => this . state . sliceDoc ( range . from , range . to ) ) . join ( '' ) ?? '' ;
204+ const lineSep = this . state . facet ( eol ) ;
205+ return this . state . selection . ranges . map ( ( range ) => this . state . sliceDoc ( range . from , range . to ) ) . join ( lineSep ) ?? '' ;
205206 }
206207
207208 replaceSelection ( newValue ) {
Original file line number Diff line number Diff line change @@ -158,9 +158,8 @@ const defaultExtensions = [
158158 autoCompleteCompartment . of ( [ ] ) ,
159159 EditorView . clipboardOutputFilter . of ( ( text , state ) => {
160160 const lineSep = state . facet ( eol ) ;
161- // Fetch the primary selection from the editor's current state.
162- const selection = state . selection . main ;
163- return state . doc . sliceString ( selection . from , selection . to , lineSep ) ;
161+ // Fetch the selection range from the editor's current state.
162+ return state . selection . ranges . map ( ( range ) => state . sliceDoc ( range . from , range . to ) ) . join ( lineSep ) ?? '' ;
164163 } )
165164] ;
166165
You can’t perform that action at this time.
0 commit comments