More agressive overwrite.

This commit is contained in:
Eugene Vigdorchik 2012-02-27 22:28:09 +04:00
parent cca5b7e2f7
commit 63aa36bd1e
4 changed files with 7 additions and 8 deletions

View File

@ -107,9 +107,8 @@ object SessionSettings
val (_, oldShifted, replace, lineMap) = ((0, List[Setting[_]](), List[SessionSetting](), Map.empty[Int, (Int, List[String])]) /: inFile) {
case ((offs, olds, repl, lineMap), s) =>
val RangePosition(_, r@LineRange(start, end)) = s.pos
def depends(s: Setting[_]) = !s.init.dependencies.isEmpty
settings find (_._1.key == s.key) match {
case Some(ss@(ns, newLines)) if !depends(s) && !depends(ns) =>
case Some(ss@(ns, newLines)) if !ns.init.dependencies.contains(ns.key) =>
val shifted = ns withPos RangePosition(path, LineRange(start - offs, start - offs + 1))
(offs + end - start - newLines.size, shifted::olds, ss::repl, lineMap + (start -> (end, newLines)))
case _ =>

View File

@ -1,7 +1,4 @@
k1 := {error("k1")}
k2 := {
}
k2 <<= k1 map identity

View File

@ -1,7 +1,4 @@
k1 := {}
k2 := {
}
k2 <<= k1 map identity

View File

@ -0,0 +1,6 @@
k1 := {}
k2 := {}
k1 <<= k1 map {_ => error("k1")}