Skip to content

Remove Duplicate Lines affects bookmarks #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions content/docs/editing.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@ Below the **Begin/End Select** entries, there are a number of sub-menus to the *
* **Duplicate Current Line**: Duplicates the current line. (Prior to v8.6, if a selection was active it would duplicate just that selection, but starting in v8.6, selection state is ignored for this menu command; if you want the old behavior, the <kbd>Ctrl+D</kbd> shortcut is, by default, still assigned to the selection-aware duplication, under `SCI_SELECTIONDUPLICATE` in the [Shortcut Mapper](../preferences/#shortcut-mapper).)
* There are two versions of the Remove Duplicates functionality:
* **Remove Duplicate Lines**: leaves only the first instance of any full lines that have more than one copy anywhere in the active file; acts upon the line set spanned by the current selection, or the entire file if no active selection
- _Note_: Because of the way it's implemented, this command also clears all bookmarks.
* **Remove Consecutive Duplicate Lines**: will only remove duplicates that are on the lines immediately following the first instance (still keeping the first instance); acts upon the line set spanned by the current selection, or the entire file if no active selection
- _Note_: Because of the way it's implemented, this command does not clear all bookmarks. However, if a bookmarked line is one of the consecutive duplicate lines removed, that bookmark will remain on the old line number (which means it is now bookmarking whatever text used to be _after_ that line).
* NOTE: Duplicates removal is performed with the assumption that all line-endings in the file are uniform and match the current selection for the file being edited -- the quickest way to check that selection is to glance at the status bar, where the current line-ending type is shown either as `Windows (CR LF)`, `Unix (LF)` or `Macintosh (CR)`. It might be desirable to check the line-ending types in your file before executing a sorting operation, and use the **Edit > EOL Conversion >** choices or right-click on the Status Bar's EOL indicator to fix the line endings if necessary.
* There are methods for splitting lines and joining lines together:
* **Split Lines**: will insert a line-ending into a long line(s): if there is one or more [Vertical Edge](../preferences/#margins-border-edge) value specified, it will split at the right-most Vertical Edge; otherwise, it will split at the current size of the editor window. It operates on the lines spanned by the current stream selection or the single line of the [caret](#caret-and-cursor "typing/insertion cursor") if no stream selection is currently active.
Expand Down