Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle auto fill mode.

  • Loading branch information...
commit 422267d9aa8a05ef0a204b02671f2e739705b80c 1 parent 8679559
Johan Andersson authored
Showing with 32 additions and 6 deletions.
  1. +8 −6 drag-stuff.el
  2. +24 −0 features/conflicting-modes.feature
14 drag-stuff.el
View
@@ -87,16 +87,18 @@
(defun drag-stuff-up (arg)
"Drag stuff ARG lines up."
(interactive "p")
- (if mark-active
- (drag-stuff-lines-up (- arg))
- (drag-stuff-line-up (- arg))))
+ (let ((auto-fill-function nil))
+ (if mark-active
+ (drag-stuff-lines-up (- arg))
+ (drag-stuff-line-up (- arg)))))
(defun drag-stuff-down (arg)
"Drag stuff ARG lines down."
(interactive "p")
- (if mark-active
- (drag-stuff-lines-down arg)
- (drag-stuff-line-down arg)))
+ (let ((auto-fill-function nil))
+ (if mark-active
+ (drag-stuff-lines-down arg)
+ (drag-stuff-line-down arg))))
(defun drag-stuff-right (arg)
"Drag stuff ARG lines to the right."
24 features/conflicting-modes.feature
View
@@ -0,0 +1,24 @@
+Feature: Drag Stuff
+ In order to work with various conflicting modes
+ Drag stuff needs to handle them manually
+
+ Scenario: Auto fill mode
+ Given I insert:
+ """
+ (defun lorem ()
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nunc nibh"
+ (if (<= (+ (line-number-at-pos (max (point) (mark))) arg) (count-lines (point-min) (point-max)))
+ ;; ...
+ ))
+ """
+ And I turn on drag-stuff
+ And I turn on auto-fill-mode
+ And I drag line "3" up
+ Then I should see:
+ """
+ (defun lorem ()
+ (if (<= (+ (line-number-at-pos (max (point) (mark))) arg) (count-lines (point-min) (point-max)))
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus nunc nibh"
+ ;; ...
+ ))
+ """
Please sign in to comment.
Something went wrong with that request. Please try again.