Giter Club home page Giter Club logo

Comments (15)

brunetton avatar brunetton commented on June 27, 2024

Indeed

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

hi @brunetton,
i have worked on this package and the behavior of paste-from-clipboard is a topic now. Having a destructive-overwrite with space-chars seems reasonable to me. I have a simple version that already does so. Questions could be if its reasonable to have some sort of boundary (see issue-#14 'Whitespace overtype') or a end-of-line-limit or maybe smth. entirely different.
So I'd like to hear your thoughts on this.

greets Andreas

from atom-overtype-mode.

brunetton avatar brunetton commented on June 27, 2024

Hi @andread, I do not use Atom anymore so I don't take time on this project. Do you want me to add you as a project manager so you can merge PRs and manage other team people?

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

@brunetton hello Bruno,
hmm, why not - that's my first one then :-)
What editor have you switched to and does it feature a well-done overwrite-mode ?

regards, Andreas

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

At end-of-line it should just append to the end; it should not overwrite the linefeed and overtype into the next line.

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

I do use Atom, and I also think pasting should overwrite what's there when overtype mode is on, exactly as if the pasted text were typed.

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

@lawrence-dol
ok, I can imagine at least two cases

  1. a destructive-overwrite, with a boundary at the line-end. Therefore the content to insert shall not contain any line-feeds whatsoever. That said, it focusses on one line and overwrites all of its content, or maybe less. But it would in all cases leave the line-structure intact.
  2. a destructive-overwrite carrying itself line-feeds/returns in its new-content. That would eventually overwrite some buffer-lines, not looking for the end-of-line.
  3. maybe a combination if the use-case is alike issue-#14, where you find a table-like structure that contains 'holes', that is spaces, that should be filled with pasteboard-content, if doable.

Thats why I'm asking for your use-cases and needs. Cos' they are surely different from mine.

Technically I like to play with the idea of marking the overwrite-area by doing a selection. Then there would be two cases of user-intent - with a user-defined-area or without.

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

@Asc2011,

I think pasted linefeeds should be actioned by erasing to end-of-line, then moving to the next line and continuing to paste. With a question mark about moving to true start-of-line or the indented start of line.

When overtype pasting a block of text, hole insertion should be done as if they were individually pasted one at a time. I think all block-mode insertions should behave as if each line of the block were done individually at each successive caret.

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

I think pasted linefeeds should be actioned by erasing to end-of-line, then moving to the next line and continuing to paste.

@lawrence-dol sry, i don't understand completely. Pls. elaborate a bit between cases like :

  • clipboard has a single-line
  • clipboard has multi-line content

The current implementation is rather dumb.
An easy thing to do would be. When in doubt on paste, it first marks the target-region without mutating. A second paste-operation would then write to the buffer ?

greets

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

@Asc2011

What I mean is that clipboard paste overtype should, at the point of a line break, delete to the end of the line, move to the start of the next line at the column of the past point, and continue overtyping using the clipboard data.

This means if I copy the full lines include the 3 linefeeds of this text:

line 1
    line 2
        line 3

and paste with my cursor on the c of current in the first line:

The current implementation is rather dumb.
An easy thing to do would be. When in doubt on paste, it first marks 
the target-region without mutating. A second paste-operation would then write to the buffer ?

the result will be

The line 1
An e    line 2
the         line 3

and if pasted at the beginning of the line it would be:

line 1
    line 2
        line 3

In effect, my intent is to replace existing lines of text with the lines of text I copied.

This is distinct behavior from when I copy a block of text using muli-cursors, and paste that block into the same number of multi-cursors, where each cursor point is a normal overtype paste point. (Note that I don't know how, or even if, Atom indicates that text has been copied using multiple cursors, but I expect you end up with multiple blocks to paste.)

PS: I think the idea to indicate the paste first and then paste is fine, even better. But this is what I expect to happen when pasting in overtype mode.

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

@lawrence-dol
ok, I did not I expect this, but well, why not.
As a side note - i just added support for auto-complete-insertions. Testing this now, looks good. It basically supports two cases of inserts from the autocomplete-plus-package :

  1. the current-line has enough space, then it will only overwrite as much as needed and keeps the rest of the line-content.
  2. not enough space, then the newline moves to the right, finally expanding the line.

What you propose is cutting the right-parts of the target-region, but keeping the left-parts. I would name this maybe 'multiline-paste preserving source-indents and cutting rest-of-line' ?
I'll, give it a try, seems to be easy to do.
For now I expect the source-lines to be a single selection starting from column-0. As said, I need to look into the Atom's-API concerning vertical- or block-selections. I have not noticed anything alike, yet. There are packages that allow for block-selections - i don't use these. Internally i assume Atom will use multiple-cursors to simulate a vertical-/block-selection. I spare this for later...
Do you use snippet-insertion or have you tried snippets in overtype-mode ? With my version I encounter an error - which is rooted in Atoms-API - there is a report for this.
I'd like to know if the current version of overtype-mode supports snippets (maybe not properly) or if you see an error ?
What platform are you on Mac/Win/Unix ?

greets Andreas

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

@Asc2011

I don't use snippets yet, but I have a mental to-do to look into them as a substitute for macros I used to use in TextPad to insert common boilerplate code. So I will before very long. I am in the long-tail of transitioning from TextPad as my coding editor.

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

Just to put a finer point on multiline paste, if the last line of my example above were pasted without the final NL, e.g. line 1\n line 2\n line 3 at column 4, then the result would be:

The line 1
An e    line 2
the         line 5without mutating. A second paste-operation would then write to the buffer ?

Does that make sense? No NL means no erase to end-of-line.

from atom-overtype-mode.

Asc2011 avatar Asc2011 commented on June 27, 2024

@lawrence-dol a first version of this paste-action is there. I'm struggling a bit with auto-indent, so this paste-action does need some testing.
You're asking if it makes sense, to not cut the end of the last line. Well, at a first look, i'd be tempted to say no. But if that floats-your-boat, then feel free to take a look at the code - it's roughly 50-lines - and adjust it to your needs. BTW it does not depend on the overwrite-mode at all. One could just flesh it out and put it into init.coffee, assign a short-cut and happily rock your buffer.
... reworked ... seems reliable now.

from atom-overtype-mode.

lawrence-dol avatar lawrence-dol commented on June 27, 2024

@Asc2011 Where is this project at. I see no updates in the Atom packages repo. Do I need to pull this repo down and manually link into my atom packages? I am not familiar with how one goes about this.

from atom-overtype-mode.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.