on master help sign in
fixed some problems from rebasing
commit9c3eadb2e4fd297abcc8ceb02b3088ab3b9b1ceb authorJan Hrastnik <jan.hrastnik2@gmail.com> dateWed 16 Jun 2021, 17:22 (5 years ago) parent7cf0fa0
2 files changed+8−31
helix-term/src/commands.rs+6−16 helix-view/src/document.rs+2−15
helix-term/src/commands.rs+6−16
@@ -4,14 +4,9 @@ use helix_core::{
44 movement::{self, Direction},
55 object, pos_at_coords,
66 regex::{self, Regex},
7−<<<<<<< HEAD
87 register::{self, Register, Registers},
9− search, selection, Change, ChangeSet, Position, Range, Rope, RopeSlice, Selection, SmallVec,
10− Tendril, Transaction,
11−=======
12− register, search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice,
13− Selection, SmallVec, Tendril, Transaction,
14−>>>>>>> 856fd95 (trying out line ending helper functions in commands.rs)
8+ search, selection, Change, ChangeSet, LineEnding, Position, Range, Rope, RopeSlice, Selection,
9+ SmallVec, Tendril, Transaction,
1510};
1611
1712use helix_view::{
@@ -348,7 +343,7 @@ where
348343 KeyEvent {
349344 code: KeyCode::Enter,
350345 ..
351− } => '\n',
346+ } => '\n',
352347 KeyEvent {
353348 code: KeyCode::Char(ch),
354349 ..
@@ -2285,15 +2280,10 @@ fn paste_impl(
22852280 .unwrap(),
22862281 );
22872282
2288−<<<<<<< HEAD
22892283 // if any of values ends \n it's linewise paste
2290− let linewise = values.iter().any(|value| value.ends_with('\n'));
2291−=======
2292− // if any of values ends \n it's linewise paste
2293− let linewise = values
2294− .iter()
2295− .any(|value| value.ends_with(doc.line_ending()));
2296−>>>>>>> 856fd95 (trying out line ending helper functions in commands.rs)
2284+ let linewise = values
2285+ .iter()
2286+ .any(|value| value.ends_with(doc.line_ending()));
22972287
22982288 let mut values = values.iter().cloned().map(Tendril::from).chain(repeat);
22992289
helix-view/src/document.rs+2−15
@@ -5,7 +5,9 @@ use std::path::{Component, Path, PathBuf};
55use std::sync::Arc;
66
77use helix_core::{
8+ auto_detect_line_ending,
89 chars::{char_is_linebreak, char_is_whitespace},
10+ history::History,
911 syntax::{LanguageConfiguration, LOADER},
1012 ChangeSet, Diagnostic, LineEnding, Rope, Selection, State, Syntax, Transaction,
1113 DEFAULT_LINE_ENDING,
@@ -28,21 +30,6 @@ pub enum IndentStyle {
2830 Spaces(u8),
2931}
3032
31−/// Represents one of the valid Unicode line endings.
32−/// Also acts as an index into `LINE_ENDINGS`.
33−#[derive(PartialEq, Copy, Clone, Debug)]
34−pub enum LineEnding {
35− None = 0, // No line ending
36− Crlf = 1, // CarriageReturn followed by LineFeed
37− LF = 2, // U+000A -- LineFeed
38− VT = 3, // U+000B -- VerticalTab
39− FF = 4, // U+000C -- FormFeed
40− CR = 5, // U+000D -- CarriageReturn
41− Nel = 6, // U+0085 -- NextLine
42− LS = 7, // U+2028 -- Line Separator
43− PS = 8, // U+2029 -- ParagraphSeparator
44−}
45−
4633pub struct Document {
4734 // rope + selection
4835 pub(crate) id: DocumentId,