Skip to content

Commit

Permalink
fixed some problems from rebasing
Browse files Browse the repository at this point in the history
  • Loading branch information
janhrastnik committed Jun 16, 2021
1 parent 7cf0fa0 commit 9c3eadb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 31 deletions.
22 changes: 6 additions & 16 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ use helix_core::{
movement::{self, Direction},
object, pos_at_coords,
regex::{self, Regex},
<<<<<<< HEAD
register::{self, Register, Registers},
search, selection, Change, ChangeSet, Position, Range, Rope, RopeSlice, Selection, SmallVec,
Tendril, Transaction,
=======
register, search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice,
Selection, SmallVec, Tendril, Transaction,
>>>>>>> 856fd95 (trying out line ending helper functions in commands.rs)
search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice, Selection,
SmallVec, Tendril, Transaction,
};

use helix_view::{
Expand Down Expand Up @@ -348,7 +343,7 @@ where
KeyEvent {
code: KeyCode::Enter,
..
} => '\n',
} => '\n',
KeyEvent {
code: KeyCode::Char(ch),
..
Expand Down Expand Up @@ -2285,15 +2280,10 @@ fn paste_impl(
.unwrap(),
);

<<<<<<< HEAD
// if any of values ends \n it's linewise paste
let linewise = values.iter().any(|value| value.ends_with('\n'));
=======
// if any of values ends \n it's linewise paste
let linewise = values
.iter()
.any(|value| value.ends_with(doc.line_ending()));
>>>>>>> 856fd95 (trying out line ending helper functions in commands.rs)
let linewise = values
.iter()
.any(|value| value.ends_with(doc.line_ending()));

let mut values = values.iter().cloned().map(Tendril::from).chain(repeat);

Expand Down
17 changes: 2 additions & 15 deletions helix-view/src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use std::path::{Component, Path, PathBuf};
use std::sync::Arc;

use helix_core::{
auto_detect_line_ending,
chars::{char_is_linebreak, char_is_whitespace},
history::History,
syntax::{LanguageConfiguration, LOADER},
ChangeSet, Diagnostic, LineEnding, Rope, Selection, State, Syntax, Transaction,
DEFAULT_LINE_ENDING,
Expand All @@ -28,21 +30,6 @@ pub enum IndentStyle {
Spaces(u8),
}

/// Represents one of the valid Unicode line endings.
/// Also acts as an index into `LINE_ENDINGS`.
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum LineEnding {
None = 0, // No line ending
Crlf = 1, // CarriageReturn followed by LineFeed
LF = 2, // U+000A -- LineFeed
VT = 3, // U+000B -- VerticalTab
FF = 4, // U+000C -- FormFeed
CR = 5, // U+000D -- CarriageReturn
Nel = 6, // U+0085 -- NextLine
LS = 7, // U+2028 -- Line Separator
PS = 8, // U+2029 -- ParagraphSeparator
}

pub struct Document {
// rope + selection
pub(crate) id: DocumentId,
Expand Down

0 comments on commit 9c3eadb

Please sign in to comment.