mod.rs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. pub use auto_exit_block::*;
  2. pub use auto_format::*;
  3. pub use default_insert::*;
  4. pub use preserve_inline_style::*;
  5. pub use reset_format_on_new_line::*;
  6. mod auto_exit_block;
  7. mod auto_format;
  8. mod default_insert;
  9. mod preserve_inline_style;
  10. mod reset_format_on_new_line;
  11. use crate::{client::extensions::InsertExt, core::Delta};
  12. pub struct PreserveBlockStyleOnInsertExt {}
  13. impl InsertExt for PreserveBlockStyleOnInsertExt {
  14. fn ext_name(&self) -> &str { "PreserveBlockStyleOnInsertExt" }
  15. fn apply(
  16. &self,
  17. _delta: &Delta,
  18. _replace_len: usize,
  19. _text: &str,
  20. _index: usize,
  21. ) -> Option<Delta> {
  22. None
  23. }
  24. }
  25. pub struct PreserveLineStyleOnSplitExt {}
  26. impl InsertExt for PreserveLineStyleOnSplitExt {
  27. fn ext_name(&self) -> &str { "PreserveLineStyleOnSplitExt" }
  28. fn apply(
  29. &self,
  30. _delta: &Delta,
  31. _replace_len: usize,
  32. _text: &str,
  33. _index: usize,
  34. ) -> Option<Delta> {
  35. None
  36. }
  37. }
  38. pub struct InsertEmbedsExt {}
  39. impl InsertExt for InsertEmbedsExt {
  40. fn ext_name(&self) -> &str { "InsertEmbedsExt" }
  41. fn apply(
  42. &self,
  43. _delta: &Delta,
  44. _replace_len: usize,
  45. _text: &str,
  46. _index: usize,
  47. ) -> Option<Delta> {
  48. None
  49. }
  50. }
  51. pub struct ForceNewlineForInsertsAroundEmbedExt {}
  52. impl InsertExt for ForceNewlineForInsertsAroundEmbedExt {
  53. fn ext_name(&self) -> &str { "ForceNewlineForInsertsAroundEmbedExt" }
  54. fn apply(
  55. &self,
  56. _delta: &Delta,
  57. _replace_len: usize,
  58. _text: &str,
  59. _index: usize,
  60. ) -> Option<Delta> {
  61. None
  62. }
  63. }